Você está na página 1de 28

5/13/12 1.1.

Modeling the Enterprise

Oracle EBS - Supply Chain Management


Sample Code for PO APIs and Open Interfaces

Prev ConfluentMinds Solutions Next

PO APIs and Open Interfaces:

PO Import Open Interface


PO Update API
PO Accept API
PO Receive Open Interface
PO Deliver Open Interface

PO Import Open Interface:

CREATE OR REPLACE PACKAGE EPO_EXPENSEIMPORT_PKG AS


Declare
l_retcode number;
l_errbuf varchar2(2000);
l_request_id number;
Begin
EPO_EXPENSEIMPORT_PKG.po_header_interface
(pi_org_id =>204,
pi_action =>'ORIGINAL',
pi_document_type_code =>'STANDARD',
pi_process_code =>'PENDING',
pi_vendor_id =>21,
pi_vendor_site_id =>41,
pi_ship_to_id =>207,
pi_bill_to_id =>204,
pi_comments => 'myPO-1 thru OI',
po_retcode =>l_retcode,
po_erbuf =>l_errbuf);
EPO_EXPENSEIMPORT_PKG.po_line_interface
(pi_org_id =>204,
pi_line_num =>1,
pi_line_type_id => 1, --Goods
pi_ITEM_ID => 155,
pi_quantity =>99,
pi_unit_price=>1200,
pi_PROMISED_DATE =>'10-JAN-08',
pi_shipment_num =>1,
po_retcode =>l_retcode,
po_erbuf =>l_errbuf);
EPO_EXPENSEIMPORT_PKG.po_distribution_interface
(pi_org_id =>204,
pi_distribution_num=>1,
pi_quantity_ordered =>99,
pi_charge_account_id =>13401,
po_retcode =>l_retcode,
po_erbuf =>l_errbuf);
EPO_EXPENSEIMPORT_PKG.import_po(v_request_id =>l_request_id);
End;

PROCEDURE po_header_interface
(pi_org_id IN po_headers_interface.org_id%TYPE,
pi_action IN po_headers_interface.action%TYPE,
pi_document_type_code IN po_headers_interface.document_type_code%TYPE,
pi_process_code IN po_headers_interface.process_code%type,
pi_vendor_id IN po_headers_interface.vendor_id%type,
pi_vendor_site_id IN po_headers_interface.vendor_site_id%type,
--pi_vendor_site_code IN po_headers_interface.vendor_site_code%type,
pi_ship_to_id IN po_headers_interface.ship_to_location_id%type,
pi_bill_to_id IN po_headers_interface.bill_to_location_id%type,
pi_comments IN po_headers_interface.comments%Type,
po_retcode OUT number,
po_erbuf OUT varchar2);
PROCEDURE po_line_interface
(pi_org_id IN po_headers_interface.org_id%TYPE,
pi_line_num IN po_lines_interface.line_num%TYPE,
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 1/28
5/13/12 1.1. Modeling the Enterprise
pi_line_num IN po_lines_interface.line_num%TYPE,
--pi_process_code IN po_lines_interface.process_code%type,
pi_line_type_id IN po_lines_interface.line_type_id%TYPE,
pi_ITEM_ID IN po_lines_interface.item_id%type,
pi_quantity IN po_lines_interface.quantity%type,
pi_unit_price IN po_lines_interface.unit_price%type,
-- pi_NEED_BY_DATE IN po_lines_interface.need_by_date%type,
pi_PROMISED_DATE IN po_lines_interface.promised_date%type,
pi_shipment_num IN po_lines_interface.SHIPMENT_NUM%TYPE,
po_retcode OUT number,
po_erbuf OUT varchar2);

PROCEDURE po_distribution_interface
(pi_org_id IN po_distributions_interface.org_id%TYPE,
pi_distribution_num IN po_distributions_interface.distribution_num%TYPE,
pi_quantity_ordered IN po_distributions_interface.quantity_ordered%TYPE,
pi_charge_account_id IN po_distributions_interface.charge_account_id%type,
-- pi_budget_account_id IN po_distributions_interface.budget_account_id%type,
-- pi_accrual_account_id IN po_distributions_interface.accrual_account_id%type,

-- pi_variance_account_id IN po_distributions_interface.variance_account_id%type,
po_retcode OUT number,
po_erbuf OUT varchar2);

PROCEDURE import_po(v_request_id OUT NUMBER);

END EPO_EXPENSEIMPORT_PKG;
/
sho err

CREATE OR REPLACE package body EPO_EXPENSEIMPORT_PKG AS

pkg_request_id NUMBER;
PROCEDURE po_header_interface
(pi_org_id IN po_headers_interface.org_id%TYPE,
pi_action IN po_headers_interface.action%TYPE,
pi_document_type_code IN po_headers_interface.document_type_code%TYPE,
pi_process_code IN po_headers_interface.process_code%type,
pi_vendor_id IN po_headers_interface.vendor_id%type,
pi_vendor_site_id IN po_headers_interface.vendor_site_id%type,
--pi_vendor_site_code IN po_headers_interface.vendor_site_code%type,
pi_ship_to_id IN po_headers_interface.ship_to_location_id%type,
pi_bill_to_id IN po_headers_interface.bill_to_location_id%type,
pi_comments IN po_headers_interface.comments%Type,
po_retcode OUT number,
po_erbuf OUT varchar2)
AS
v_vendor_site_code varchar2(200);
v_vendor_site_id Number;
v_po_header_id Number;
v_user_id Number;
v_employee_id Number;
BEGIN
fnd_global.apps_initialize(1318, 50578, 201);

SELECT po_headers_interface_s.NEXTVAL into v_po_header_id from dual;


v_user_id := fnd_profile.value('user_id');
SELECT employee_id INTO v_employee_id FROM fnd_user WHERE user_id = v_user_id;

INSERT INTO po_headers_interface


(interface_header_id,
action,
document_type_code,
process_code,
agent_id,

approval_status,
vendor_id,
vendor_site_id,
--vendor_site_code,
ship_to_location_id,
bill_to_location_id,
comments,
creation_date,
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 2/28
5/13/12 1.1. Modeling the Enterprise
creation_date,
created_by,
last_update_date,
last_updated_by
)
VALUES
(v_po_header_id,--interface_header_id,
pi_action,
pi_document_type_code,
pi_process_code,
v_employee_id, --agent_id,
'APPROVED',
pi_vendor_id, --vendor_id,
pi_vendor_site_id, --vendor_site_id,
--v_vendor_site_code, --vendor_site_code,
pi_ship_to_id,
pi_bill_to_id,
pi_comments,
SYSDATE, --creation_date,
v_user_id, --created_by,
SYSDATE, --last_update_date,
v_user_id --last_updated_by
);
commit;

end po_header_interface;

PROCEDURE po_line_interface
(pi_org_id IN po_headers_interface.org_id%TYPE,
--pi_process_code IN po_lines_interface.process_code%type,
pi_line_num IN po_lines_interface.line_num%TYPE,
pi_line_type_id IN po_lines_interface.line_type_id%TYPE,
pi_ITEM_ID IN po_lines_interface.item_id%type,
pi_quantity IN po_lines_interface.quantity%type,
pi_unit_price IN po_lines_interface.unit_price%type,
-- pi_NEED_BY_DATE IN po_lines_interface.need_by_date%type,
pi_PROMISED_DATE IN po_lines_interface.promised_date%type,
pi_shipment_num IN po_lines_interface.SHIPMENT_NUM%TYPE,

po_retcode OUT number,


po_erbuf OUT varchar2)
AS
v_po_header_id Number;
v_po_line_id Number;
v_user_id Number;
BEGIN
SELECT po_lines_interface_s.NEXTVAL into v_po_line_id from dual;
SELECT po_headers_interface_s.CURRVAL into v_po_header_id from dual;
v_user_id := fnd_profile.value('user_id');

INSERT INTO po_lines_interface


(interface_line_id,
interface_header_id,
--process_code,
line_num,
creation_date,
created_by,
last_update_date,
last_updated_by,
ITEM_ID,
quantity,
unit_price,
NEED_BY_DATE,
PROMISED_DATE,
shipment_num,
line_type_id
)
VALUES
(v_po_line_id, --interface_line_id
v_po_header_id, --interface_header_id
--'PENDING', --process_code
pi_line_num, --line_num
SYSDATE, --creation_date
v_user_id, --created_by
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 3/28
5/13/12 1.1. Modeling the Enterprise
v_user_id, --created_by
SYSDATE, --last_update_date
v_user_id, --last_updated_by
pi_ITEM_ID,
pi_quantity,
pi_unit_price,
pi_PROMISED_DATE,
pi_PROMISED_DATE,
pi_shipment_num,
pi_line_type_id);
commit;

end po_line_interface;

PROCEDURE po_distribution_interface
(pi_org_id IN po_distributions_interface.org_id%TYPE,
pi_distribution_num IN po_distributions_interface.distribution_num%TYPE,
pi_quantity_ordered IN po_distributions_interface.quantity_ordered%TYPE,
pi_charge_account_id IN po_distributions_interface.charge_account_id%type,
-- pi_budget_account_id IN po_distributions_interface.budget_account_id%type,
-- pi_accrual_account_id IN po_distributions_interface.accrual_account_id%type,
-- pi_variance_account_id IN po_distributions_interface.variance_account_id%type,
po_retcode OUT number,
po_erbuf OUT varchar2)
AS
v_po_header_id Number;
v_po_line_id Number;
v_po_distribution_id Number;
v_user_id Number;
v_encumbrance_account NUMBER;
v_ap_accrual_account NUMBER;
v_purchase_price_var_account NUMBER;
v_charge_account NUMBER;

