You are on page 1of 9

R12 Payables Supplier Creation

In R12 we have new concept of TCA(Trading Community Architecture),TCA is a centralized place where all the party details including Customer and Supplier details get saved. TCA has some important tables like HZ_PARTIES and HZ_PARTY_SITES. Steps to create Supplier in R12 payables: 1. Insert data in the Supplier interface table AP_SUPPLIERS_INT table with mandatory columns like 1. 2. 3. vendor_interface_id (AP_SUPPLIERS_INT_S.nextval) status as 'NEW' Vendor_Name

4. Segment1: This columns stores the value of supplier number and which you can get from NEXT_AUTO_SUPPLIER_NUM.AP_PRODUCT_SETUP 5. term_id and other columns 2. Insert data in supplier site interface table i.e AP_SUPPLIER_SITES_INT table with mandatory columns like : 1. 2. 3. 4. 5. 6. vendor_site_interface_id (AP_SUPPLIER_SITES_INT_S.nextval) vendor_interface_id (AP_SUPPLIERS_INT_S.currval) Vendor_id: Use the vendor_id created in Step 2 (Supplier Import Program). Status as 'NEW' Org_id Vendor_Site_Code

7. pay_site_flag as 'Y' else will throw error in the Import Program (The site is not a Pay Site error) 3. Its not a mandatory step:Insert records in the supplier contact table i.e. AP_SUP_SITE_CONTACT_INT with mandatory columns like 1. 2. 3. 4. 5. vendor_interface_id (AP_SUPPLIERS_INT_S.currval) vendor_site_interface_id (AP_SUPPLIER_SITES_INT_S.currval) vendor_contact_interface_id (AP_SUP_SITE_CONTACT_INT_S.nextval) LAST_NAME: Else will throw error in the import program. vendor_id

4. Run the standard Import program "Supplier Open Interface Import" to import data from AP_SUPPLIER_INT table to TCA and supplier standard tables.Using segment1 column we can check data in PO_VENDORS which is a view of AP_SUPPLIERS and HZ_PARTIES .This will create a unique vendor_id.In case of error,we can check import failure reason in either import program output file or in the AP_SUPPLIER_INT_REJECTIONS table. 5. Run the Standard supplier site import program i.e. "Supplier Sites Open Interface Import".This will create supplier site for above vendor_id. 6. Then run supplier contact import program "Supplier Site Contacts Open Interface Import".

Note: We can also use request set "Supplier Open Interface Request Set" in place of running each import program individually. **In case any of the import program fails,we can check import failure reason in either import program output file or in the AP_SUPPLIER_INT_REJECTIONS table.In case output file is not giving any error reason that means latest patch for the import program has not been applied.Please check with you DBA and ask him to apply the latest patch. Sample Code:

INSERT into ap_suppliers_int (vendor_interface_id ,last_update_date ,last_updated_by ,vendor_name ,VENDOR_NAME_ALT ,segment1 ,summary_flag ,enabled_flag ,last_update_login ,creation_date ,created_by ,vendor_type_lookup_code ,one_time_flag ,ship_to_location_id ,bill_to_location_id ,ship_via_lookup_code

,fob_lookup_code ,freight_terms_lookup_code ,terms_id ,set_of_books_id ,always_take_disc_flag ,pay_date_basis_lookup_code ,pay_group_lookup_code ,payment_priority ,invoice_currency_code ,payment_currency_code ,hold_all_payments_flag ,hold_future_payments_flag ,accts_pay_code_combination_id ,prepay_code_combination_id ,type_1099 ,payment_method_lookup_code ,women_owned_flag ,small_business_flag ,hold_flag ,terms_date_basis ,inspection_required_flag ,receipt_required_flag ,qty_rcv_tolerance ,qty_rcv_exception_code ,enforce_ship_to_location_code ,days_early_receipt_allowed ,days_late_receipt_allowed ,receipt_days_exception_code ,auto_tax_calc_flag ,auto_tax_calc_override ,amount_includes_tax_flag ,state_reportable_flag ,federal_reportable_flag ,auto_calculate_interest_flag ,exclude_freight_from_discount ,match_option ,attribute10 ,attribute11 ,attribute12 ,attribute15 ,status ,exclusive_payment_flag) --,vat_code) -- New Added because of error VALUES (AP_SUPPLIERS_INT_S.nextval ,v_last_update_date ,v_last_updated_by ,trim(upper(v_vendor_name)) ,trim(upper(v_vendor_name))

,v_segment1 ,v_summary_flag ,v_enabled_flag ,v_last_update_login ,v_creation_date ,v_created_by ,NVL(v_vendor_type_lookup_code,'VENDOR') ,v_one_time_flag ,v_ship_to_location_id ,v_bill_to_location_id ,v_ship_via_lookup_code ,v_fob_lookup_code ,v_freight_terms_lookup_code ,v_terms_id ,v_set_of_books_id ,v_always_take_disc_flag ,v_pay_date_basis_lookup_code ,v_pay_group_lookup_code ,v_payment_priority ,v_invoice_currency_code ,v_payment_currency_code ,v_hold_all_payments_flag ,v_hold_future_payments_flag ,v_accts_pay_ccid ,v_prepay_ccid ,v_type_1099 ,v_payment_method_lookup_code ,v_women_owned_flag ,v_small_business_flag ,v_hold_flag ,v_terms_date_basis ,v_inspection_required_flag ,v_receipt_required_flag ,v_qty_rcv_tolerance ,v_qty_rcv_exception_code ,v_enforce_ship_to_loc_code ,v_days_early_receipt_allowed ,v_days_late_receipt_allowed ,v_receipt_days_exception_code ,v_auto_tax_calc_flag calc_override ,v_amount_includes_tax_flag ,v_state_reportable_flag ,v_federal_reportable_flag ,v_auto_calculate_interest_flag ,v_exclude_fght_from_disc ,v_match_option ,p_vendor_name

-- commented sankatha 041003 ,v_address_line1 ,v_vendor_site_code ,v_attribute12 ,substr(v_address_line1,1,15) ,'NEW' ,nvl(v_exclusive_payment_flag,'N')); -- ,'NO TAX'); fnd_file.put_line (fnd_file.LOG,'FIVE::'||SQL%ROWCOUNT);

