采购接收直接入库interface导入

直接入库接收方式:把相关数据插入到两个interface之后,运行请求:采购接收导入接口程序,即可完成入库动作,也可用代码的方式run这个程序
declare
tl_rcv_transactions_interface   rcv_transactions_interface%rowtype;
tl_MTL_TXN_LOTS_INTERFACE   MTL_TRANSACTION_LOTS_INTERFACE%rowtype;
tl_rcv_headers_interface   rcv_headers_interface%rowtype;--header
ln_request_id NUMBER;
begin
 
       select po.rcv_headers_interface_s.NEXTVAL 
       into tl_rcv_headers_interface.header_interface_id
       from dual; 
       
     select po.rcv_interface_groups_s.NEXTVAL 
       into tl_rcv_headers_interface.group_id
       from dual;
       tl_rcv_headers_interface.Ship_To_Organization_Id := 85;
     tl_rcv_headers_interface.processing_status_code := 'PENDING';
     tl_rcv_headers_interface.receipt_source_code := 'VENDOR';
     tl_rcv_headers_interface.transaction_type := 'NEW';
     tl_rcv_headers_interface.expected_receipt_date := sysdate;
     tl_rcv_headers_interface.validation_flag := 'Y';
     tl_rcv_headers_interface.vendor_id := 273;
     tl_rcv_headers_interface.vendor_site_id := 402;
     tl_rcv_headers_interface.CREATION_DATE := SYSDATE;
     tl_rcv_headers_interface.CREATED_BY := 1153;
     tl_rcv_headers_interface.LAST_UPDATE_DATE := SYSDATE;
     tl_rcv_headers_interface.LAST_UPDATED_BY := 1153;
     tl_rcv_headers_interface.LAST_UPDATE_LOGIN := NULL;
     INSERT INTO rcv_headers_interface VALUES tl_rcv_headers_interface;
       
 
     
        select rcv_transactions_interface_s.nextval
          into tl_rcv_transactions_interface.interface_transaction_id
          from dual;
        tl_rcv_transactions_interface.subinventory := '1210101';
        tl_rcv_transactions_interface.quantity  := 1;
        tl_rcv_transactions_interface.group_id  := tl_rcv_headers_interface.group_id;
        tl_rcv_transactions_interface.primary_quantity := tl_rcv_transactions_interface.quantity;
        tl_rcv_transactions_interface.transaction_type        := 'RECEIVE';--'RECEIVE';
        tl_rcv_transactions_interface.transaction_date        := SYSDATE;
        tl_rcv_transactions_interface.processing_status_code  := 'PENDING';
        tl_rcv_transactions_interface.processing_mode_code    := 'BATCH';
        tl_rcv_transactions_interface.transaction_status_code := 'PENDING';
        tl_rcv_transactions_interface.category_id             := 1309;
        tl_rcv_transactions_interface.unit_of_measure         := 'PCS';
        tl_rcv_transactions_interface.primary_unit_of_measure := 'PCS';
        tl_rcv_transactions_interface.interface_source_code   := 'RCV';
        tl_rcv_transactions_interface.validation_flag         := 'Y';
        tl_rcv_transactions_interface.item_id                 := 12450;
        tl_rcv_transactions_interface.item_description        := 'Switch IC,RT9711CGB,2.5~5.5V,80mΩ, 1.5A/0.6A High-Side Power Switches with Flag,SOT23-5,0D95_3X3X1,-40~+85,SMT,LF,Richtek';
        tl_rcv_transactions_interface.uom_code                := 'PCS';
        tl_rcv_transactions_interface.auto_transact_code      := 'DELIVER';
        tl_rcv_transactions_interface.receipt_source_code     := 'VENDOR';
        tl_rcv_transactions_interface.to_organization_id      := 85;
       -- tl_rcv_transactions_interface.routing_header_id       := 3;
        --tl_rcv_transactions_interface.routing_step_id         := 1;
        tl_rcv_transactions_interface.source_document_code    := 'PO';
        tl_rcv_transactions_interface.destination_type_code   := 'INVENTORY';
       /* select DECODE(SUBSTR(tl_rcv_transactions_interface.subinventory,
                             2,
                             1),
                      '2',
                      143,
                      '1',
                      142,
                      143)
          into tl_rcv_transactions_interface.location_id
          from dual;*/
          tl_rcv_transactions_interface.location_id := 142;
        tl_rcv_transactions_interface.deliver_to_location_id  := tl_rcv_transactions_interface.location_id;
     --   tl_rcv_transactions_interface.subinventory            := tl_rcv_transactions_interface.subinventory;
        tl_rcv_transactions_interface.expected_receipt_date   := SYSDATE;
        tl_rcv_transactions_interface.destination_context     := 'INVENTORY';
        tl_rcv_transactions_interface.vendor_id := 273;
        tl_rcv_transactions_interface.vendor_site_id := 402;
        tl_rcv_transactions_interface.po_header_id := 56896;
        tl_rcv_transactions_interface.po_line_id := 103091;
        tl_rcv_transactions_interface.po_line_location_id := 104104;
        tl_rcv_transactions_interface.po_distribution_id  := 103041;
      ---  tl_rcv_transactions_interface.oe_order_header_id      := v_line.header_id;
      --  tl_rcv_transactions_interface.oe_order_line_id        := v_line.order_line_id;
      ----  tl_rcv_transactions_interface.customer_id             := tl_rcv_headers_interface.customer_id;
        tl_rcv_transactions_interface.header_interface_id   := tl_rcv_headers_interface.header_interface_id;
        tl_rcv_transactions_interface.last_update_date  := SYSDATE;
        tl_rcv_transactions_interface.last_updated_by   := 1153;--fnd_global.user_id;
        tl_rcv_transactions_interface.creation_date     := SYSDATE;
        tl_rcv_transactions_interface.created_by        := 1153;--fnd_global.user_id;
        tl_rcv_transactions_interface.last_update_login := NULL;--fnd_global.login_id;
        
        tl_rcv_transactions_interface.interface_source_code    := 'notice_ship';
        tl_rcv_transactions_interface.interface_source_line_id := 1111;
        
        insert into rcv_transactions_interface values tl_rcv_transactions_interface;
        COMMIT;
        
        
        

        
end;



        declare
ln_request_id number;
begin
  fnd_global.apps_initialize(user_id      => 1553 --  20150911040  Y9PD-560512-00  2015-12-03  4000
                            ,
                             resp_id      => 50643,--50647  50643
                             resp_appl_id => 201);
  MO_GLOBAL.init('SQLAP');
  ln_request_id := fnd_request.submit_request(application => 'PO'
                                                       ,program     => 'RVCTP'  
                                                       ,sub_request => FALSE
                                                       ,argument1   => 'BATCH'--v_split.OPERATING_UNIT
                                                       ,argument2   => null--tl_rcv_headers_interface.group_id--v_split.order_source_id
                                                       ,argument3   => NULL--v_split.orig_sys_document_ref
                                                       ,argument4   => ''
                                                       ,argument5   => ''
                                                       ,argument6   => ''
                                                       ,argument7   => ''
                                                       ,argument8   => ''
                                                       ,argument9   => ''
                                                       ,argument10  => ''
                                                       ,argument11  => ''
                                                       ,argument12  => ''
                                                       ,argument13  => ''
                                                       ,argument14  => ''
                                                       ,argument15  => '');
     commit;
     dbms_output.put_line(ln_request_id);
end;

你可能感兴趣的:(PO)