Tuesday 30 December 2014

PO Receipt Interface

INSERT INTO rcv_headers_interface(header_interface_id
,GROUP_ID
,processing_status_code
,receipt_source_code
,transaction_type
,last_update_date
,last_updated_by
,last_update_login
,vendor_id
,expected_receipt_date
,validation_flag)
    VALUES 
    (rcv_headers_interface_s.NEXTVAL
,p_group_id
,'PENDING'
,'VENDOR'
,'NEW'
,SYSDATE
,fnd_global.user_id
,0
,p_vendor_id
,SYSDATE
,'Y');
 
INSERT INTO rcv_transactions_interface (interface_transaction_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
                                       ,po_header_id
                                       ,po_line_id
                                       ,item_id
                                       ,quantity
                                       ,unit_of_measure
                                       ,po_line_location_id
                                       ,auto_transact_code
                                       ,receipt_source_code
                                       ,to_organization_code
                                       ,source_document_code
                                       ,header_interface_id
                                       ,validation_flag --, subinventory
                                       )
VALUES 
(l_parent_txn
,rcv_interface_groups_s.CURRVAL
,SYSDATE
,fnd_global.user_id
,SYSDATE
 ,fnd_global.user_id
,0
,'RECEIVE'
,SYSDATE
 ,'PENDING'
,'BATCH'
,'PENDING'
,cr_po_rec.po_header_id
,cr_po_rec.po_line_id
,cr_po_rec.item_id
,cr_po_rec.quantity
,cr_po_rec.unit_meas_lookup_code
,cr_po_rec.line_location_id
,'RECEIVE'
,'VENDOR'
,cr_po_rec.organization_code
,'PO'
,rcv_headers_interface_s.CURRVAL
,'Y'                              --, p_subinventory_name
                                      );

INSERT INTO rcv_transactions_interface (interface_transaction_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
      ,po_header_id
      ,po_line_id
      ,item_id
      ,quantity
      ,unit_of_measure
      ,po_line_location_id
      ,auto_transact_code
      ,receipt_source_code
      ,to_organization_code
      ,source_document_code
      ,header_interface_id
      ,validation_flag
      ,subinventory
      ,parent_interface_txn_id)
       VALUES 
       (rcv_transactions_interface_s.NEXTVAL
,rcv_interface_groups_s.CURRVAL
,SYSDATE
,fnd_global.user_id
,SYSDATE
,fnd_global.user_id
,0
,'DELIVER'
,SYSDATE
,'PENDING'
,'BATCH'
,'PENDING'
,cr_po_rec.po_header_id
,cr_po_rec.po_line_id
,cr_po_rec.item_id
,cr_po_rec.quantity
,cr_po_rec.unit_meas_lookup_code
,cr_po_rec.line_location_id
,'INVENTORY'
,'VENDOR'
,cr_po_rec.organization_code
,'PO'
,rcv_headers_interface_s.CURRVAL
,'Y'
,'PICKLINE'
,l_parent_txn);

INTERFACE TABLES
================
rcv_headers_interface
rcv_transactions_interface
po_interface_errors

Submitting the Receipt Interface
================================
 l_receipt_request_id := fnd_request.submit_request (application       => 'PO'
     ,program          => 'RVCTP'
     ,description      => NULL
     ,start_time        => NULL
     ,sub_request    => FALSE
             ,argument1      => 'BATCH'
     ,argument2      => l_group_id
     ,argument3      => NULL);

COMMIT;

1 comment:

  1. Hi , what is l_parent_txn in the above script?
    Thanks

    ReplyDelete