Sunday 4 January 2015

Purchasing Interface


p_interface_header_id:= po_headers_interface_s.nextval;

INSERT INTO po_headers_interface(interface_header_id
, action
, org_id
, batch_id
, document_type_code
, currency_code
, vendor_name
, vendor_id
, vendor_site_code
, vendor_site_id
, vendor_doc_num
, agent_id
, ship_to_location_id
, attribute15
, creation_date
, created_by
, last_update_date
, last_updated_by)
VALUES (p_interface_header_id
,'ORIGINAL'
, p_org_id
, p_batch_id
, 'STANDARD'
, p_currency_code
, p_vendor_name
, p_vendor_id
, p_vendor_site_code
, p_vendor_site_id
, p_jde_sales_order_number
, p_agent_id
, l_ship_to_location_id
, p_jde_sales_order_number
, SYSDATE
, fnd_global.user_id
, SYSDATE
, fnd_global.user_id);

 INSERT INTO po_lines_interface (interface_line_id
, interface_header_id
, price_break_lookup_code
, line_num
, shipment_num
, item_id
, item_revision
, uom_code
, quantity
, unit_price
, ship_to_organization_id
, need_by_date
, creation_date
, created_by
, last_update_date
, last_updated_by)
VALUES (po_lines_interface_s.NEXTVAL
, p_interface_header_id
, 'NON CUMULATIVE'
, p_jde_sales_order_line_number
, '1'
, l_inventory_item_id
, l_revision
, p_item_uom_code
, p_item_quantity
, p_item_po_price
, p_organization_id
, p_promised_date
, SYSDATE
, fnd_global.user_id
, SYSDATE
, fnd_global.user_id);

  INSERT INTO po.po_distributions_interface (interface_header_id
, interface_line_id
, interface_distribution_id
, distribution_num
, quantity_ordered)
VALUES (p_interface_header_id
, po.po_lines_interface_s.CURRVAL
, po.po_distributions_interface_s.NEXTVAL
, 1
, p_item_quantity);


INTERFACE TABLES
================
po_headers_interface
po_lines_interface
po_distributions_interface
po_interface_errors

SELECT * 
FROM PO_INTERFACE_ERRORS 
WHERE TABLE_NAME = :TABLE_NAME;




No comments:

Post a Comment