Вы находитесь на странице: 1из 5

Is It Possible To Add New Lines To A Standard Purchase Order Via Pdoi ?

Solution
In 11.5.10 you can add a line to a Standard Purchase Order using the Purchasing
Document Open Interface
Note 359295.1Oracle® Purchasing Release 11i10 Open Interfaces and APIs
Oracle® Purchasing Release 11i Open Interfaces and APIs
Page 10-42
Update Standard Purchase Order
You can add a line to an existing standard purchase order by choosing the UPDATE
action. You cannot update an existing standard purchase order line through this
program.The Purchase Documents Open Interface performs updates of standard
purchase orders by doing the following:
First, it identifies the purchase order by com paring supplier document number
(VENDOR_DOC_NUM in the PO_HEADERS_INTERFACE table and
VENDOR_ORDER_NUM in PO_HEADERS_ALL) or document number
(DOCUMENT_NUM in PO_HEADERS_INTERFACE and SEGMENT1 in PO_
HEADERS_ALL).
If you provide a line number, the Purchase Document Open Interface validates
that the line number you provide for the line does not already exist in the
document.
Creates the line, shipment and distribution with the information you provide in
the interface tables for the document.

Example scripts using the "Vision Operations" data.


INSERT INTO po.po_headers_interface
(interface_header_id,
batch_id,
process_code,
action,
org_id,
document_type_code,
currency_code,
agent_id,
vendor_name,
vendor_site_code,
ship_to_location,
bill_to_location,
reference_num)
VALUES
(apps.po_headers_interface_s.NEXTVAL,
9,
'PENDING',
'ORIGINAL',
204, -- Your operating unit id
'STANDARD',
'USD', -- Your currency code
57, -- Your buyer id
'Office Supplies, Inc.',
'OFFICESUPPLIES',
'V1- New York City', -- Your ship to
'V1- New York City', -- Your bill to
'TEST3') -- Any reference num
/
INSERT INTO po.po_lines_interface
(interface_line_id,
interface_header_id,
line_num,
shipment_num,
line_type,
item,
uom_code,
quantity,
unit_price,
promised_date,
ship_to_organization_code,
ship_to_location)
VALUES
(po_lines_interface_s.nextval,
po_headers_interface_s.currval,
1,
1,
'Goods',
'CM11062',
'Ea',
1,
17.50,
'10-JAN-2005',
'V1',
'V1- New York City' )
/
INSERT INTO po.po_distributions_interface
(interface_header_id,
interface_line_id,
interface_distribution_id,
distribution_num,
quantity_ordered,
charge_account_id)
VALUES
(po_headers_interface_s.currval,
po.po_lines_interface_s.CURRVAL,
po.po_distributions_interface_s.NEXTVAL,
1,
1,
12975) -- Your Charge Account Id
/
INSERT INTO po.po_lines_interface
(interface_line_id,
interface_header_id,
line_num,
shipment_num,
line_type,
item,
uom_code,
quantity,
unit_price,
promised_date,
ship_to_organization_code,
ship_to_location)
VALUES
(apps.po_lines_interface_s.NEXTVAL,
apps.po_headers_interface_s.CURRVAL,
1,
2,
'Goods',
'CM11062', -- Your item
'Ea',
2,
17.50,
'10-JAN-2005',
'V1',
'V1- New York City')
/
INSERT INTO po.po_distributions_interface
(interface_header_id,
interface_line_id,
interface_distribution_id,
distribution_num,
quantity_ordered,
charge_account_id)
VALUES
(po.po_headers_interface_s.CURRVAL,
po.po_lines_interface_s.CURRVAL,
po.po_distributions_interface_s.NEXTVAL,
1,
1,
12975) -- Your charge account id
/
INSERT INTO po.po_distributions_interface
(interface_header_id,
interface_line_id,
interface_distribution_id,
distribution_num,
quantity_ordered,
charge_account_id)
VALUES
(po.po_headers_interface_s.CURRVAL,
po.po_lines_interface_s.CURRVAL,
po.po_distributions_interface_s.NEXTVAL,
2,
1,
12975) -- Your charge account id
/
--------------------------------------------------------------------------------
--------------------
--------------------------------------------------------------------------------
--------------------
Ran the Import Standard Purchase Orders
The process created PO 11896
I changed the action to UPDATE and added the DOCUMENT_NUM (value 11896 ).
INSERT INTO po.po_headers_interface
(interface_header_id,
batch_id,
process_code,
action,
org_id,
document_t ype_code,
DOCUMENT_NUM,
currency_code,
agent_id,
vendor_name,
vendor_site_code,
ship_to_location,
bill_to_location,
reference_num)
VALUES
(apps.po_headers_interface_s.NEXTVAL,
9,
'PENDING',
'UPDATE',
204, -- Your operating unit id
'STANDARD',
'11896',
'USD', -- Your currency code
57, -- Your buyer id
'Office Supplies, Inc.',
'OFFICESUPPLIES',
'V1- New York City', -- Your ship to
'V1- New York City', -- Your bill to
'TEST3') -- Any reference num
/
INSERT INTO po.po_lines_interface
(interface_line_id,
interface_header_id,
line_num,
shipment_num,
line_type,
item,
uom_code,
quantity,
unit_price,
promised_date,
ship_to_organization_code,
ship_to_location)
VALUES
(po_lines_interface_s.nextval,
po_headers_interface_s.currval,
2,
1,
'Goods',
'CM11062',
'Ea',
2,
17.50,
'10-JAN-2005',
'V1',
'V1- New York City' )
/
INSERT INTO po.po_distributions_interface
(interface_header_id,
interface_line_id,
interface_distribution_id,
distribution_num,
quantity_ordered,
charge_account_id)
VALUES
(po_headers_interface_s.currval,
po.po_lines_interface_s.CURRVAL,
po.po_distributions_interface_s.NEXTVAL,
1,
2,
12975) -- Your Charge Account Id
/

Вам также может понравиться