Pages

Monday, June 19, 2017

Creating Suppliers

Suppliers
1. POS: Allow Supplier with Duplicate Tax Payer
2. CE: Disable Bank Validation
3. Adding Same bank account to different suppliers
4. EOS: External Responsibilty


--//-------------------------------------- --//Creating Suppliers --//-------------------------------------- DECLARE l_vendor_rec ap_vendor_pub_pkg.r_vendor_rec_type; l_return_status VARCHAR2(10); l_msg_count NUMBER; l_msg_data VARCHAR2(1000); l_vendor_id NUMBER; l_party_id NUMBER; BEGIN l_vendor_rec.vendor_name := 'ERP Technologies'; pos_vendor_pub_pkg.create_vendor ( p_vendor_rec => l_vendor_rec, 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; EXCEPTION WHEN OTHERS THEN ROLLBACK; DBMS_OUTPUT.PUT_LINE(SQLERRM); END; / SHOW ERR; --//-------------------------------------- --//Creating Supplier Sites --//-------------------------------------- DECLARE l_vendor_site_rec ap_vendor_pub_pkg.r_vendor_site_rec_type; lc_return_status VARCHAR2(10); ln_msg_count NUMBER; lc_msg_data VARCHAR2(1000); ln_vendor_site_id NUMBER; ln_party_site_id NUMBER; ln_location_id NUMBER; BEGIN l_vendor_site_rec.vendor_id := 121170; l_vendor_site_rec.vendor_site_code := 'Supplier_Site'; l_vendor_site_rec.address_line1 := '05 Main Street'; l_vendor_site_rec.city := 'New York'; l_vendor_site_rec.country := 'US'; l_vendor_site_rec.org_id := 204; 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 ( p_vendor_site_rec => l_vendor_site_rec, x_return_status => lc_return_status, x_msg_count => ln_msg_count, x_msg_data => lc_msg_data, x_vendor_site_id => ln_vendor_site_id, x_party_site_id => ln_party_site_id, x_location_id => ln_location_id ); COMMIT; DBMS_OUTPUT.PUT_LINE(ln_vendor_site_id||'ln_vendor_site_id'||ln_party_site_id||'ln_party_site_id'||ln_location_id||'ln_location_id'); EXCEPTION WHEN OTHERS THEN ROLLBACK; DBMS_OUTPUT.PUT_LINE(SQLERRM); END; / SHOW ERR; --//-------------------------------------- --//Creating Supplier Contacts --//-------------------------------------- DECLARE p_api_version NUMBER; p_init_msg_list VARCHAR2(200); p_commit VARCHAR2(200); p_validation_level NUMBER; x_return_status VARCHAR2(200); x_msg_count NUMBER; x_msg_data VARCHAR2(200); lr_vend_cont apps.ap_vendor_pub_pkg.r_vendor_contact_rec_type; x_vendor_contact_id NUMBER; x_per_party_id NUMBER; x_rel_party_id NUMBER; x_rel_id NUMBER; x_org_contact_id NUMBER; x_party_site_id NUMBER; l_msg VARCHAR2(200); BEGIN -- Initialize apps session fnd_global.apps_initialize(1119, 50833, 200); mo_global.init('SQLAP'); fnd_client_info.set_org_context(101); -- Assign Basic Values p_api_version := 1.0; p_init_msg_list := fnd_api.g_true; p_commit := fnd_api.g_true; p_validation_level := fnd_api.g_valid_level_full; -- Assign Contact Details lr_vend_cont.vendor_id := 121170; lr_vend_cont.vendor_site_id := 91912; lr_vend_cont.vendor_contact_id := NULL; lr_vend_cont.per_party_id := NULL; lr_vend_cont.relationship_id := NULL; lr_vend_cont.rel_party_id := NULL; lr_vend_cont.party_site_id := '320637'; lr_vend_cont.org_contact_id := NULL; lr_vend_cont.org_party_site_id := NULL; lr_vend_cont.person_first_name := 'test'; lr_vend_cont.person_middle_name := NULL; lr_vend_cont.person_last_name := 'oracle2'; lr_vend_cont.person_title := 'Mr.'; lr_vend_cont.organization_name_phonetic := NULL; lr_vend_cont.person_first_name_phonetic := NULL; lr_vend_cont.person_last_name_phonetic := NULL; lr_vend_cont.inactive_date := NULL; lr_vend_cont.url := 'www.test.com'; lr_vend_cont.email_address := 'contact@test.com'; lr_vend_cont.vendor_contact_interface_id := NULL; lr_vend_cont.vendor_interface_id := NULL; lr_vend_cont.vendor_site_code := NULL; lr_vend_cont.org_id := 204; lr_vend_cont.operating_unit_name := NULL; lr_vend_cont.prefix := NULL; lr_vend_cont.contact_name_phonetic := 'Test contact'; ap_vendor_pub_pkg.create_vendor_contact(p_api_version => p_api_version, p_init_msg_list => p_init_msg_list, p_commit => p_commit, p_validation_level => p_validation_level, x_return_status => x_return_status, x_msg_count => x_msg_count, x_msg_data => x_msg_data, p_vendor_contact_rec => lr_vend_cont, x_vendor_contact_id => x_vendor_contact_id, x_per_party_id => x_per_party_id, x_rel_party_id => x_rel_party_id, x_rel_id => x_rel_id, x_org_contact_id => x_org_contact_id, x_party_site_id => x_party_site_id); DBMS_OUTPUT.put_line('X_RETURN_STATUS = ' || x_return_status); DBMS_OUTPUT.put_line('X_MSG_COUNT = ' || x_msg_count); DBMS_OUTPUT.put_line('X_MSG_DATA = ' || x_msg_data); DBMS_OUTPUT.put_line('X_VENDOR_CONTACT_ID = ' || x_vendor_contact_id); DBMS_OUTPUT.put_line('X_PER_PARTY_ID = ' || x_per_party_id); DBMS_OUTPUT.put_line('X_REL_PARTY_ID = ' || x_rel_party_id); DBMS_OUTPUT.put_line('X_REL_ID = ' || x_rel_id); DBMS_OUTPUT.put_line('X_ORG_CONTACT_ID = ' || x_org_contact_id); DBMS_OUTPUT.put_line('X_PARTY_SITE_ID = ' || x_party_site_id); IF (x_return_status <> fnd_api.g_ret_sts_success) THEN FOR i IN 1 .. fnd_msg_pub.count_msg LOOP l_msg := fnd_msg_pub.get(p_msg_index => i, p_encoded => fnd_api.g_false); DBMS_OUTPUT.put_line('The API call failed with error ' || l_msg); END LOOP; ELSE DBMS_OUTPUT.put_line('The API call ended with SUCESSS status'); END IF; END;






No comments:

Post a Comment