BEGIN
SELECT po_lines_interface_s.CURRVAL into v_po_line_id from dual;
SELECT po_headers_interface_s.CURRVAL into v_po_header_id from dual;
SELECT po_distributions_interface_s.NEXTVAL into v_po_distribution_id from dual;
v_user_id := fnd_profile.value('user_id');
v_charge_account := pi_charge_account_id;

--SELECT encumbrance_account INTO v_encumbrance_account FROM mtl_parameters


-- WHERE MATERIAL_ACCOUNT = v_charge_account;
-- IF v_encumbrance_account is null THEN
v_encumbrance_account := v_charge_account;
-- ELSE SELECT encumbrance_account INTO v_encumbrance_account FROM mtl_parameters
-- WHERE MATERIAL_ACCOUNT = v_charge_account;
--END IF;
v_ap_accrual_account := v_charge_account;
v_purchase_price_var_account := v_charge_account;
/*SELECT ap_accrual_account INTO v_ap_accrual_account FROM mtl_parameters
WHERE MATERIAL_ACCOUNT = v_charge_account;
-- v_ap_accrual_account := pi_accrual_account_id;
SELECT purchase_price_var_ACCOUNT INTO v_ap_accrual_account FROM mtl_parameters
WHERE MATERIAL_ACCOUNT = v_charge_account;*/
-- v_purchase_price_var_account :=pi_variance_account_id ;

INSERT INTO PO_DISTRIBUTIONS_INTERFACE


(
INTERFACE_HEADER_ID
,INTERFACE_LINE_ID
,INTERFACE_DISTRIBUTION_ID
,DISTRIBUTION_NUM
,QUANTITY_ORDERED
,CHARGE_ACCOUNT_ID
,BUDGET_ACCOUNT_ID
,ACCRUAL_ACCOUNT_ID
,VARIANCE_ACCOUNT_ID
,creation_date
,created_by
,last_update_date
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 4/28
5/13/12 1.1. Modeling the Enterprise
,last_update_date
,last_updated_by
)
VALUES
(v_po_header_id
,v_po_line_id
,v_po_distribution_id
,pi_distribution_num
,pi_quantity_ordered
,pi_charge_account_id
,pi_charge_account_id --v_encumbrance_account
,pi_charge_account_id --v_ap_accrual_account
,pi_charge_account_id --v_purchase_price_var_account
,SYSDATE --creation_date,
,v_user_id --created_by,
,SYSDATE --last_update_date,
,v_user_id --last_updated_by
);
commit;

end po_distribution_interface;

PROCEDURE import_po
(v_request_id OUT NUMBER) AS

v_request_complete BOOLEAN;
v_phase VARCHAR2(240);
v_status VARCHAR2(240);
v_dev_phase VARCHAR2(240);

v_dev_status VARCHAR2(240);
v_message VARCHAR2(240);

BEGIN

v_request_id := FND_REQUEST.SUBMIT_REQUEST(

'PO',

'POXPOPDOI',

'Import Standard Purchase Orders',

'',

FALSE,
'312',
'STANDARD',
'',
'N',
'',
'INCOMPLETE',
'',
'',
'',
'',
CHR(0),
'','','','','', '', '','','', '', --argument 11..20

'','','','','', '', '','','', '', --argument 21..30

'','','','','', '', '','','', '', --argument 31..40

'','','','','', '', '','','', '', --argument 41..50

'','','','','', '', '','','', '', --argument 51..60

'','','','','', '', '','','', '', --argument 61..70

'','','','','', '', '','','', '', --argument 71..80

'','','','','', '', '','','', '',


www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html--argument 81..90 5/28
5/13/12 1.1. Modeling the Enterprise
'','','','','', '', '','','', '', --argument 81..90

'','','','','', '', '','','' );

--forms_ddl('COMMIT');
commit;

