0 Replies Latest reply on Aug 29, 2017 4:21 PM by 3531450

    Inter organization Intransit transaction

    3531450

      Hii,,

      Anyone please explain how can i do intransit transaction from backend...Im attaching my code with this..please correct this.Data not inserting into RCV_TRANSACTIONS....

      Waiting for reply

      Thank you

       

      MY code

       

       

      DECLARE

        V_HEADER_ID NUMBER;

        V_GROUP_ID NUMBER;

        av_txn_interface_id number := mtl_material_transactions_s.nextval; 

        av_txn_header_id number := mtl_material_transactions_s.nextval;

        av_return_value number;

        x_msg_count number;  

        x_return_status varchar2(100);

        x_trans_count number;

        x_message_list Error_Handler.Error_Tbl_Type;

        l_msg_data varchar2(2000);

          BEGIN

         

        fnd_global.apps_initialize (user_id        => 1014724,

                                    resp_id        => 20634,

                                    resp_appl_id   => 401);

       

       

             select RCV_INTERFACE_GROUPS_S.NEXTVAL into V_GROUP_ID from dual;

            

             select RCV_HEADERS_INTERFACE_S.NEXTVAL into V_HEADER_ID from dual ;

            

       

       

       

       

       

       

      insert into MTL_TRANSACTIONS_INTERFACE (

            

               transaction_header_id,

               creation_date,

               created_by,

               last_update_date,

               last_updated_by,

               source_code,

               source_line_id,

               source_header_id,

      process_flag,

      inventory_item_id,

      organization_id,

      subinventory_code,

      transaction_type_id,

      transaction_quantity,

      transaction_uom,

      transaction_date,

      transfer_organization,

      transfer_subinventory,

      transaction_mode,

      revision,

      shipment_number,

        transaction_interface_id)

      VALUES

      (

           --mtl_material_transactions_s.nextval,

          av_txn_header_id,

           SYSDATE, --- CREATION_DATE,

           1014724, --- CREATED_BY,

           SYSDATE, --- LAST_UPDATE_DATE,

           1014724, --- LAST_UPDATE_BY,

           'inter org transfer', --- SOURCE_CODE

           -99, --- SOURCE_LINE_ID,

           -99, --- SOURCE_HEADER_ID

            1, --- PROCESS_FLAG,

            858, --- INVENTORY_ITEM_ID,

            207, --- ORGANIZATION_ID,

            'Stores', --- SUBINVENTORY_CODE,

             21, --- TRANSACTION_TYPE_ID,

            -3, --- TRANSACTION_QUANTITY,

            'Ea', --- TRANSACTION_UOM,

        SYSDATE, --- TRANSACTION_DATE,

          209, --- TRANSFER_ORGANIZATION,

       

       

      'FGI', --- TRANSFER_SUBINVENTORY,

       

       

      1, --- TRANSACTION_MODE,

       

       

      '', --- REVISION,

       

       

      'new123', --- SHIPMENT_NUMBER

      av_txn_interface_id

      -- mtl_material_transactions_s.nextval

      );

       

       

        av_return_value := inv_txn_manager_pub.process_transactions(

              p_api_version     => 1.0,

              p_init_msg_list   => fnd_api.g_true,

              x_return_status   => x_return_status,

              x_msg_count       => x_msg_count,

              x_trans_count     => x_trans_count,

              x_msg_data        => l_msg_data,

              p_header_id       => av_txn_header_id

           );

           DBMS_OUTPUT.PUT_LINE('Return Status ==>' ||x_return_status||','||l_msg_data||','||av_txn_header_id);

           

             If x_return_status = 'E' THEN

               dbms_output.put_line('error message');

               error_handler.get_message_list(x_message_list=>x_message_list);

            ELSE

               dbms_output.put_line('Success !!!');

            END IF;

        

           exception       

           when others then

              dbms_output.put_line('error'|| SUBSTR(SQLERRM,1,200));

              --dbms_output.put_line('error');

      end;

       

       

       

       

       

       

      DECLARE

        v_call_status   BOOLEAN;

        v_rphase        VARCHAR2 (25);

        v_rstatus       VARCHAR2 (20);

        v_dphase        VARCHAR2 (100);

        v_dstatus       VARCHAR2 (100);

        v_message       VARCHAR2 (500);

        v_request_id    NUMBER;

        l_request_id    NUMBER;

        l_int_group_seq NUMBER;

        -- l_error_msg            varchar2(2000);

      TYPE lc_error_msg

      IS

        TABLE OF VARCHAR2(2000);

        l_error_msg lc_error_msg;

        P_ERROR_CODE NUMBER;

        P_ERROR_MSG  VARCHAR2(2000);

       

        begin

      select PO.RCV_INTERFACE_GROUPS_S.NEXTVAL into L_INT_GROUP_SEQ from dual;

      INSERT

        INTO RCV_HEADERS_INTERFACE

                      (

                      HEADER_INTERFACE_ID,

                      GROUP_ID,

                      PROCESSING_STATUS_CODE,

                      RECEIPT_SOURCE_CODE,

                      TRANSACTION_TYPE,

                       AUTO_TRANSACT_CODE,

                     -- ASN_TYPE,

                     

                      LAST_UPDATE_DATE,

                      LAST_UPDATED_BY,

                      LAST_UPDATE_LOGIN,

                      CREATION_DATE,

                      CREATED_BY,

                      VALIDATION_FLAG,   

                      SHIPPED_DATE,                              

                      EXPECTED_RECEIPT_DATE,

                      SHIPMENT_NUM,

                     -- VENDOR_ID,                                 

                     -- VENDOR_SITE_ID,

                      --BILL_OF_LADING,

                     --PACKING_SLIP,

                      --WAYBILL_AIRBILL_NUM,

                      FROM_ORGANIZATION_ID,

                      ship_to_organization_id,

                     -- SHIPMENT_HEADER_ID,

                  -- SHIPMENT_LINE_ID,

                      org_id)

                    SELECT

                          PO.RCV_HEADERS_INTERFACE_S.NEXTVAL,--header interface id

                          L_INT_GROUP_SEQ, --group id

                          'PENDING',--processing status code

                            'INVENTORY', --Receipt_Source_Code

                          --   'ASN',             

                        'NEW', --Transaction_Type

                            'DELIVER',  --Auto_Transact_Code

                               -- 'RECEIVE',               --TRANSACTION_TYPE

                           SYSDATE,  --LAST_UPDATE_DATE,

                          1014724, -- LAST_UPDATED_BY,

                          1014724, --  LAST_UPDATE_LOGIN,

                          SYSDATE, -- CREATION_DATE,

                          1014724, -- CREATED_BY,

                          'Y',       --  VALIDATION_FLAG,                         

                          '29-aug-2017', --  SHIPPED_DATE,   

                          '30-aug-2017', --  EXPECTED_RECEIPT_DATE,

                          'new123',   --SHIPMENT_NUM,

                         -- 5381,

                         -- 6635,

                         -- null,

                          --null,

                         -- null,

                           207, --from org

                           209, --to org

                          -- 7760375, --shipment header id

                          -- 7719591, --shipment line id

                             

                          (select operating_unit from org_organization_definitions where organization_id=207)

                          FROM DUAL;    --org id

                         

                         

                         

                         INSERT INTO RCV_TRANSACTIONS_INTERFACE

                          (INTERFACE_TRANSACTION_ID,

                          HEADER_INTERFACE_ID,

                          GROUP_ID,

                          LAST_UPDATE_DATE,

                          LAST_UPDATED_BY,

                          CREATION_DATE,

                          CREATED_BY,

                          LAST_UPDATE_LOGIN,

                          TRANSACTION_TYPE,

                          TRANSACTION_DATE,

                          PROCESSING_STATUS_CODE,  

                          PROCESSING_MODE_CODE,

                          TRANSACTION_STATUS_CODE,

                          AUTO_TRANSACT_CODE,

                          RECEIPT_SOURCE_CODE,   

                          SOURCE_DOCUMENT_CODE,   

                          VALIDATION_FLAG,

                          QUANTITY,

                          UNIT_OF_MEASURE,   

                          --PO_HEADER_ID,

                          --PO_RELEASE_ID,   

                          ITEM_ID,

                          TO_ORGANIZATION_ID,

                           FROM_SUBINVENTORY,

                            SUBINVENTORY,

                        -- LPN_GROUP_ID,

                         -- LICENSE_PLATE_NUMBER,

                          DESTINATION_TYPE_CODE,

      -- vendor_id,

                        --  vendor_site_id,

                            INTERFACE_SOURCE_CODE,

                          SHIPMENT_HEADER_ID,

                  SHIPMENT_LINE_ID,

                    EMPLOYEE_ID,

                          org_id

                          

                          )

                          SELECT

                              PO.RCV_TRANSACTIONS_INTERFACE_S.NEXTVAL,--id

                              PO.RCV_HEADERS_INTERFACE_S.CURRVAL,--hid

                              L_INT_GROUP_SEQ,--gid

                              SYSDATE,--lupdatedate

                              1004180,--udated by

                              SYSDATE,--creation date

                              1004180,--created by

                              1004180, --last update login      

                              'RECEIVE',               --TRANSACTION_TYPE  

                              SYSDATE,   --trasction date    

                              'PENDING',  -- PROCESSING_STATUS_CODE,             

                              'BATCH',--   PROCESSING_MODE_CODE,

                              'PENDING', ----TRANSACTION_STATUS_CODE,

                            'DELIVER',              --AUTO_TRANSACT_CODE    

                                'INVENTORY',        --RECEIPT_SOURCE_CODE

                                 'INVENTORY',        --SOURCE_DOCUMENT_CODE

                              'Y',  --       VALIDATION_FLAG,                              

                              3,  --  QUANTITY,

                              'Each',   --  UNIT_OF_MEASURE,       

                             -- 523882,

                              --null,           

                              858,    --item id           

                              209,    --to organization          

                           'Stores', --from sub inventory

                            'FGI', --to subinventory

                              'INVENTORY',        --DESTINATION_TYPE_CODE

                           --  5381,

                            --  6635,

                               'RCV',  --INTERFACE_SOURCE_CODE

                              7760381,--shipment headerid

                             77196113,--shipment line id

                             32849,--empid

                              (select operating_unit from org_organization_definitions where organization_id=209)

                              FROM DUAL;  --org id

                         

        fnd_global.apps_initialize (user_id        => 1014724,

                                    resp_id        => 50578,

                                    resp_appl_id   => 201);

       

       

       

       

        DBMS_OUTPUT.put_line ('Before Calling RCV Request' || l_int_group_seq);

        l_request_id := apps.fnd_request.submit_request ( 'PO', 'RVCTP', 'Transaction processing module for integrated Receiving', SYSDATE, FALSE, argument1 => 'BATCH', argument2 => l_int_group_seq, --GROUP ID  l_int_group_seq

        argument3 =>204);                                                                                                                                                                              -- OPERATING UNIT  l_org_id

        UPDATE applsys.fnd_concurrent_requests

        SET priority     = 1

        WHERE request_id = l_request_id;

        DBMS_OUTPUT.put_line ('l_request_id: ' ||l_request_id);

       

      END;