Friday, 19 September 2014

API for Supplier/ Vendor Site creation in R12

DECLARE
l_vendor_site_rec AP_VENDOR_PUB_PKG.r_vendor_site_rec_type;
l_return_status
VARCHAR2(30);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
l_vendor_site_id NUMBER;
l_party_site_id NUMBER;
l_location_id NUMBER;

BEGIN
----Required field for API for ap_vendor_pub_pkg.create_vendor_site

l_vendor_site_rec.vendor_id := 51171;
l_vendor_site_rec.vendor_site_code := 'DEMO_SITE';
l_vendor_site_rec.address_line1 := '3RD STREET LA';
l_vendor_site_rec.city := 'New York';
l_vendor_site_rec.country := 'US';
l_vendor_site_rec.org_id := 204;

----Optional field

l_vendor_site_rec.purchasing_site_flag := 'N';
l_vendor_site_rec.pay_site_flag := 'N';
l_vendor_site_rec.rfq_only_site_flag := 'N';

--

pos_vendor_pub_pkg.create_vendor_site
(--input parameter
p_vendor_site_rec => l_vendor_site_rec,
--output parameter
x_return_status => l_return_status,
x_msg_count => l_msg_count,
x_msg_data => l_msg_data,
x_vendor_site_id => l_vendor_site_id,
x_party_site_id => l_party_site_id,
x_location_id => l_location_id);


--commit;
dbms_output.put_line('return_status: ' || l_return_status);
dbms_output.put_line('msg_data: ' || l_msg_data);
dbms_output.put_line('vendor_site_id: ' || l_vendor_site_id);
dbms_output.put_line('party_site_id: ' || l_party_site_id);
dbms_output.put_line('location_id: ' || l_location_id);

exception
WHEN OTHERS THEN
ROLLBACK;
DBMS_OUTPUT.PUT_LINE(SQLERRM);
END;
--------------------------------------------------------------------------------------------------------------------------------

output
-------------------------------------------------------------------------------------------------------------------------------

return_status: S
msg_data:
vendor_site_id:
21911

party_site_id: 246632
location_id: 27339
---------------------------------------------------------------------------------------------------------------------------------

You will get data in base table using below query.

select * from ap_supplier_sites_all
where vendor_site_id=21911
---------------------------------------------------------------------------------------------
select * from hz_party_siteswhere party_site_id=246632
-------------------------------------------------------------------------------------------------
select * from hz_locationswhere location_id=27339
-----------------------------------------------------------------------------------------------

1 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...