IF v_request_id = 0 THEN
--fnd_message.set_string('Submittion of Import Standard Purchase Order Failed');
--fnd_message.error;
--RAISE FORM_TRIGGER_FAILURE;
dbms_output.put_line('Request Completed with WARNING. Verify Request :
'||TO_CHAR(v_request_id));
ELSE
--fnd_message.set_string('The Request ID for the imported PO is: '||v_request_id);
--fnd_message.show;
dbms_output.put_line('The Request ID for the imported PO is: '||v_request_id);
pkg_request_id := v_request_id;
LOOP
v_request_complete:= fnd_concurrent.wait_for_request (
v_request_id,
0,
0,
v_phase,
v_status,
v_dev_phase,
v_dev_status,
v_message
);

IF UPPER (v_dev_phase) = 'COMPLETE' THEN


EXIT;
END IF;
END LOOP;

IF UPPER (v_dev_status) = 'ERROR' THEN


dbms_output.put_line('Request Completed with ERROR. Verify Request : '
||TO_CHAR(v_request_id));
ELSIF UPPER (v_dev_status) = 'WARNING' THEN
dbms_output.put_line('Request Completed with WARNING.
Verify Request : '||TO_CHAR(v_request_id));
END IF;
END IF;
END;

end EPO_EXPENSEIMPORT_PKG;
/
show err

PO Update API :

declare
result number := null;
l_errors PO_API_ERRORS_REC_TYPE;
begin
fnd_global.apps_initialize(1318, 50578, 201);

result := PO_CHANGE_API1_S.update_po(
4421, -- po num
null, -- release num
2,-- revision
1,-- line num
1, -- shipment num
1,-- qty
1000, -- price
'23-DEC-07', -- date
'Y', -- launch approvals
null, -- update source
'1.0', -- version
null, -- override date
l_errors, --api_errors
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 6/28
5/13/12 1.1. Modeling the Enterprise
null); --buyer
dbms_output.put_line('Update PO result '||result);

if l_errors.message_name.exists(1) then
for i in l_errors.message_name.first..l_errors.message_name.last
loop
dbms_output.put_line('msg..'||l_errors.message_name(i));
end loop;
end if;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Other Exc..'||sqlerrm);
raise;
end;
/

PO Accept API:

declare
result number := null;
begin
fnd_global.apps_initialize(1318, 50578, 201);

result := PO_CHANGE_API1_S.record_acceptance(
4421, --po num
null, -- release num
0, -- revision num
'NEW', -- action
null, -- action date
588, -- employee_id
'N', -- accepted flag
'On Schedule', -- acceptance lookup code
'All valid', -- note
'APITEST', --- interfacetype
null, -- transaction_id
'1.0'); -- api version
dbms_output.put_line('Record acceptance result '||result);

EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Other Exc..'||sqlerrm);
raise;
end;
/

PO Receive Open Interface:

CREATE OR REPLACE PACKAGE EINV_RECEIVE_PKG IS

/*
Call the routine with below code
Declare
l_group_id number;
l_header_id number;
l_retcode number;
l_erbuf varchar2(2000);
l_transaction_id number;
Begin
EINV_RECEIVE_PKG.Header_receive_proc(
pi_org_id =>204,
pi_po_num =>4420,
pi_vendor_id =>21,
pi_po_item_id =>155,
pi_po_price =>1200,
pi_release_num =>2,
pi_quantity =>1, -- Qty received

pi_ship =>102, -- Vendor shipment number,


pi_location =>72097, --po line_location_id
pi_receipt_no =>Null, --Reqd for manual receipt entry
pi_userid =>1318 ,
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 7/28
5/13/12 1.1. Modeling the Enterprise
pi_userid =>1318 ,
po_group_id=> l_group_id ,
po_header_id=> l_header_id ,
po_retcode=> l_retcode ,
po_erbuf=> l_erbuf
);
EINV_RECEIVE_PKG.transactions_receive_proc(
pi_org_id =>204,
pi_po_num =>4420,
pi_vendor_id =>21,
pi_po_item_id =>155,
pi_po_price =>1200,
pi_release_num =>2,
pi_quantity =>1, -- Qty received
pi_ship =>101, -- Vendor shipment number,
pi_location =>72097, --po line_location_id
pi_receipt_no =>Null, --Reqd for manual receipt entry
pi_userid =>1318 ,
pi_group_id =>l_group_id,
pi_header_id =>l_header_id,
po_retcode =>l_retcode,
po_erbuf =>l_erbuf,
po_transaction_id =>l_transaction_id
);
dbms_output.put_line('Group id..'||l_group_id||'-transaction id..'||l_transaction_id);
End;
*/

PROCEDURE header_receive_proc(pi_org_id IN po_headers_all.org_id%TYPE,


pi_po_num IN po_headers_all.segment1%TYPE,
pi_vendor_id IN po_headers_all.vendor_id%TYPE,
pi_po_item_id IN po_lines_all.item_id%TYPE,
pi_po_price IN po_lines_all.unit_price%type,
pi_release_num IN po_releases_all.release_num%type,
pi_quantity IN number,
pi_ship IN number,
pi_location IN number,
pi_receipt_no IN rcv_headers_interface.receipt_num%TYPE,
pi_userid IN number,
po_group_id OUT number,
po_header_id OUT number,
po_retcode OUT number,

po_erbuf OUT varchar2);


PROCEDURE transactions_receive_proc(pi_org_id IN po_headers_all.org_id%TYPE,
pi_po_num IN po_headers_all.segment1%TYPE,
pi_vendor_id IN po_headers_all.vendor_id%TYPE,
pi_po_item_id IN po_lines_all.item_id%TYPE,
pi_po_price IN po_lines_all.unit_price%type,
pi_release_num IN po_releases_all.release_num%type,
pi_quantity IN number,
pi_ship IN number,
pi_location IN number,
pi_receipt_no IN rcv_headers_interface.receipt_num%TYPE,
pi_group_id IN number,
pi_userid IN number,
pi_header_id IN number,
po_retcode OUT number,
po_erbuf OUT varchar2,
po_transaction_id OUT number);
END EINV_RECEIVE_PKG;

create or replace package body EINV_RECEIVE_PKG IS

PROCEDURE header_receive_proc(pi_org_id IN po_headers_all.org_id%TYPE,


pi_po_num IN po_headers_all.segment1%TYPE,
pi_vendor_id IN po_headers_all.vendor_id%TYPE,
pi_po_item_id IN po_lines_all.item_id%TYPE,
pi_po_price IN po_lines_all.unit_price%type,
pi_release_num IN po_releases_all.release_num%type,
pi_quantity IN number,
pi_ship IN number,
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 8/28
5/13/12 1.1. Modeling the Enterprise
pi_ship IN number,
pi_location IN number,
pi_receipt_no IN rcv_headers_interface.receipt_num%TYPE,
pi_userid IN number,
po_group_id OUT number,
po_header_id OUT number,
po_retcode OUT number,
po_erbuf OUT varchar2)
IS
v_rcv_headers rcv_headers_interface%ROWTYPE;
v_rcv_transactions rcv_transactions_interface%ROWTYPE;
BEGIN
v_rcv_headers.vendor_id:=pi_vendor_id;
--fetch the vendor_site_id,po_header_id,currency_code,ship_to_location_id for the selected po
BEGIN

SELECT vendor_site_id,po_header_id,currency_code,ship_to_location_id
INTO v_rcv_headers.vendor_site_id,v_rcv_transactions.po_header_id,
v_rcv_headers.currency_code,v_rcv_transactions.ship_to_location_id
FROM po_headers_all
WHERE segment1=pi_po_num
AND org_id=pi_org_id
AND vendor_id=pi_vendor_id;
EXCEPTION
WHEN OTHERS THEN
po_retcode:=1;
po_erbuf:=sqlerrm;
END;
--fetch the po_line_id,unit_meas_lookup_code from po_lines_all for the selected po
BEGIN
SELECT po_line_id,unit_meas_lookup_code
INTO v_rcv_transactions.po_line_id,v_rcv_transactions.unit_of_measure
FROM po_lines_all
WHERE po_header_id=v_rcv_transactions.po_header_id
AND item_id=pi_po_item_id;
EXCEPTION
WHEN OTHERS THEN
po_retcode:=2;
po_erbuf:=sqlerrm;
END;
--generate the neat number for the sequence
BEGIN
SELECT RCV_HEADERS_INTERFACE_S.nextval
INTO v_rcv_headers.header_interface_id
FROM dual;
EXCEPTION
WHEN OTHERS THEN
po_retcode:=3;
po_erbuf:=sqlerrm;
END;
BEGIN
SELECT RCV_INTERFACE_GROUPS_S.nextval
INTO v_rcv_headers.group_id
FROM dual;
EXCEPTION
WHEN OTHERS THEN
po_retcode:=4;
po_erbuf:=sqlerrm;
END;
-- insert into rcv_headers_interface table
insert into rcv_headers_interface

( header_interface_id
,group_id
,edi_control_num
,processing_status_code
,receipt_source_code
,asn_type
,transaction_type
,auto_transact_code
,test_flag
,last_update_date
,last_updated_by
,last_update_login
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 9/28
5/13/12 1.1. Modeling the Enterprise
,last_update_login
,creation_date
,created_by
,notice_creation_date
,shipment_num
,receipt_num
,receipt_header_id
,vendor_name
,vendor_num
,vendor_id
,vendor_site_code
,vendor_site_id
,from_organization_code
,from_organization_id
,ship_to_organization_code
,ship_to_organization_id
,location_code
,location_id
,bill_of_lading
,packing_slip
,shipped_date
,freight_carrier_code
,expected_receipt_date
,receiver_id
,num_of_containers
,waybill_airbill_num
,comments
,gross_weight
,gross_weight_uom_code
,net_weight
,net_weight_uom_code
,tar_weight
,tar_weight_uom_code
,packaging_code

,carrier_method
,carrier_equipment
,special_handling_code
,hazard_code
,hazard_class
,hazard_description
,freight_terms
,freight_bill_number
,invoice_num
,invoice_date
,total_invoice_amount
,tax_name
,tax_amount
,freight_amount
,currency_code
,conversion_rate_type
,conversion_rate
,conversion_rate_date
,payment_terms_name
,payment_terms_id
,attribute_category
,attribute1
,attribute2
,attribute3
,attribute4
,attribute5
,attribute6
,attribute7
,attribute8
,attribute9
,attribute10
,attribute11
,attribute12
,attribute13
,attribute14
,attribute15
,usggl_transaction_code
,employee_name
,employee_id
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 10/28
5/13/12 1.1. Modeling the Enterprise
,employee_id
,invoice_status_code
,validation_flag
,processing_request_id
)
VALUES
(v_rcv_headers.header_interface_id --HEADER_INTERFACE_ID rcv_headers_interface_s

,v_rcv_headers.group_id --GROUP_ID RCV_INTERFACE_GROUPS_S


,NULL --EDI_CONTROL_NUM
,'PENDING' --PROCESSING_STATUS_CODE
,'VENDOR' --RECEIPT_SOURCE_CODE
,NULL --ASN_TYPE
,'NEW' --x_rct_rec.transaction_type --TRANSACTION_TYPE
,'RECEIVE' --'RECEIVE' --AUTO_TRANSACT_CODE
,'N' --TEST_FLAG
,SYSDATE --x_rct_rec.transaction_date --LAST_UPDATE_DATE
,pi_userid --APPS.fnd_global.user_id --LAST_UPDATED_BY
,pi_userid --LAST_UPDATE_LOGIN
,sysdate --x_rct_rec.transaction_date --CREATION_DATE
,pi_userid --APPS.fnd_global.conc_login_id --CREATED_BY
,NULL --NOTICE_CREATION_DATE
,NULL --v_row_data.SHIPMENT_NUM --x_rct_rec.po_shipment_number
,pi_receipt_no -- v_row_data.po_receipt_num --NULL --RECEIPT_NUM
,NULL --RECEIPT_HEADER_ID
,NULL --VENDOR_NAME
,NULL --VENDOR_NUM
,v_rcv_headers.vendor_id --VENDOR_ID
,NULL --VENDOR_SITE_CODE
,v_rcv_headers.vendor_site_id --VENDOR_SITE_ID
,NULL --FROM_ORGANIZATION_CODE
,null --v_inv_org_id --NULL --FROM_ORGANIZATION_ID
,null --SHIP_TO_ORGANIZATION_CODE
,null --v_inv_org_id --NULL --SHIP_TO_ORGANIZATION_ID
,NULL --x_rct_rec.location_code --LOCATION_CODE
,NULL --LOCATION_ID
,NULL --BILL_OF_LADING
,NULL --x_rct_rec.receipt_number --PACKING_SLIP
,NULL --x_rct_rec.transaction_date --SHIPPED_DATE
,NULL --FREIGHT_CARRIER_CODE
,SYSDATE --v_row_data.transaction_date --EXPECTED_RECEIPT_DATE
,NULL --RECEIVER_ID
,NULL --NUM_OF_CONTAINERS
,NULL --WAYBILL_AIRBILL_NUM
,NULL --COMMENTS
,NULL --GROSS_WEIGHT
,NULL --GROSS_WEIGHT_UOM_CODE
,NULL --NET_WEIGHT
,NULL --NET_WEIGHT_UOM_CODE
,NULL --TAR_WEIGHT
,NULL --TAR_WEIGHT_UOM_CODE
,NULL --PACKAGING_CODE
,NULL --CARRIER_METHOD

,NULL --CARRIER_EQUIPMENT
,NULL --SPECIAL_HANDLING_CODE
,NULL --HAZARD_CODE
,NULL --HAZARD_CLASS
,NULL --HAZARD_DESCRIPTION
,NULL --FREIGHT_TERMS
,NULL --FREIGHT_BILL_NUMBER
,NULL --INVOICE_NUM
,NULL --INVOICE_DATE
,NULL --TOTAL_INVOICE_AMOUNT
,NULL --TAX_NAME
,NULL --TAX_AMOUNT
,NULL --FREIGHT_AMOUNT
,v_rcv_headers.currency_code --CURRENCY_CODE
,NULL --CONVERSION_RATE_TYPE
,NULL --CONVERSION_RATE
,NULL --CONVERSION_RATE_DATE
,NULL --PAYMENT_TERMS_NAME
,NULL --PAYMENT_TERMS_ID
,NULL --ATTRIBUTE_CATEGORY
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 11/28
5/13/12 1.1. Modeling the Enterprise
,NULL --ATTRIBUTE_CATEGORY
,NULL --ATTRIBUTE1
,NULL --ATTRIBUTE2
,NULL --ATTRIBUTE3
,NULL --ATTRIBUTE4
,NULL --v_row_data.ship_head_attribute5 --ATTRIBUTE5
,NULL --ATTRIBUTE6
,NULL --ATTRIBUTE7
,NULL --ATTRIBUTE8
,NULL --ATTRIBUTE9
,NULL --ATTRIBUTE10
,NULL --ATTRIBUTE11
,NULL --ATTRIBUTE12
,NULL --ATTRIBUTE13
,NULL --ATTRIBUTE14
,NULL --ATTRIBUTE15
,NULL --USGGL_TRANSACTION_CODE
,NULL --EMPLOYEE_NAME
,NULL --EMPLOYEE_ID
,NULL --INVOICE_STATUS_CODE
,'Y' --VALIDATION_FLAG
,NULL --PROCESSING_REQUEST_ID
);
commit;
po_header_id:=v_rcv_headers.header_interface_id;
po_group_id:=v_rcv_headers.group_id;

end header_receive_proc;

PROCEDURE transactions_receive_proc(pi_org_id IN po_headers_all.org_id%TYPE,


pi_po_num IN po_headers_all.segment1%TYPE,
pi_vendor_id IN po_headers_all.vendor_id%TYPE,
pi_po_item_id IN po_lines_all.item_id%TYPE,
pi_po_price IN po_lines_all.unit_price%type,
pi_release_num IN po_releases_all.release_num%type,
pi_quantity IN number,
pi_ship IN number,
pi_location IN number,
pi_receipt_no IN rcv_headers_interface.receipt_num%TYPE,
pi_group_id IN number,
pi_userid IN number,
pi_header_id IN number,
po_retcode OUT number,
po_erbuf OUT varchar2,
po_transaction_id OUT number)
IS
v_rcv_headers rcv_headers_interface%ROWTYPE;
v_rcv_transactions rcv_transactions_interface%ROWTYPE;
BEGIN
v_rcv_headers.vendor_id:=pi_vendor_id;
BEGIN
SELECT vendor_site_id,po_header_id,currency_code,ship_to_location_id
INTO v_rcv_headers.vendor_site_id,v_rcv_transactions.po_header_id,
v_rcv_headers.currency_code,v_rcv_transactions.ship_to_location_id
FROM po_headers_all
WHERE segment1=pi_po_num
AND org_id=pi_org_id
AND vendor_id=pi_vendor_id;
EXCEPTION
WHEN OTHERS THEN
po_retcode:=1;
po_erbuf:=sqlerrm;
END;
BEGIN
SELECT po_line_id,unit_meas_lookup_code
INTO v_rcv_transactions.po_line_id,v_rcv_transactions.unit_of_measure
FROM po_lines_all
WHERE po_header_id=v_rcv_transactions.po_header_id
AND item_id=pi_po_item_id;
EXCEPTION
WHEN OTHERS THEN

po_retcode:=2;
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 12/28
5/13/12 1.1. Modeling the Enterprise
po_retcode:=2;
po_erbuf:=sqlerrm;
END;
SELECT RCV_TRANSACTIONS_INTERFACE_S.NextVAL
INTO v_rcv_transactions.interface_transaction_id
FROM dual;
po_transaction_id:= v_rcv_transactions.interface_transaction_id;
v_rcv_transactions.quantity:=pi_quantity;
v_rcv_transactions.item_id:=pi_po_item_id;
v_rcv_transactions.po_unit_price:=pi_po_price;
v_rcv_transactions.release_num:=pi_release_num;
v_rcv_transactions.po_line_location_id:=pi_location;
v_rcv_transactions.shipment_num:=pi_ship;
--insert into rcv_transactions_interface table
insert into rcv_transactions_interface
( interface_transaction_id
,group_id
,last_update_date
,last_updated_by
,creation_date
,created_by
,last_update_login
,request_id
,program_application_id
,program_id
,program_update_date
,transaction_type
,transaction_date
,processing_status_code
,processing_mode_code
,processing_request_id
,transaction_status_code
,category_id
,quantity
,unit_of_measure
,interface_source_code
,interface_source_line_id
,inv_transaction_id
,item_id
,item_description
,item_revision
,uom_code
,employee_id
,auto_transact_code
,shipment_header_id

,shipment_line_id
,ship_to_location_id
,primary_quantity
,primary_unit_of_measure
,receipt_source_code
,vendor_id
,vendor_site_id
,from_organization_id
,from_subinventory
,to_organization_id
,intransit_owning_org_id
,routing_header_id
,routing_step_id
,source_document_code
,parent_transaction_id
,po_header_id
,po_revision_num
,po_release_id
,po_line_id
,po_line_location_id
,po_unit_price
,currency_code
,currency_conversion_type
,currency_conversion_rate
,currency_conversion_date
,po_distribution_id
,requisition_line_id
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 13/28
5/13/12 1.1. Modeling the Enterprise
,requisition_line_id
,req_distribution_id
,charge_account_id
,substitute_unordered_code
,receipt_exception_flag
,accrual_status_code
,inspection_status_code
,inspection_quality_code
,destination_type_code
,deliver_to_person_id
,location_id
,deliver_to_location_id
,subinventory
,locator_id
,wip_entity_id
,wip_line_id
,department_code
,wip_repetitive_schedule_id
,wip_operation_seq_num

,wip_resource_seq_num
,bom_resource_id
,shipment_num
,freight_carrier_code
,bill_of_lading
,packing_slip
,shipped_date
,expected_receipt_date
,actual_cost
,transfer_cost
,transportation_cost
,transportation_account_id
,num_of_containers
,waybill_airbill_num
,vendor_item_num
,vendor_lot_num
,rma_reference
,comments
,attribute_category
,attribute1
,attribute2
,attribute3
,attribute4
,attribute5
,attribute6
,attribute7
,attribute8
,attribute9
,attribute10
,attribute11
,attribute12
,attribute13
,attribute14
,attribute15
,ship_head_attribute_category
,ship_head_attribute1
,ship_head_attribute2
,ship_head_attribute3
,ship_head_attribute4
,ship_head_attribute5
,ship_head_attribute6
,ship_head_attribute7
,ship_head_attribute8
,ship_head_attribute9
,ship_head_attribute10

,ship_head_attribute11
,ship_head_attribute12
,ship_head_attribute13
,ship_head_attribute14
,ship_head_attribute15
,ship_line_attribute_category
,ship_line_attribute1
,ship_line_attribute2
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 14/28
5/13/12 1.1. Modeling the Enterprise
,ship_line_attribute2
,ship_line_attribute3
,ship_line_attribute4
,ship_line_attribute5
,ship_line_attribute6
,ship_line_attribute7
,ship_line_attribute8
,ship_line_attribute9
,ship_line_attribute10
,ship_line_attribute11
,ship_line_attribute12
,ship_line_attribute13
,ship_line_attribute14
,ship_line_attribute15
,ussgl_transaction_code
,government_context
,reason_id
,destination_context
,source_doc_quantity
,source_doc_unit_of_measure
,movement_id
,use_mtl_lot
,use_mtl_serial
,header_interface_id
,vendor_cum_shipped_qty
,item_num
,document_num
,document_line_num
,truck_num
,ship_to_location_code
,container_num
,substitute_item_num
,notice_unit_price
,item_category
,location_code
,vendor_name
,vendor_num
,vendor_site_code

,from_organization_code
,to_organization_code
,intransit_owning_org_code
,routing_code
,routing_step
,release_num
,document_shipment_line_num
,document_distribution_num
,deliver_to_person_name
,deliver_to_location_code
,locator
,reason_name
,validation_flag
,substitute_item_id
,quantity_shipped
,quantity_invoiced
,tax_name
,tax_amount
,req_num
,req_line_num
,req_distribution_num
,wip_entity_name
,wip_line_code
,resource_code
,shipment_line_status_code
,barcode_label
,transfer_percentage
,qa_collection_id
,country_of_origin_code
,oe_order_header_id
,oe_order_line_id
,customer_id
,customer_site_id
,customer_item_num
,create_debit_memo_flag
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 15/28
5/13/12 1.1. Modeling the Enterprise
,create_debit_memo_flag
,put_away_rule_id
,put_away_strategy_id
,lpn_id
,transfer_lpn_id
,cost_group_id
,mobile_txn
,mmtt_temp_id)
VALUES
( v_rcv_transactions.interface_transaction_id --INTERFACE_TRANSACTION_ID
RCV_TRANSACTIONS_INTERFACE_S

,pi_group_id --GROUP_ID
,SYSDATE --LAST_UPDATE_DATE
,pi_userid --APPS.fnd_global.user_id --LAST_UPDATED_BY
,SYSDATE --CREATION_DATE
,pi_userid --APPS.fnd_global.conc_login_id --CREATED_BY
,pi_userid --LAST_UPDATE_LOGIN
,NULL --REQUEST_ID
,NULL --PROGRAM_APPLICATION_ID
,NULL --PROGRAM_ID
,NULL --PROGRAM_UPDATE_DATE
,'RECEIVE' --'CORRECTION' 'CANCEL'--'RETURN TO VENDOR'--'RECEIVE' --
x_rct_rec.transaction_type --TRANSACTION_TYPE
,SYSDATE --v_row_data.transaction_date --TRANSACTION_DATE
,'PENDING' --PROCESSING_STATUS_CODE
,'BATCH' --PROCESSING_MODE_CODE
,NULL --PROCESSING_REQUEST_ID
,'PENDING' --TRANSACTION_STATUS_CODE
,NULL --CATEGORY_ID
,v_rcv_transactions.quantity --QUANTITY
,v_rcv_transactions.unit_of_measure --UNIT_OF_MEASURE
,'RCV' --INTERFACE_SOURCE_CODE
,NULL --INTERFACE_SOURCE_LINE_ID
,NULL --INV_TRANSACTION_ID
,v_rcv_transactions.item_id --ITEM_ID
,null --ITEM_DESCRIPTION RSL
,NULL --ITEM_REVISION RSL
,NULL --v_row_data.UOM_CODE --unit_of_measure --
,NULL --v_employee_id --x_rct_rec.receiver_emp_id --EMPLOYEE_ID
,'RECEIVE' --v_row_data.AUTO_TRANSACT_CODE --'DELIVER' --'RECEIVE' --
AUTO_TRANSACT_CODE
,NULL --v_row_data.SHIPMENT_HEADER_ID
,NULL --v_row_data.SHIPMENT_LINE_ID --x_rct_rec.po_shipment_id --
SHIPMENT_LINE_ID
,v_rcv_transactions.ship_to_location_id -- SHIP_TO_LOCATION_ID RSL
,v_rcv_transactions.quantity --PRIMARY_QUANTITY
,v_rcv_transactions.unit_of_measure --PRIMARY_UNIT_OF_MEASURE
,'VENDOR' --RECEIPT_SOURCE_CODE
,v_rcv_headers.vendor_id --VENDOR_ID
,v_rcv_headers.vendor_site_id --VENDOR_SITE_ID
,NULL --FROM_ORGANIZATION_ID
,NULL --FROM_SUBINVENTORY
,NULL --TO_ORGANIZATION_ID
,NULL --INTRANSIT_OWNING_ORG_ID
,NULL --3--v_row_data.ROUTING_HEADER_ID
,NULL --1--v_row_data.ROUTING_STEP_ID

,'PO' --SOURCE_DOCUMENT_CODE
,NULL ----PARENT_TRANSACTION_ID
,v_rcv_transactions.po_header_id --PO_HEADER_ID
,NULL --v_row_data.po_revision_num
,v_rcv_transactions.po_release_id --v_release_id --PO_RELEASE_ID
,v_rcv_transactions.po_line_id --PO_LINE_ID
,v_rcv_transactions.po_line_location_id --PO_LINE_LOCATION_ID
,v_rcv_transactions.po_unit_price --v_row_data.PO_UNIT_PRICE
,v_rcv_headers.currency_code --v_CURRENCY_CODE
,NULL --v_row_data.CURRENCY_CONVERSION_TYPE
,NULL --v_row_data.CURRENCY_CONVERSION_RATE
,sysdate --v_row_data.CURRENCY_CONVERSION_DATE
,null --v_row_data.PO_DISTRIBUTION_ID
,NULL --v_row_data.REQUISITION_LINE_ID
,NULL --v_row_data.REQ_DISTRIBUTION_ID
,NULL --v_row_data.CHARGE_ACCOUNT_ID
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 16/28
5/13/12 1.1. Modeling the Enterprise
,NULL --v_row_data.CHARGE_ACCOUNT_ID
,NULL --v_row_data.SUBSTITUTE_UNORDERED_CODE
,NULL --v_row_data.RECEIPT_EXCEPTION_FLAG
,NULL --v_row_data.ACCRUAL_STATUS_CODE
,'NOT INSPECTED' --v_row_data.INSPECTION_STATUS_CODE
,NULL --v_row_data.INSPECTION_QUALITY_CODE
,'INVENTORY' --v_row_data.destination_type_code
,null --v_deliver_to_person_id --DELIVER_TO_PERSON_ID
,NULL --v_ship_to_location_id-- --LOCATION_ID
,NULL --DELIVER_TO_LOCATION_ID
,NULL--v_row_data.SUBINVENTORY
,NULL--v_row_data.LOCATOR_ID
,NULL--v_row_data.WIP_ENTITY_ID
,NULL--v_row_data.WIP_LINE_ID
,NULL--v_row_data.DEPARTMENT_CODE
,NULL--v_row_data.WIP_REPETITIVE_SCHEDULE_ID
,NULL --v_row_data.WIP_OPERATION_SEQ_NUM
,NULL --v_row_data.WIP_RESOURCE_SEQ_NUM
,NULL --v_row_data.BOM_RESOURCE_ID
,v_rcv_transactions.shipment_num --v_row_data.SHIPMENT_NUM
,NULL --v_row_data.FREIGHT_CARRIER_CODE
,NULL --v_row_data.BILL_OF_LADING
,NULL --v_row_data.PACKING_SLIP
,null --SHIPPED_DATE
,NULL --SYSDATE --v_row_data.transaction_date --EXPECTED_RECEIPT_DATE
,NULL--v_row_data.ACTUAL_COST
,NULL--v_row_data.TRANSFER_COST
,NULL--v_row_data.TRANSPORTATION_COST
,NULL--v_row_data.TRANSPORTATION_ACCOUNT_ID
,NULL--v_row_data.NUM_OF_CONTAINERS

,NULL--v_row_data.WAYBILL_AIRBILL_NUM
,NULL--v_row_data.VENDOR_ITEM_NUM
,NULL--v_row_data.VENDOR_LOT_NUM
,NULL--v_row_data.RMA_REFERENCE
,NULL--v_row_data.COMMENTS
,NULL--v_row_data.attribute_category --ATTRIBUTE_CATEGORY
,NULL--v_row_data.attribute1 --ATTRIBUTE1
,NULL--ATTRIBUTE2
,NULL--ATTRIBUTE3
,NULL--ATTRIBUTE4
,NULL--ATTRIBUTE5
,NULL--ATTRIBUTE6
,NULL--ATTRIBUTE7
,NULL--ATTRIBUTE8
,NULL--ATTRIBUTE9
,NULL--ATTRIBUTE10
,NULL--ATTRIBUT11
,NULL--ATTRIBUTE12
,NULL--ATTRIBUTE13
,NULL--ATTRIBUTE14
,NULL--ATTRIBUTE15
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE_CATEGORY
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE1
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE2
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE3
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE4
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE5
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE6
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE7
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE8
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE9
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE10
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE11
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE12
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE13
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE14
,NULL--v_row_data.SHIP_HEAD_ATTRIBUTE15
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE_CATEGORY
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE1
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE2
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE3
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE4
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE5
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 17/28
5/13/12 1.1. Modeling the Enterprise
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE5
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE6
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE7

,NULL--v_row_data.SHIP_LINE_ATTRIBUTE8
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE9
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE10
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE11
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE12
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE13
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE14
,NULL--v_row_data.SHIP_LINE_ATTRIBUTE15
,NULL--v_row_data.USSGL_TRANSACTION_CODE
,NULL--v_row_data.GOVERNMENT_CONTEXT
,NULL--v_row_data.REASON_ID
,'INVENTORY' --v_row_data.DESTINATION_CONTEXT
,v_rcv_transactions.quantity --v_row_data.SOURCE_DOC_QUANTITY
,v_rcv_transactions.unit_of_measure --v_row_data.SOURCE_DOC_UNIT_OF_MEASURE
,NULL --v_row_data.MOVEMENT_ID
,NULL --v_row_data.USE_MTL_LOT
,NULL --v_row_data.USE_MTL_SERIAL
,pi_header_id --HEADER_INTERFACE_ID
,NULL--v_row_data.VENDOR_CUM_SHIPPED_QTY
,NULL--v_row_data.ITEM_NUM
,NULL--v_row_data.DOCUMENT_NUM
,NULL--v_row_data.po_line_num--NULL --DOCUMENT_LINE_NUM
,NULL--v_row_data.TRUCK_NUM
,null--SHIP_TO_LOCATION_CODE
,NULL--v_row_data.CONTAINER_NUM
,NULL--v_row_data.SUBSTITUTE_ITEM_NUM
,NULL--v_row_data.NOTICE_UNIT_PRICE
,null--v_row_data.ITEM_CATEGORY
,null--v_row_data.LOCATION_CODE
,NULL--v_row_data.VENDOR_NAME
,NULL--v_row_data.VENDOR_NUM
,NULL--v_row_data.VENDOR_SITE_CODE
,NULL--v_row_data.FROM_ORGANIZATION_CODE
,null --v_row_data.TO_ORGANIZATION_CODE --RSL
,NULL --v_row_data.INTRANSIT_OWNING_ORG_CODE
,NULL --v_row_data.ROUTING_CODE
,NULL --v_row_data.ROUTING_STEP
,v_rcv_transactions.release_num --v_row_data.RELEASE_NUM
,NULL --v_row_data.SHIPMENT_NUM --JF--
v_row_data.DOCUMENT_SHIPMENT_LINE_NUM --DOCUMENT_SHIPMENT_LINE_NUM
,NULL --v_row_data.DOCUMENT_DISTRIBUTION_NUM
,NULL --v_row_data.DELIVER_TO_PERSON_NAME
,null --v_row_data.DELIVER_TO_LOCATION_CODE
,NULL --v_row_data.LOCATOR
,NULL --v_row_data.REASON_NAME

,'Y' --v_row_data.VALIDATION_FLAG
,NULL--v_row_data.SUBSTITUTE_ITEM_ID
,v_rcv_transactions.quantity --QUANTITY_SHIPPED RSL
,NULL--v_row_data.QUANTITY_INVOICED
,NULL--v_row_data.TAX_NAME RSL
,NULL--v_row_data.TAX_AMOUNT RSL
,NULL--v_row_data.REQ_NUM
,NULL--v_row_data.REQ_LINE_NUM
,NULL--v_row_data.REQ_DISTRIBUTION_NUM
,NULL--v_row_data.WIP_ENTITY_NAME
,NULL--v_row_data.WIP_LINE_CODE
,NULL--v_row_data.RESOURCE_CODE
,NULL--v_row_data.SHIPMENT_LINE_STATUS_CODE
,NULL--v_row_data.BARCODE_LABEL
,NULL--v_row_data.TRANSFER_PERCENTAGE
,NULL--v_row_data.QA_COLLECTION_ID
,NULL--v_row_data.COUNTRY_OF_ORIGIN_CODE
,NULL--v_row_data.OE_ORDER_HEADER_ID
,NULL--v_row_data.OE_ORDER_LINE_ID
,NULL--v_row_data.CUSTOMER_ID
,NULL--v_row_data.CUSTOMER_SITE_ID
,NULL--v_row_data.CUSTOMER_ITEM_NUM
,NULL--v_row_data.CREATE_DEBIT_MEMO_FLAG --CREATE_DEBIT_MEMO_FLAG
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 18/28
5/13/12 1.1. Modeling the Enterprise
,NULL--v_row_data.PUT_AWAY_RULE_ID
,NULL--v_row_data.PUT_AWAY_STRATEGY_ID
,NULL--v_row_data.LPN_ID
,NULL--v_row_data.TRANSFER_LPN_ID
,NULL--v_row_data.COST_GROUP_ID
,NULL--v_row_data.MOBILE_TXN
,NULL--v_row_data.MMTT_TEMP_ID
);
commit;
end transactions_receive_proc;
end EINV_RECEIVE_PKG;
/
PO Deliver Open Interface:

/*
Declare
l_group_id number;
l_retcode number;
l_error varchar2(2000);
l_header_id number;
l_line_id number;
l_shipment_header_id number;

l_shipment_line_id number;
l_line_location_id number;
Begin
EINV_DELIVER_PKG.deliver_transaction_proc(pi_org_id =>204,
pi_receiptno =>9613,
pi_locationid =>72097, --po line_location_id
pi_quantity =>1,
pi_subinventory =>'FGI',
pi_location =>Null, -- Item Locator for delivery
pi_organi_id =>207,
pi_userid =>1318,
po_group_id =>l_group_id,
po_retcode =>l_retcode,
po_error =>l_error,
po_header_id =>l_header_id,
po_line_id =>l_line_id,
po_shipment_header_id =>l_shipment_header_id,
po_shipment_line_id =>l_shipment_line_id,
po_line_location_id =>l_line_location_id
);
End;
*/

CREATE OR REPLACE PACKAGE EINV_DELIVER_PKG AS

PROCEDURE deliver_transaction_proc(pi_org_id NUMBER,


pi_receiptno varchar2,
pi_locationid number,
pi_quantity NUMBER,
pi_subinventory VARchar2,
pi_location VARchar2,
pi_organi_id NUMBER,
pi_userid NUMBER,
po_group_id out number,
po_retcode out number,
po_error out varchar2,
po_header_id out number,
po_line_id out number,
po_shipment_header_id out number,
po_shipment_line_id out number,
po_line_location_id out number);

END EINV_DELIVER_PKG ;

www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 19/28
5/13/12 1.1. Modeling the Enterprise
CREATE OR REPLACE PACKAGE BODY EINV_DELIVER_PKG AS

PROCEDURE deliver_transaction_proc(pi_org_id NUMBER,


pi_receiptno varchar2,
pi_locationid number,
pi_quantity NUMBER,
pi_subinventory VARchar2,
pi_location VARchar2,
pi_organi_id NUMBER,
pi_userid NUMBER,
po_group_id out number,
po_retcode out number,
po_error out varchar2,
po_header_id out number,
po_line_id out number,
po_shipment_header_id out number,
po_shipment_line_id out number,
po_line_location_id out number)
IS
v_rcv_transactions rcv_transactions_interface%rowtype;
BEGIN

--fetch po_header_id,po_line_id,po_release_id

BEGIN
SELECT po_header_id,po_line_id,po_release_id
INTO v_rcv_transactions.po_header_id,v_rcv_transactions.po_line_id,
v_rcv_transactions.po_release_id
FROM po_line_locations_all
WHERE line_location_id=pi_locationid
AND org_id=pi_org_id ;
po_header_id :=v_rcv_transactions.po_header_id;
po_line_id :=v_rcv_transactions.po_line_id;
EXCEPTION
WHEN OTHERS THEN
po_retcode:=1;
po_error:=sqlerrm;
END;

--fetch shipment_header_id,vendor_id,vendor_site_id,currency_code

BEGIN
SELECT shipment_header_id,vendor_id,vendor_site_id,currency_code
INTO v_rcv_transactions.shipment_header_id,v_rcv_transactions.vendor_id,
v_rcv_transactions.vendor_site_id,v_rcv_transactions.currency_code
FROM rcv_shipment_headers
WHERE receipt_num=pi_receiptno;
po_shipment_header_id:= v_rcv_transactions.shipment_header_id;
EXCEPTION
WHEN OTHERS THEN
po_retcode:=2;
po_error:=sqlerrm;
END;

-- fetch shipment_line_id ,item_id,category_id,to_organization_id,


-- routing_header_id,unit_of_measure

BEGIN
SELECT shipment_line_id ,item_id,category_id,to_organization_id,
routing_header_id,unit_of_measure
INTO v_rcv_transactions.shipment_line_id,v_rcv_transactions.item_id,
v_rcv_transactions.category_id,
v_rcv_transactions.to_organization_id,v_rcv_transactions.routing_header_id,
v_rcv_transactions.unit_of_measure
FROM rcv_shipment_lines
WHERE shipment_header_id=v_rcv_transactions.shipment_header_id
AND po_header_id=v_rcv_transactions.po_header_id
AND po_line_id=v_rcv_transactions.po_line_id
AND po_line_location_id=pi_locationid;
po_shipment_line_id:= v_rcv_transactions.shipment_line_id;
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 20/28
5/13/12 1.1. Modeling the Enterprise
po_shipment_line_id:= v_rcv_transactions.shipment_line_id;

EXCEPTION
WHEN OTHERS THEN
po_retcode:=3;
po_error:=sqlerrm;
END;

BEGIN
SELECT unit_price
INTO v_rcv_transactions.po_unit_price
FROM po_lines_all
WHERE po_header_id=v_rcv_transactions.po_header_id
AND po_line_id=v_rcv_transactions.po_line_id;
EXCEPTION

WHEN OTHERS THEN


po_retcode:=4;
po_error:=sqlerrm;
END;

BEGIN
SELECT transaction_id,uom_code
INTO v_rcv_transactions.parent_transaction_id,v_rcv_transactions.uom_code
FROM rcv_transactions
WHERE po_header_id=v_rcv_transactions.po_header_id
AND po_line_id=v_rcv_transactions.po_line_id
AND po_line_location_id=pi_locationid
AND shipment_header_id=v_rcv_transactions.shipment_header_id
AND shipment_line_id=v_rcv_transactions.shipment_line_id
AND transaction_type='RECEIVE';
EXCEPTION
WHEN OTHERS THEN
po_retcode:=5;
po_error:=sqlerrm;
END;

BEGIN
SELECT max(po_distribution_id)
INTO v_rcv_transactions.po_distribution_id
FROM po_distributions_all
WHERE po_header_id=v_rcv_transactions.po_header_id
AND po_line_id=v_rcv_transactions.po_line_id
AND line_location_id=pi_locationid
AND org_id=pi_org_id ;

EXCEPTION
WHEN OTHERS THEN
po_retcode:=6;
po_error:=sqlerrm;
END;

BEGIN
SELECT INVENTORY_LOCATOR_ID
INTO v_rcv_transactions.locator_id
FROM INVFV_INVENTORY_LOCATORS
WHERE location=pi_location
AND organization_id=pi_organi_id
AND subinventory_name=pi_subinventory;
EXCEPTION
WHEN NO_DATA_FOUND THEN

v_rcv_transactions.locator_id:=null;
WHEN OTHERS THEN
po_retcode:=7;
po_error:=sqlerrm;
END;

SELECT rcv_transactions_interface_s.nextval
INTO v_rcv_transactions.INTERFACE_TRANSACTION_ID
FROM dual;
--dbms_output.put_line('trx int id '||v2);
SELECT rcv_interface_groups_s.nextval
INTO po_group_id
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 21/28
5/13/12 1.1. Modeling the Enterprise
INTO po_group_id
FROM dual;
dbms_output.put_line('grp id '||po_group_id );

-- insert into rcv_transactions_interface table

INSERT INTO rcv_transactions_interface(


INTERFACE_TRANSACTION_ID
,GROUP_ID
,LAST_UPDATE_DATE
,LAST_UPDATED_BY
,CREATION_DATE
,CREATED_BY
,LAST_UPDATE_LOGIN
,REQUEST_ID
,PROGRAM_APPLICATION_ID
,PROGRAM_ID
,PROGRAM_UPDATE_DATE
,TRANSACTION_TYPE
,TRANSACTION_DATE
,PROCESSING_STATUS_CODE
,PROCESSING_MODE_CODE
,PROCESSING_REQUEST_ID
,TRANSACTION_STATUS_CODE
,CATEGORY_ID
,QUANTITY
,UNIT_OF_MEASURE
,INTERFACE_SOURCE_CODE
,INTERFACE_SOURCE_LINE_ID
,INV_TRANSACTION_ID
,ITEM_ID
,ITEM_DESCRIPTION
,ITEM_REVISION
,UOM_CODE

,EMPLOYEE_ID
,AUTO_TRANSACT_CODE
,SHIPMENT_HEADER_ID
,SHIPMENT_LINE_ID
,SHIP_TO_LOCATION_ID
,PRIMARY_QUANTITY
,PRIMARY_UNIT_OF_MEASURE
,RECEIPT_SOURCE_CODE
,VENDOR_ID
,VENDOR_SITE_ID
,FROM_ORGANIZATION_ID
,FROM_SUBINVENTORY
,TO_ORGANIZATION_ID
,INTRANSIT_OWNING_ORG_ID
,ROUTING_HEADER_ID
,ROUTING_STEP_ID
,SOURCE_DOCUMENT_CODE
,PARENT_TRANSACTION_ID
,PO_HEADER_ID
,PO_REVISION_NUM
,PO_RELEASE_ID
,PO_LINE_ID
,PO_LINE_LOCATION_ID
,PO_UNIT_PRICE
,CURRENCY_CODE
,CURRENCY_CONVERSION_TYPE
,CURRENCY_CONVERSION_RATE
,CURRENCY_CONVERSION_DATE
,PO_DISTRIBUTION_ID
,REQUISITION_LINE_ID
,REQ_DISTRIBUTION_ID
,CHARGE_ACCOUNT_ID
,SUBSTITUTE_UNORDERED_CODE
,RECEIPT_EXCEPTION_FLAG
,ACCRUAL_STATUS_CODE
,INSPECTION_STATUS_CODE
,INSPECTION_QUALITY_CODE
,DESTINATION_TYPE_CODE
,DELIVER_TO_PERSON_ID
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 22/28
5/13/12 1.1. Modeling the Enterprise
,DELIVER_TO_PERSON_ID
,LOCATION_ID
,DELIVER_TO_LOCATION_ID
,SUBINVENTORY
,LOCATOR_ID
,WIP_ENTITY_ID
,WIP_LINE_ID

,DEPARTMENT_CODE
,WIP_REPETITIVE_SCHEDULE_ID
,WIP_OPERATION_SEQ_NUM
,WIP_RESOURCE_SEQ_NUM
,BOM_RESOURCE_ID
,SHIPMENT_NUM
,FREIGHT_CARRIER_CODE
,BILL_OF_LADING
,PACKING_SLIP
,SHIPPED_DATE
,EXPECTED_RECEIPT_DATE
,ACTUAL_COST
,TRANSFER_COST
,TRANSPORTATION_COST
,TRANSPORTATION_ACCOUNT_ID
,NUM_OF_CONTAINERS
,WAYBILL_AIRBILL_NUM
,VENDOR_ITEM_NUM
,VENDOR_LOT_NUM
,RMA_REFERENCE
,COMMENTS
,ATTRIBUTE_CATEGORY
,ATTRIBUTE1
,ATTRIBUTE2
,ATTRIBUTE3
,ATTRIBUTE4
,ATTRIBUTE5
,ATTRIBUTE6
,ATTRIBUTE7
,ATTRIBUTE8
,ATTRIBUTE9
,ATTRIBUTE10
,ATTRIBUTE11
,ATTRIBUTE12
,ATTRIBUTE13
,ATTRIBUTE14
,ATTRIBUTE15
,SHIP_HEAD_ATTRIBUTE_CATEGORY
,SHIP_HEAD_ATTRIBUTE1
,SHIP_HEAD_ATTRIBUTE2
,SHIP_HEAD_ATTRIBUTE3
,SHIP_HEAD_ATTRIBUTE4
,SHIP_HEAD_ATTRIBUTE5
,SHIP_HEAD_ATTRIBUTE6
,SHIP_HEAD_ATTRIBUTE7

,SHIP_HEAD_ATTRIBUTE8
,SHIP_HEAD_ATTRIBUTE9
,SHIP_HEAD_ATTRIBUTE10
,SHIP_HEAD_ATTRIBUTE11
,SHIP_HEAD_ATTRIBUTE12
,SHIP_HEAD_ATTRIBUTE13
,SHIP_HEAD_ATTRIBUTE14
,SHIP_HEAD_ATTRIBUTE15
,SHIP_LINE_ATTRIBUTE_CATEGORY
,SHIP_LINE_ATTRIBUTE1
,SHIP_LINE_ATTRIBUTE2
,SHIP_LINE_ATTRIBUTE3
,SHIP_LINE_ATTRIBUTE4
,SHIP_LINE_ATTRIBUTE5
,SHIP_LINE_ATTRIBUTE6
,SHIP_LINE_ATTRIBUTE7
,SHIP_LINE_ATTRIBUTE8
,SHIP_LINE_ATTRIBUTE9
,SHIP_LINE_ATTRIBUTE10
,SHIP_LINE_ATTRIBUTE11
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 23/28
5/13/12 1.1. Modeling the Enterprise
,SHIP_LINE_ATTRIBUTE11
,SHIP_LINE_ATTRIBUTE12
,SHIP_LINE_ATTRIBUTE13
,SHIP_LINE_ATTRIBUTE14
,SHIP_LINE_ATTRIBUTE15
,USSGL_TRANSACTION_CODE
,GOVERNMENT_CONTEXT
,REASON_ID
,DESTINATION_CONTEXT
,SOURCE_DOC_QUANTITY
,SOURCE_DOC_UNIT_OF_MEASURE
,MOVEMENT_ID
,HEADER_INTERFACE_ID
,VENDOR_CUM_SHIPPED_QTY
,ITEM_NUM
,DOCUMENT_NUM
,DOCUMENT_LINE_NUM
,TRUCK_NUM
,SHIP_TO_LOCATION_CODE
,CONTAINER_NUM
,SUBSTITUTE_ITEM_NUM
,NOTICE_UNIT_PRICE
,ITEM_CATEGORY
,LOCATION_CODE
,VENDOR_NAME
,VENDOR_NUM

,VENDOR_SITE_CODE
,FROM_ORGANIZATION_CODE
,TO_ORGANIZATION_CODE
,INTRANSIT_OWNING_ORG_CODE
,ROUTING_CODE
,ROUTING_STEP
,RELEASE_NUM
,DOCUMENT_SHIPMENT_LINE_NUM
,DOCUMENT_DISTRIBUTION_NUM
,DELIVER_TO_PERSON_NAME
,DELIVER_TO_LOCATION_CODE
,USE_MTL_LOT
,USE_MTL_SERIAL
,LOCATOR
,REASON_NAME
,VALIDATION_FLAG
,SUBSTITUTE_ITEM_ID
,QUANTITY_SHIPPED
,QUANTITY_INVOICED
,TAX_NAME
,TAX_AMOUNT
,REQ_NUM
,REQ_LINE_NUM
,REQ_DISTRIBUTION_NUM
,WIP_ENTITY_NAME
,WIP_LINE_CODE
,RESOURCE_CODE
,SHIPMENT_LINE_STATUS_CODE
,BARCODE_LABEL
,TRANSFER_PERCENTAGE
,QA_COLLECTION_ID
,COUNTRY_OF_ORIGIN_CODE
,OE_ORDER_HEADER_ID
,OE_ORDER_LINE_ID
,CUSTOMER_ID
,CUSTOMER_SITE_ID
,CUSTOMER_ITEM_NUM
,CREATE_DEBIT_MEMO_FLAG
,PUT_AWAY_RULE_ID
,PUT_AWAY_STRATEGY_ID
,LPN_ID
,TRANSFER_LPN_ID
,COST_GROUP_ID
,MOBILE_TXN
,MMTT_TEMP_ID

,TRANSFER_COST_GROUP_ID
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 24/28
5/13/12 1.1. Modeling the Enterprise
,TRANSFER_COST_GROUP_ID
,SECONDARY_QUANTITY
,SECONDARY_UNIT_OF_MEASURE
,SECONDARY_UOM_CODE
,QC_GRADE
)
values
(
v_rcv_transactions.INTERFACE_TRANSACTION_ID, --INTERFACE_TRANSACTION_ID
po_group_id, --GROUP_ID
SYSDATE, --LAST_UPDATE_DATE
-1, --LAST_UPDATED_BY
SYSDATE, --,CREATION_DATE
-1, --CREATED_BY
-1, --LAST_UPDATE_LOGIN
null, --REQUEST_ID
null, --PROGRAM_APPLICATION_ID
null, --PROGRAM_ID
null, --PROGRAM_UPDATE_DATE
'DELIVER', --TRANSACTION_TYPE
SYSDATE, --TRANSACTION_DATE
'PENDING', --PROCESSING_STATUS_CODE
'BATCH', --PROCESSING_MODE_CODE
null, --PROCESSING_REQUEST_ID
'PENDING', --TRANSACTION_STATUS_CODE
v_rcv_transactions.category_id, --CATEGORY_ID
pi_quantity , --QUANTITY
v_rcv_transactions.unit_of_measure, --UNIT_OF_MEASURE
'RCV', --INTERFACE_SOURCE_CODE
null, --INTERFACE_SOURCE_LINE_ID
null, --INV_TRANSACTION_ID
v_rcv_transactions.item_id, --ITEM_ID
null, --ITEM_DESCRIPTION
null, --ITEM_REVISION
v_rcv_transactions.uom_code, --UOM_CODE
null, --EMPLOYEE_ID
null, --AUTO_TRANSACT_CODE
v_rcv_transactions.shipment_header_id, --SHIPMENT_HEADER_ID
v_rcv_transactions.shipment_line_id, --SHIPMENT_LINE_ID
null, --SHIP_TO_LOCATION_ID
pi_quantity , --PRIMARY_QUANTITY
v_rcv_transactions.unit_of_measure, --PRIMARY_UNIT_OF_MEASURE
'VENDOR', --RECEIPT_SOURCE_CODE
v_rcv_transactions.vendor_id, --VENDOR_ID
v_rcv_transactions.vendor_site_id, --VENDOR_SITE_ID

null, --FROM_ORGANIZATION_ID
null, --FROM_SUBINVENTORY
v_rcv_transactions.to_organization_id, --TO_ORGANIZATION_ID
null, --INTRANSIT_OWNING_ORG_ID
v_rcv_transactions.routing_header_id, --ROUTING_HEADER_ID
null, --ROUTING_STEP_ID
'PO', --SOURCE_DOCUMENT_CODE
v_rcv_transactions.parent_transaction_id, --PARENT_TRANSACTION_ID
v_rcv_transactions.po_header_id, --PO_HEADER_ID
null, --PO_REVISION_NUM
v_rcv_transactions.po_release_id, --PO_RELEASE_ID
v_rcv_transactions.po_line_id, --PO_LINE_ID
pi_locationid , --PO_LINE_LOCATION_ID
v_rcv_transactions.po_unit_price, --PO_UNIT_PRICE
v_rcv_transactions.currency_code, --CURRENCY_CODE
null , --CURRENCY_CONVERSION_TYPE
null, --CURRENCY_CONVERSION_RATE
null, --CURRENCY_CONVERSION_DATE
v_rcv_transactions.po_distribution_id, --PO_DISTRIBUTION_ID
null, --REQUISITION_LINE_ID
null, --REQ_DISTRIBUTION_ID
null, --CHARGE_ACCOUNT_ID
null, --SUBSTITUTE_UNORDERED_CODE
null, --RECEIPT_EXCEPTION_FLAG
null, --ACCRUAL_STATUS_CODE
'NOT INSPECTED', --INSPECTION_STATUS_CODE
null, --INSPECTION_QUALITY_CODE
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 25/28
5/13/12 1.1. Modeling the Enterprise
null, --INSPECTION_QUALITY_CODE
'INVENTORY', --DESTINATION_TYPE_CODE
0, --DELIVER_TO_PERSON_ID
0 , --LOCATION_ID
0, --DELIVER_TO_LOCATION_ID
pi_subinventory , --SUBINVENTORY
v_rcv_transactions.locator_id, --LOCATOR_ID
null, --,WIP_ENTITY_ID
null, --,WIP_LINE_ID
null, --null,--null,--null,--,DEPARTMENT_CODE
null, --,WIP_REPETITIVE_SCHEDULE_ID
null, --,WIP_OPERATION_SEQ_NUM
null, --null,--null,--,WIP_RESOURCE_SEQ_NUM
null, --,BOM_RESOURCE_ID
null,--,SHIPMENT_NUM
null,--null,--null,--null,--null,--,FREIGHT_CARRIER_CODE
null,--null,--null,--,BILL_OF_LADING
null,--null,--null,--null,--,PACKING_SLIP
null,--,SHIPPED_DATE

null,--null,--,EXPECTED_RECEIPT_DATE
null,--,ACTUAL_COST
null,--,TRANSFER_COST
null,--,TRANSPORTATION_COST
null,--null,--,TRANSPORTATION_ACCOUNT_ID
null,--,NUM_OF_CONTAINERS
null,--null,--,WAYBILL_AIRBILL_NUM
null,--null,--,VENDOR_ITEM_NUM
null,--null,--,VENDOR_LOT_NUM
null,--,RMA_REFERENCE
null,--,COMMENTS
null,--,ATTRIBUTE_CATEGORY
null,--null,--null,--null,--,ATTRIBUTE1
null,--,ATTRIBUTE2
null,--,ATTRIBUTE3
null,--null,--,ATTRIBUTE4
null,--null,--null,--,ATTRIBUTE5
null,--,ATTRIBUTE6
null,--,ATTRIBUTE7
null,--,ATTRIBUTE8
null,--,ATTRIBUTE9
null,--,ATTRIBUTE10
null,--,ATTRIBUTE11
null,--,ATTRIBUTE12
null,--,ATTRIBUTE13
null,--,ATTRIBUTE14
null,--,ATTRIBUTE15
null,--,SHIP_HEAD_ATTRIBUTE_CATEGORY
null,--,SHIP_HEAD_ATTRIBUTE1
null,--,SHIP_HEAD_ATTRIBUTE2
null,--,SHIP_HEAD_ATTRIBUTE3
null,--,SHIP_HEAD_ATTRIBUTE4
null,--,SHIP_HEAD_ATTRIBUTE5
null,--null,--null,--null,--,SHIP_HEAD_ATTRIBUTE6
null,--,SHIP_HEAD_ATTRIBUTE7
null,--null,--null,--null,--,SHIP_HEAD_ATTRIBUTE8
null,--null,--null,--null,--,SHIP_HEAD_ATTRIBUTE9
null,--null,--null,--null,--,SHIP_HEAD_ATTRIBUTE10
null,--,SHIP_HEAD_ATTRIBUTE11
null,--,SHIP_HEAD_ATTRIBUTE12
null,--,SHIP_HEAD_ATTRIBUTE13
null,--,SHIP_HEAD_ATTRIBUTE14
null,--,SHIP_HEAD_ATTRIBUTE15
null,--null,--,SHIP_LINE_ATTRIBUTE_CATEGORY
null,--,SHIP_LINE_ATTRIBUTE1

null,--,SHIP_LINE_ATTRIBUTE2
null,--,SHIP_LINE_ATTRIBUTE3
null,--,SHIP_LINE_ATTRIBUTE4
null,--,SHIP_LINE_ATTRIBUTE5
null,--,SHIP_LINE_ATTRIBUTE6
null,--,SHIP_LINE_ATTRIBUTE7
null,--,SHIP_LINE_ATTRIBUTE8
null,--,SHIP_LINE_ATTRIBUTE9
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 26/28
5/13/12 1.1. Modeling the Enterprise
null,--,SHIP_LINE_ATTRIBUTE9
null,--,SHIP_LINE_ATTRIBUTE10
null,--,SHIP_LINE_ATTRIBUTE11
null,--,SHIP_LINE_ATTRIBUTE12
null,--,SHIP_LINE_ATTRIBUTE13
null,--,SHIP_LINE_ATTRIBUTE14
null,--,SHIP_LINE_ATTRIBUTE15
null,--,USSGL_TRANSACTION_CODE
null,--,GOVERNMENT_CONTEXT
null,--,REASON_ID
'INVENTORY', --DESTINATION_CONTEXT
null,--,SOURCE_DOC_QUANTITY
null,--,SOURCE_DOC_UNIT_OF_MEASURE
null,--,MOVEMENT_ID
null,--,HEADER_INTERFACE_ID
null,--null,--,VENDOR_CUM_SHIPPED_QTY
null,--,ITEM_NUM
null,--,DOCUMENT_NUM
null,--,DOCUMENT_LINE_NUM
null,--,TRUCK_NUM
null,--,SHIP_TO_LOCATION_CODE
null,--,CONTAINER_NUM
null,--,SUBSTITUTE_ITEM_NUM
null,--,NOTICE_UNIT_PRICE
null,--,ITEM_CATEGORY
null,--,LOCATION_CODE
null,--,VENDOR_NAME
null,--,VENDOR_NUM
null,--,VENDOR_SITE_CODE
null,--,FROM_ORGANIZATION_CODE
null,--,TO_ORGANIZATION_CODE
null,--,INTRANnull,--SIT_OWNING_ORG_CODE
null,--,ROUTING_CODE
null,--,ROUTING_STEP
null,--,RELEASE_NUM
null,--,DOCUMENT_SHIPMENT_LINE_NUM
null,--null,--null,--,DOCUMENT_DISTRIBUTION_NUM
null,--,DELIVER_TO_PERSON_NAME

null,--,DELIVER_TO_LOCATION_CODE
null, --,USE_MTL_LOT
null, --,USE_MTL_SERIAL
null,--,LOCATOR
null,--,REASON_NAME
null,--,VALIDATION_FLAG
null,--,SUBSTITUTE_ITEM_ID
null,--,QUANTITY_SHIPPED
null,--,QUANTITY_INVOICED
null,--,TAX_NAME
null,--,TAX_AMOUNT
null,--,REQ_NUM
null,--,REQ_LINE_NUM
null,--,REQ_DISTRIBUTION_NUM
null,--,WIP_ENTITY_NAME
null,--,WIP_LINE_CODE
null,--,RESOURCE_CODE
null,--,SHIPMENT_LINE_STATUS_CODE
null,--,BARCODE_LABEL
null,--,TRANSFER_PERCENTAGE
null,--,QA_COLLECTION_ID
null,--,COUNTRY_OF_ORIGIN_CODE
null,--,OE_ORDER_HEADER_ID
null,--,OE_ORDER_LINE_ID
null,--,CUSTOMER_ID
null, --,CUSTOMER_SITE_ID
null, --,CUSTOMER_ITEM_NUM
null, --,CREATE_DEBIT_MEMO_FLAG
null, --,PUT_AWAY_RULE_ID
null, --,PUT_AWAY_STRATEGY_ID
null, --,LPN_ID
null, --,TRANSFER_LPN_ID
null, --,COST_GROUP_ID
null, --,MOBILE_TXN
null, --MMTT_TEMP_ID
www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 27/28
5/13/12 1.1. Modeling the Enterprise
null, --MMTT_TEMP_ID
null, --TRANSFER_COST_GROUP_ID
null, --SECONDARY_QUANTITY
null, --SECONDARY_UNIT_OF_MEASURE
null, --SECONDARY_UOM_CODE
null );--QC_GRADE
commit;
end deliver_transaction_proc;
end EINV_DELIVER_PKG ;
/

Copyright © 2000-2005 ConfluentMinds Pvt Ltd. All Rights Reserved. Unauthorized use, duplication or distribution is strictly prohibited. This is the proprietary
information of ConfluentMinds Pvt Ltd. Use is subject to license terms.

Prev Home Next


A Techno-functional Guide to Oracle Applications - Supply Chain Management.Your feedback please.

www.confluentminds.com/Trainings/SCM/CodeSamplePOAPI.html 28/28

Você também pode gostar