AP supplier interface

61 70 0
AP supplier interface

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Oracle Application AP Supplier Interface Loading Data Muhammad Aurangzaib 15 AP Supplier Interface [Data Loading] Table of Contents Oracle Supplier Tables: Oracle Supplier Interface Table Minimum columns to be populated for suppliers interface: Table AP_SUPPLIERS_INT Table AP_SUPPILER_SITES_INT Table AP_SUP_SITE_CONTACT_INT Steps to Load the Data: Executable and Concurrent Programs Create the Stage Tables 10 Create Package “XXEDB_AP_SUPPLIERS_INTERFACE” 22 Execute the Open Interface in “Payable Manager” Responsibility 58 View the Rejection Records, “AP_SUPPLIER_INT_REJECTIONS” Table 60 Page of 60 AP Supplier Interface [Data Loading] AP Supplier Interface Oracle Supplier Tables: This is Supplier Interface Program to load the data for the Oracle Tables: AP_SUPPLIERS AP_SUPPLIER_SITES_ALL AP_SUPPLIER_CONTACTS Oracle Supplier Interface Table To load data, interface tables will be used: AP_SUPPLIERS_INT AP_SUPPLIER_SITES_INT AP_SUP_SITE_CONTACT_INT Minimum columns to be populated for suppliers interface: Table AP_SUPPLIERS_INT Vendor_ interface_ id => ap_suppliers_int_s.next_val summary_flag=>set to y enabled_flag=>set to y vendor_name segment1=>vendor number Page of 60 AP Supplier Interface [Data Loading] terms_id/terms_name invoice_currency_code Table AP_SUPPILER_SITES_INT vendor_site_interface_id=> ap_supplier_sites_int_s.nextval vendor_interface_id =>ap_supplier_sites_int_s.nextval vendor_site_code org_id vendor_id address_line1 terms_id/terms_name invoice_currency_code country Table AP_SUP_SITE_CONTACT_INT vendor_interface_id =>ap_supplier_sites_int_s.nextval vendor_contact_interface_id=>AP_SUP_SITE_CONTACT_INT_S.NEXTVAL vendor_site_code org_id vendor_site_id vendor_id last_name Note: if you want to populate URL or Email then make sure they are in correct format or oracle rejects these data The data inserted via this interface are automatically populated into “HZ_PARTIES” table Steps to Load the Data: Define the Executable and Concurrent Programs Create the Stage Tables as XXAP_SUPPLIERS_INT_STG, XXAP_SUPPLIER_SITES_INT_STG, XXAP_SUP_SITE_CONTACT_INT_STG Create Package “XXEDB_AP_SUPPLIERS_INTERFACE”, Validate the Stage Tables and insert into the Suppliers interface tables Run the Oracle’s Open Supplier Standard Interfaces Programs in "Payable Manager" Responsibility Page of 60 AP Supplier Interface [Data Loading] a Supplier Open Interface Import b Supplier Sites Open Interface Import c Supplier Contacts Open Interface Import View the Rejection Records, “AP_SUPPLIER_INT_REJECTIONS” Table Executable and Concurrent Programs XXEDB_AP_SUPPLIERS_LOAD Page of 60 AP Supplier Interface [Data Loading] Page of 60 AP Supplier Interface [Data Loading] XXEDB_AP_SUPPLIERS_SITES_LOAD Page of 60 AP Supplier Interface [Data Loading] Page of 60 AP Supplier Interface [Data Loading] XXEDB_AP_SUPPLIERS_CONT_LOAD Page of 60 AP Supplier Interface [Data Loading] Page of 60 AP Supplier Interface [Data Loading] r_supp_sites.province, r_supp_sites.country, r_supp_sites.area_code, r_supp_sites.phone, r_supp_sites.customer_num, r_supp_sites.ship_to_location_id, r_supp_sites.ship_to_location_code, r_supp_sites.bill_to_location_id, r_supp_sites.bill_to_location_code, r_supp_sites.ship_via_lookup_code, r_supp_sites.freight_terms_lookup_code, r_supp_sites.fob_lookup_code, r_supp_sites.inactive_date, r_supp_sites.fax, r_supp_sites.fax_area_code, r_supp_sites.telex, r_supp_sites.payment_method_lookup_code, r_supp_sites.terms_date_basis, r_supp_sites.vat_code, r_supp_sites.distribution_set_id, r_supp_sites.distribution_set_name, r_supp_sites.accts_pay_code_combination_id, r_supp_sites.prepay_code_combination_id, r_supp_sites.pay_group_lookup_code, r_supp_sites.payment_priority, r_supp_sites.terms_id, r_supp_sites.terms_name, r_supp_sites.invoice_amount_limit, r_supp_sites.pay_date_basis_lookup_code, r_supp_sites.always_take_disc_flag, r_supp_sites.invoice_currency_code, r_supp_sites.payment_currency_code, r_supp_sites.hold_all_payments_flag, r_supp_sites.hold_future_payments_flag, r_supp_sites.hold_reason, r_supp_sites.hold_unmatched_invoices_flag, r_supp_sites.ap_tax_rounding_rule, r_supp_sites.auto_tax_calc_flag, r_supp_sites.auto_tax_calc_override, r_supp_sites.amount_includes_tax_flag, r_supp_sites.exclusive_payment_flag, r_supp_sites.tax_reporting_site_flag, Page 46 of 60 AP Supplier Interface [Data Loading] r_supp_sites.attribute_category, r_supp_sites.attribute1, r_supp_sites.attribute2, r_supp_sites.attribute3, r_supp_sites.attribute4, r_supp_sites.attribute5, r_supp_sites.attribute6, r_supp_sites.attribute7, r_supp_sites.attribute8, r_supp_sites.attribute9, r_supp_sites.attribute10, r_supp_sites.attribute11, r_supp_sites.attribute12, r_supp_sites.attribute13, r_supp_sites.attribute14, r_supp_sites.attribute15, r_supp_sites.request_id, r_supp_sites.program_application_id, r_supp_sites.program_id, r_supp_sites.program_update_date, r_supp_sites.exclude_freight_from_discount, r_supp_sites.vat_registration_num, r_supp_sites.org_id, r_supp_sites.operating_unit_name, r_supp_sites.address_line4, r_supp_sites.county, r_supp_sites.address_style, r_supp_sites.LANGUAGE, r_supp_sites.allow_awt_flag, r_supp_sites.awt_group_id, r_supp_sites.awt_group_name, r_supp_sites.global_attribute1, r_supp_sites.global_attribute2, r_supp_sites.global_attribute3, r_supp_sites.global_attribute4, r_supp_sites.global_attribute5, r_supp_sites.global_attribute6, r_supp_sites.global_attribute7, r_supp_sites.global_attribute8, Page 47 of 60 AP Supplier Interface [Data Loading] r_supp_sites.global_attribute9, r_supp_sites.global_attribute10, r_supp_sites.global_attribute11, r_supp_sites.global_attribute12, r_supp_sites.global_attribute13, r_supp_sites.global_attribute14, r_supp_sites.global_attribute15, r_supp_sites.global_attribute16, r_supp_sites.global_attribute17, r_supp_sites.global_attribute18, r_supp_sites.global_attribute19, r_supp_sites.global_attribute20, r_supp_sites.global_attribute_category, r_supp_sites.edi_transaction_handling, r_supp_sites.edi_id_number, r_supp_sites.edi_payment_method, r_supp_sites.edi_payment_format, r_supp_sites.edi_remittance_method, r_supp_sites.bank_charge_bearer, r_supp_sites.edi_remittance_instruction, r_supp_sites.pay_on_code, r_supp_sites.default_pay_site_id, r_supp_sites.pay_on_receipt_summary_code, r_supp_sites.tp_header_id, r_supp_sites.ece_tp_location_code, r_supp_sites.pcard_site_flag, r_supp_sites.match_option, r_supp_sites.country_of_origin_code, r_supp_sites.future_dated_payment_ccid, r_supp_sites.create_debit_memo_flag, r_supp_sites.offset_tax_flag, r_supp_sites.supplier_notif_method, r_supp_sites.email_address, r_supp_sites.remittance_email, r_supp_sites.primary_pay_site_flag, r_supp_sites.import_request_id, r_supp_sites.status, r_supp_sites.reject_code, r_supp_sites.shipping_control, r_supp_sites.duns_number, Page 48 of 60 AP Supplier Interface [Data Loading] r_supp_sites.tolerance_id, r_supp_sites.tolerance_name, r_supp_sites.iby_bank_charge_bearer, r_supp_sites.bank_instruction1_code, r_supp_sites.bank_instruction2_code, r_supp_sites.bank_instruction_details, r_supp_sites.payment_reason_code, r_supp_sites.payment_reason_comments, r_supp_sites.delivery_channel_code, r_supp_sites.payment_format_code, r_supp_sites.settlement_priority, r_supp_sites.payment_text_message1, r_supp_sites.payment_text_message2, r_supp_sites.payment_text_message3, r_supp_sites.vendor_site_interface_id, r_supp_sites.payment_method_code, r_supp_sites.retainage_rate, r_supp_sites.gapless_inv_num_flag, r_supp_sites.selling_company_identifier, r_supp_sites.pay_awt_group_id, r_supp_sites.pay_awt_group_name, r_supp_sites.party_site_id, r_supp_sites.party_site_name, r_supp_sites.remit_advice_delivery_method, r_supp_sites.remit_advice_fax, r_supp_sites.party_orig_system, r_supp_sites.party_orig_system_reference, r_supp_sites.party_site_orig_system, r_supp_sites.party_site_orig_sys_reference, r_supp_sites.supplier_site_orig_system, r_supp_sites.sup_site_orig_system_reference, r_supp_sites.sdh_batch_id, r_supp_sites.party_id, r_supp_sites.location_id, r_supp_sites.cage_code, r_supp_sites.legal_business_name, r_supp_sites.doing_bus_as_name, r_supp_sites.division_name, r_supp_sites.small_business_code, Page 49 of 60 AP Supplier Interface [Data Loading] r_supp_sites.ccr_comments, r_supp_sites.debarment_start_date, r_supp_sites.debarment_end_date, r_supp_sites.services_tolerance_id, r_supp_sites.services_tolerance_name ); EXCEPTION WHEN OTHERS THEN l_insert_error_flag := 'Y'; l_insert_error_desc := SUBSTR ( 'Error while inserting into interface table : ' || SQLERRM, 1, 4999 ); retcode := 1; END; - if no errors then update the staging table with new environment ids and successfully processed status IF l_insert_error_flag = 'N' THEN l_load_success := l_load_success + 1; - Count the Number of l_load_sucess fnd_file.put_line (fnd_file.LOG, 'Record successful'); UPDATE xxedb.xxap_supplier_sites_int_stg SET error_flag = 'N', process_flag = 'Y', error_desc = NULL, vendor_interface_id = r_supp_sites.vendor_interface_id_m, vendor_site_interface_id = r_supp_sites.vendor_site_interface_id WHERE ROWID = r_supp_sites.ROWID; fnd_file.put_line Page 50 of 60 AP Supplier Interface [Data Loading] (fnd_file.LOG, 'Error While Loading Record for Vendor_name : ' || r_supp_sites.old_supplier_name ); ELSIF l_insert_error_flag = 'Y' THEN fnd_file.put_line (fnd_file.LOG, 'Record UN-Successful'); UPDATE xxedb.xxap_supplier_sites_int_stg SET error_flag = 'Y', process_flag = 'N', error_desc = SUBSTR (error_desc || ', ' || l_insert_error_desc, 1, 4000 ), vendor_interface_id = r_supp_sites.vendor_interface_id_m, vendor_site_interface_id = r_supp_sites.vendor_site_interface_id WHERE ROWID = r_supp_sites.ROWID; END IF; COMMIT; END IF; END IF; END LOOP; END supplier_sites_load; PROCEDURE sup_site_contact_load ( errbuf OUT VARCHAR2, retcode OUT NUMBER, p_valid_flag IN VARCHAR2 DEFAULT 'Y' ) AS CURSOR c_site_contacts IS SELECT xssc.ROWID, xssc.*, Page 51 of 60 AP Supplier Interface [Data Loading] FROM WHERE AND AND AND AND AND AND xassi.vendor_interface_id vendor_interface_id_m, xassi.old_supplier_id old_supplier_id_m, xassi.old_supplier_number old_supplier_number_m, xassi.old_supplier_name old_supplier_name_m, xassi.old_vendor_site_id old_vendor_site_id_m, xassi.old_vendor_site_code old_vendor_site_code_m xxedb.xxap_sup_site_contact_int_stg xssc, xxedb.xxap_supplier_sites_int_stg xassi = xssc.old_supplier_id = xassi.old_supplier_id xssc.old_vendor_site_id = xassi.old_vendor_site_id NVL (xssc.error_flag, 'Y') 'N' NVL (xssc.process_flag, 'N') 'Y' xassi.process_flag = 'Y' xassi.error_flag = 'N'; l_insert_error_flag VARCHAR2 (1); l_insert_error_desc VARCHAR2 (4000); l_load_success NUMBER; l_vendor_id NUMBER; l_vendor_contact_interface_id NUMBER; l_org_id NUMBER := fnd_profile.VALUE ('ORG_ID'); BEGIN -(Update All the Error Column as NULL) -UPDATE xxedb.xxap_sup_site_contact_int_stg xssc SET process_flag = NULL, error_flag = NULL, error_desc = NULL WHERE NVL (process_flag, 'N') = 'Y' AND NVL (error_flag, 'N') = 'Y'; UPDATE xxedb.xxap_sup_site_contact_int_stg xssc SET vendor_site_code = old_vendor_site_code, org_id = l_org_id; COMMIT; FOR r_supp_cont IN c_site_contacts LOOP -(INITILIZATION THE LOCAL VARUABLES AS NULL;) Page 52 of 60 AP Supplier Interface [Data Loading] l_insert_error_flag := 'N'; l_insert_error_desc := NULL; IF p_valid_flag = 'N' THEN IF NVL (r_supp_cont.error_flag, 'N') = 'N' AND NVL (r_supp_cont.process_flag, 'N') = 'N' THEN SELECT vendor_id INTO l_vendor_id FROM ap_suppliers WHERE segment1 = r_supp_cont.old_supplier_number; r_supp_cont.vendor_id := l_vendor_id; UPDATE xxedb.xxap_sup_site_contact_int_stg xssc SET vendor_id = r_supp_cont.vendor_id WHERE old_supplier_number = r_supp_cont.old_supplier_number; COMMIT; SELECT ap_sup_site_contact_int_s.NEXTVAL INTO l_vendor_contact_interface_id FROM DUAL; UPDATE xxedb.xxap_sup_site_contact_int_stg xssc SET vendor_contact_interface_id = l_vendor_contact_interface_id WHERE old_supplier_number = r_supp_cont.old_supplier_number; r_supp_cont.vendor_contact_interface_id := l_vendor_contact_interface_id; BEGIN INSERT INTO ap_sup_site_contact_int (last_update_date, last_updated_by, vendor_site_id, vendor_site_code, Page 53 of 60 AP Supplier Interface [Data Loading] org_id, operating_unit_name, last_update_login, creation_date, created_by, inactive_date, first_name, middle_name, last_name, prefix, title, mail_stop, area_code, phone, program_application_id, program_id, program_update_date, request_id, contact_name_alt, first_name_alt, last_name_alt, department, import_request_id, status, reject_code, email_address, url, alt_area_code, alt_phone, fax_area_code, fax, vendor_interface_id, vendor_id, vendor_contact_interface_id, party_site_id, party_site_name, party_orig_system, party_orig_system_reference, party_site_orig_system, party_site_orig_sys_reference, supplier_site_orig_system, sup_site_orig_system_reference, contact_orig_system, contact_orig_system_reference, sdh_batch_id, Page 54 of 60 AP Supplier Interface [Data Loading] party_id, per_party_id, rel_party_id, relationship_id, org_contact_id ) VALUES (r_supp_cont.last_update_date, r_supp_cont.last_updated_by, r_supp_cont.vendor_site_id, r_supp_cont.vendor_site_code, r_supp_cont.org_id, r_supp_cont.operating_unit_name, r_supp_cont.last_update_login, r_supp_cont.creation_date, r_supp_cont.created_by, r_supp_cont.inactive_date, r_supp_cont.first_name, r_supp_cont.middle_name, r_supp_cont.last_name, r_supp_cont.prefix, r_supp_cont.title, r_supp_cont.mail_stop, r_supp_cont.area_code, r_supp_cont.phone, r_supp_cont.program_application_id, r_supp_cont.program_id, r_supp_cont.program_update_date, r_supp_cont.request_id, r_supp_cont.contact_name_alt, r_supp_cont.first_name_alt, r_supp_cont.last_name_alt, r_supp_cont.department, r_supp_cont.import_request_id, r_supp_cont.status, r_supp_cont.reject_code, r_supp_cont.email_address, r_supp_cont.url, r_supp_cont.alt_area_code, r_supp_cont.alt_phone, r_supp_cont.fax_area_code, r_supp_cont.fax, r_supp_cont.vendor_interface_id, r_supp_cont.vendor_id, r_supp_cont.vendor_contact_interface_id, r_supp_cont.party_site_id, Page 55 of 60 AP Supplier Interface [Data Loading] r_supp_cont.party_site_name, r_supp_cont.party_orig_system, r_supp_cont.party_orig_system_reference, r_supp_cont.party_site_orig_system, r_supp_cont.party_site_orig_sys_reference, r_supp_cont.supplier_site_orig_system, r_supp_cont.sup_site_orig_system_reference, r_supp_cont.contact_orig_system, r_supp_cont.contact_orig_system_reference, r_supp_cont.sdh_batch_id, r_supp_cont.party_id, r_supp_cont.per_party_id, r_supp_cont.rel_party_id, r_supp_cont.relationship_id, r_supp_cont.org_contact_id ); EXCEPTION WHEN OTHERS THEN l_insert_error_flag := 'Y'; l_insert_error_desc := SUBSTR ( 'Error while inserting into interface table : ' || SQLERRM, 1, 4999 ); retcode := 1; END; - if no errors then update the staging table with new environment ids and successfully processed status IF l_insert_error_flag = 'N' THEN l_load_success := l_load_success + 1; - Count the Number of l_load_sucess fnd_file.put_line (fnd_file.LOG, 'Record successful'); UPDATE xxedb.xxap_sup_site_contact_int_stg xssc Page 56 of 60 AP Supplier Interface [Data Loading] SET error_flag = 'N', process_flag = 'Y', error_desc = NULL, vendor_interface_id = r_supp_cont.vendor_interface_id_m, vendor_contact_interface_id = r_supp_cont.vendor_contact_interface_id WHERE ROWID = r_supp_cont.ROWID; fnd_file.put_line (fnd_file.LOG, 'Error While Loading Record for Vendor_name : ' || r_supp_cont.old_supplier_name_m ); ELSIF l_insert_error_flag = 'Y' THEN fnd_file.put_line (fnd_file.LOG, 'Record UN-Successful'); UPDATE xxedb.xxap_sup_site_contact_int_stg xssc SET error_flag = 'Y', process_flag = 'N', error_desc = SUBSTR (error_desc || ', ' || l_insert_error_desc, 1, 4000 ), vendor_interface_id = r_supp_cont.vendor_interface_id_m, vendor_contact_interface_id = r_supp_cont.vendor_contact_interface_id WHERE ROWID = r_supp_cont.ROWID; END IF; COMMIT; END IF; END IF; END LOOP; END sup_site_contact_load; Page 57 of 60 AP Supplier Interface [Data Loading] END xxedb_ap_suppliers_interface; / Execute the Open Interface in “Payable Manager” Responsibility Page 58 of 60 AP Supplier Interface [Data Loading] Page 59 of 60 AP Supplier Interface [Data Loading] View the Rejection Records, “AP_SUPPLIER_INT_REJECTIONS” Table To review the rejection of the Open Supplier Interface, consult the Oracle Rejection Table name “AP_SUPPLIER_INT_REJECTIONS” For Example: Page 60 of 60 ... Page of 60 AP Supplier Interface [Data Loading] AP Supplier Interface Oracle Supplier Tables: This is Supplier Interface Program to load the data for the Oracle Tables: AP_ SUPPLIERS AP_ SUPPLIER_ SITES_ALL... Programs XXEDB _AP_ SUPPLIERS_LOAD Page of 60 AP Supplier Interface [Data Loading] Page of 60 AP Supplier Interface [Data Loading] XXEDB _AP_ SUPPLIERS_SITES_LOAD Page of 60 AP Supplier Interface [Data... of 60 AP Supplier Interface [Data Loading] a Supplier Open Interface Import b Supplier Sites Open Interface Import c Supplier Contacts Open Interface Import View the Rejection Records, AP_ SUPPLIER_ INT_REJECTIONS”

Ngày đăng: 12/10/2018, 10:01

Tài liệu cùng người dùng

Tài liệu liên quan