--******************************* -- Calling Supplier Import Program --******************************* request_id:= FND_REQUEST.SUBMIT_REQUEST (Application => 'SQLAP' ,Program => 'APXSUIMP' ,Description => NULL ,Start_time => SYSDATE ,Sub_Request => FALSE ,Argument1 => 'ALL' ,Argument2 => 1000 ,Argument3 => 'N' ,Argument4 => 'N' ,Argument5 => 'N' ); COMMIT; fnd_file.put_line (fnd_file.LOG,'request_id::'||request_id||'::'||lc_phase_code);

--******************************************** -- Wait for the concurrent program to complete --******************************************** lb_wait := FND_CONCURRENT.WAIT_FOR_REQUEST ( request_id => request_id , INTERVAL => 5 , phase => lc_phase , status => lc_status , dev_phase => lc_devpha , dev_status => lc_devsta , message => lc_mesg ); fnd_file.put_line (fnd_file.LOG,'lc_status::'||lc_status); COMMIT;

fnd_file.put_line (fnd_file.LOG,'v_segment1::'||v_segment1); BEGIN SELECT vendor_id INTO v_vendor_id FROM po_vendors where segment1 = v_segment1;

INSERT into ap_supplier_sites_int (vendor_interface_id ,vendor_site_interface_id , last_update_date ,last_updated_by ,vendor_id ,vendor_site_code ,last_update_login ,creation_date ,created_by -- ,purchasing_site_flag --,rfq_only_site_flag ,pay_site_flag -- ,attention_ar_flag ,address_line1 ,address_line2 ,city ,state ,zip ,country ,ship_to_location_id ,bill_to_location_id ,ship_via_lookup_code ,freight_terms_lookup_code ,fob_lookup_code ,payment_method_lookup_code ,terms_date_basis ,accts_pay_code_combination_id ,prepay_code_combination_id ,pay_group_lookup_code ,payment_priority ,terms_id ,pay_date_basis_lookup_code ,always_take_disc_flag ,invoice_currency_code ,payment_currency_code ,hold_all_payments_flag ,hold_future_payments_flag

-- ,hold_unmatched_invoices_flag -- ,ap_tax_rounding_rule ,auto_tax_calc_flag ,auto_tax_calc_override ,amount_includes_tax_flag -- ,exclusive_payment_flag -- ,tax_reporting_site_flag -- ,attribute11 -- ,validation_number ,org_id -- ,allow_awt_flag ,match_option ,status) VALUES (AP_SUPPLIERS_INT_S.currval ,AP_SUPPLIER_SITES_INT_S.nextval ,v_last_update_date ,v_last_updated_by ,v_vendor_id--PO_VENDORS_S.CURRVAL ,v_vendor_site_code ,v_last_update_login ,v_creation_date ,v_created_by -- ,v_purchasing_site_flag -- ,v_rfq_only_site_flag ,v_pay_site_flag -- ,v_attention_ar_flag ,trim(upper(v_address_line1)) ,trim(upper(v_address_line2)) ,trim(upper(v_city)) ,trim(upper(v_state)) ,v_zip ,v_country -,decode(upper(p_country),'USA','US','UNITED STATES','US','','US','CANADA','CA','MEXICO','MX','') ,v_ship_to_location_id ,v_bill_to_location_id ,v_ship_via_lookup_code ,v_freight_terms_lookup_code ,v_fob_lookup_code ,v_payment_method_lookup_code ,v_terms_date_basis ,v_accts_pay_ccid ,v_prepay_ccid ,v_pay_group_lookup_code ,v_payment_priority ,v_terms_id ,v_pay_date_basis_lookup_code ,v_always_take_disc_flag

,v_invoice_currency_code ,v_payment_currency_code ,v_hold_all_payments_flag ,v_hold_future_payments_flag -- ,v_hold_unmatched_invoices_flag -- ,v_ap_tax_rounding_rule ,v_auto_tax_calc_flag ,v_auto_tax_calc_override ,v_amount_includes_tax_flag -- ,v_exclusive_payment_flag -- ,v_tax_reporting_site_flag -- ,v_attribute11 -- ,v_validation_number ,v_org_id -- ,v_allow_awt_flag ,v_match_option ,'NEW'); fnd_file.put_line (fnd_file.LOG,'SIX::'||SQL%ROWCOUNT);

--******************************* -- Calling Supplier Site Import Program --******************************* request_id:= FND_REQUEST.SUBMIT_REQUEST (Application => 'SQLAP' ,Program => 'APXSSIMP' ,Description => NULL ,Start_time => SYSDATE ,Sub_Request => FALSE ,Argument1 => 'ALL' ,Argument2 => 1000 ,Argument3 => 'N' ,Argument4 => 'N' ,Argument5 => 'N' ); COMMIT; fnd_file.put_line (fnd_file.LOG,'request_id::'||request_id||'::'||lc_phase_code_one); --******************************************** -- Wait for the concurrent program to complete --******************************************** lb_wait := FND_CONCURRENT.WAIT_FOR_REQUEST ( request_id => request_id , INTERVAL => 5 , phase => lc_phase

, status => lc_status , dev_phase => lc_devpha , dev_status => lc_devsta , message => lc_mesg ); COMMIT;

You might also like