Thursday, 19 November 2015

Enable Debug Profile Options

Set values as below:

FND: Debug: YES
FND: DEBUG LEVEL: STATEMENT
INV: DEBUG TRACE YES
INV: DEBUG Level: 102
INV: Debug File = /tmp/invdbg_AA.db
MRP: Debug Mode: Yes

This debug setting is helpful when something is going wrong during a concurrent program.
Run the standard program or API.

Check the log.

Disabling a BOM Routing and then Adding same routing again.

Pass the values to API like this:

Update Mode --
 p_operation_rec(l_upd_cnt).Assembly_Item_Name :='ECJ1VC1H050C';
 p_operation_rec(l_upd_cnt).Organization_Code := 'GLO';
 p_operation_rec(l_upd_cnt).Operation_Sequence_Number :=100;
 p_operation_rec(l_upd_cnt).Operation_Type := 1;
 p_operation_rec(l_upd_cnt).Start_Effective_Date := '09-Nov-2015'; --Existing old effective date
 p_operation_rec(l_upd_cnt).disable_date := TO_DATE('9-Nov-2015, 23:59:59','DD-MON-YYYY, HH24:MI:SS');
 p_operation_rec(l_upd_cnt).Standard_Operation_Code := '10';
 p_operation_rec(l_upd_cnt).Transaction_Type := 'UPDATE';
 While creating the same routing -CREATE mode
 p_operation_rec(l_upd_cnt).Assembly_Item_Name := 'ECJ1VC1H050C';
 p_operation_rec(l_upd_cnt).Organization_Code := 'GLO';
 p_operation_rec(l_upd_cnt).Operation_Sequence_Number :=100;
 p_operation_rec(l_upd_cnt).Operation_Type := 1;
 p_operation_rec(l_upd_cnt).Start_Effective_Date := TO_DATE('10-Nov-2015, 00:00:00','DD-MON-YYYY, HH24:MI:SS');
 p_operation_rec(l_upd_cnt).disable_date := NULL;
 p_operation_rec(l_upd_cnt).Standard_Operation_Code := '10';
 p_operation_rec(l_upd_cnt).Transaction_Type := 'CREATE';

x_rtg_header_rec := bom_rtg_pub.g_miss_rtg_header_rec;
      x_rtg_revision_tbl.DELETE;
      x_operation_tbl.DELETE;
      x_op_resource_tbl.DELETE;
      x_sub_resource_tbl.DELETE;
      x_op_network_tbl.DELETE;
      error_handler.initialize;
      xx_mas_print_log_p ( 'Pass in API' );
      bom_rtg_pub.process_rtg (
        p_bo_identifier         => 'RTG'
      , p_api_version_number    => '1.0'
      , p_init_msg_list         => TRUE
      , p_rtg_header_rec        => l_rtg_header_rec
      , p_operation_tbl         => p_operation_rec
      , p_op_resource_tbl       => l_op_resource_tbl
      , p_sub_resource_tbl      => l_sub_resource_tbl
      , p_op_network_tbl        => l_op_network_tbl
      , x_rtg_header_rec        => x_rtg_header_rec
      , x_rtg_revision_tbl      => x_rtg_revision_tbl
      , x_operation_tbl         => x_operation_tbl
      , x_op_resource_tbl       => x_op_resource_tbl
      , x_sub_resource_tbl      => x_sub_resource_tbl
      , x_op_network_tbl        => x_op_network_tbl
      , x_return_status         => l_return_status
      , x_msg_count             => l_msg_count
      );
      COMMIT;
      xx_mas_print_log_p ( 'BOM_RTG_PUB.PROCESS_RTG' );
      xx_mas_print_log_p ('Return Status for ' || ' = ' || l_return_status );
      xx_mas_print_log_p ('Message Count for ' || ' = ' || l_msg_count );
      error_handler.get_message_list ( l_error_message_list );
      IF l_return_status <> 'S' THEN
        -- Error Processing
        l_err_message := NULL;
        l_err_message_type := NULL;
        FOR k IN 1 .. l_msg_count
        LOOP
          IF l_err_message IS NULL THEN
            l_err_message := SUBSTR (
                              l_error_message_list ( k ).MESSAGE_TEXT
                            , 1
                            , 250
                            );
            xx_mas_print_log_p ('Error in API - l_err_message1:' || l_err_message );
          ELSE
            l_err_message :=
                 l_err_message || '-' || SUBSTR (
                                          l_error_message_list ( k ).MESSAGE_TEXT
                                        , 1
                                        , 250
                                        );
            xx_mas_print_log_p ('Error in API - l_err_message1:' || l_err_message );
          END IF;
          IF l_err_message_type IS NULL THEN
            l_err_message_type := l_error_message_list ( k ).MESSAGE_TYPE;
          ELSE
            l_err_message_type :=
                               l_err_message_type || '-' || l_error_message_list ( k ).MESSAGE_TYPE;
          END IF;
        END LOOP;
END IF;

REGEXP_INSTR

How to use REGEXP_INSTR.
REGEXP_INSTR is used to get multiple values positions in a string.

For Example:
let say we need to find the position of (-) and (*) in single string.

SELECT REGEXP_INSTR (
                   'ABC-CDE&'
                 , '(-|&)'
                 )
          FROM   DUAL;

This will return you 4.

Useful fusion query for User access

  Table FUN_USER_ROLE_DATA_ASGNMNTS is used for “Manage data access for users”. it will store use and role assignment to data security. Tabl...