Friday, 19 September 2014

API for supplier/ vendor creation in R12

DECLARE
l_vendor_rec AP_VENDOR_PUB_PKG.r_vendor_rec_type;
l_return_status
VARCHAR2(30);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
l_vendor_id NUMBER;
l_party_id NUMBER;

BEGIN

----Required field for API pos_vendor_pub_pkg
l_vendor_rec.segment1 := '000777';
l_vendor_rec.vendor_name := 'DEMO_AP_SUPPLIER_API';
----Optional field for API pos_vendor_pub_pkg
l_vendor_rec.match_option := 'R';
l_vendor_rec.start_date_active := sysdate - 1;

----API call
pos_vendor_pub_pkg.Create_Vendor(--required input parametre
p_vendor_rec => l_vendor_rec,--output parameter
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_vendor_id => l_vendor_id,
x_party_id => l_party_id);


--COMMIT;
--output statement
dbms_output.put_line('return_status: ' || l_return_status);
dbms_output.put_line('msg_data: ' || l_msg_data);
dbms_output.put_line('vendor_id: ' || l_vendor_id);
dbms_output.put_line('party_id: ' || l_party_id);
--
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
---------------------------------------------------------------------------------------------------------------------

Output
-----------------------------------------------------------------------------------------------------------------------
return_status: S
msg_data:
vendor_id: 51171
party_id: 447681

--------------------------------------------------------------------------------------------------------------------------




No comments:

Post a Comment

AP Invoice Notes related Table details in Oracle Fusion

 What is the table that stores the AP Invoice notes? AP notes are stored in ZMM_NOTES table with SOURCE_OBJECT_CODE = 'AP_STANDARD_INVOI...