Sunday 1 July 2018

api to create supplier contact in oracle apps r12.how to create supplier contacts in r12

api to create supplier contact in oracle apps r12.how to create supplier contacts in r12

In this post , I am sharing the script to create the Supplier contacts through Oracle standard API in Oracle apps. Oracle has provided the standard API 'pos_vendor_pub_pkg.create_vendor_contact'  to create the Supplier contacts. Here below I am sharing the Code to create Supplier contacts.
 

Example to Create Supplier contact in Oracle apps

 
 

 DECLARE
 l_vendor_contact_rec ap_vendor_pub_pkg.r_vendor_contact_rec_type;
 l_return_status VARCHAR2(10);
 l_msg_count NUMBER;
 l_msg_data VARCHAR2(1000);
 l_vendor_contact_id NUMBER;
 l_per_party_id NUMBER;
 l_rel_party_id NUMBER;
 l_rel_id NUMBER;
 l_org_contact_id NUMBER;
 l_party_site_id NUMBER;
 --Variables:
 l_vendor_name varchar2(200) := 'Test_supplier';
 l_org_id varchar2(200) := 83;
 l_person_first_name varchar2(200):= 'Ram';
 l_person_last_name varchar2(200):= 'Sharma';
 l_email_address varchar2(200):= 'test@gmail.com';
 l_phone varchar2(200):= '+97999303003';
 l_fax_phone varchar2(200):= '+23344444';
 BEGIN

 SELECT vendor_id
 INTO l_vendor_contact_rec.vendor_id
 FROM ap_suppliers
 WHERE vendor_name = l_vendor_name;
 l_vendor_contact_rec.org_id:=83;
 l_vendor_contact_rec.person_first_name := l_person_first_name;
 l_vendor_contact_rec.person_last_name := l_person_last_name;
 l_vendor_contact_rec.email_address   := l_email_address;
 l_vendor_contact_rec.phone   := l_phone;
 l_vendor_contact_rec.FAX_PHONE   := l_fax_phone;
 pos_vendor_pub_pkg.create_vendor_contact(
 p_vendor_contact_rec => l_vendor_contact_rec,
 x_return_status => l_return_status,
 x_msg_count => l_msg_count,
 x_msg_data => l_msg_data,
 x_vendor_contact_id => l_vendor_contact_id,
 x_per_party_id => l_per_party_id,
 x_rel_party_id => l_rel_party_id,
 x_rel_id => l_rel_id,
 x_org_contact_id => l_org_contact_id,
 x_party_site_id => l_party_site_id);
 dbms_output.put_line('return_status: '||l_return_status);
 dbms_output.put_line('msg_data: '||l_msg_data);
 dbms_output.put_line('vendor_contact_id: '||l_vendor_contact_id);
 dbms_output.put_line('party_site_id: '||l_party_site_id);
 dbms_output.put_line('per_party_id: '||l_per_party_id);
 dbms_output.put_line('rel_party_id: '||l_rel_party_id);
 dbms_output.put_line('rel_id: '||l_rel_id);
 dbms_output.put_line('org_contact_id: '||l_org_contact_id);
 IF l_msg_count >=1 THEN FOR I IN 1..l_msg_count LOOP
 dbms_output.put_line(I||'. '||SubStr(FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
 END LOOP;
END IF;
 if (l_return_status = 'S') then
 commit;
 end if;
 end;

0 comments:

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *