R12 Payables Supplier Creation

By Jag - March 01, 2014
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. vendor_interface_id (AP_SUPPLIERS_INT_S.nextval)
    2. status as 'NEW'
    3. 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. vendor_site_interface_id (AP_SUPPLIER_SITES_INT_S.nextval)
    2. vendor_interface_id (AP_SUPPLIERS_INT_S.currval)
    3. Vendor_id: Use the vendor_id created in Step 2 (Supplier Import Program).
    4. Status as 'NEW'
    5. Org_id
    6. Vendor_Site_Code
    7. pay_site_flag as 'Y' else will throw error in the Import Program (The site is not a Pay Site erro

  1. Its not a mandatory step:Insert records in the supplier contact table i.e. AP_SUP_SITE_CONTACT_INT with mandatory columns like 
    1. vendor_interface_id (AP_SUPPLIERS_INT_S.currval)
    2. vendor_site_interface_id (AP_SUPPLIER_SITES_INT_S.currval)
    3. vendor_contact_interface_id (AP_SUP_SITE_CONTACT_INT_S.nextval) 
    4. LAST_NAME: Else will throw error in the import program.
    5. vendor_id
  2. 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.
  3. Run the Standard supplier site import program i.e. "Supplier Sites Open Interface Import".This will create supplier site for above vendor_id.
  4. 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;     

Additional Information:::::


Vendor conversion program will load the Supplier Master, Sites and Contacts data from data files to the staging tables, validate the data and then load the data into Interface tables, finally Validated data will import into Oracle Supplier Standard Tables by using Oracle Standard Supplier Import Programs.
Pre-requisites setup’s are: Payment terms, Pay Groups, CCID, Supplier classifications, Bank Accounts , Employees (if employees have to set up as vendors).
The Interface Tables are:
  • AP_SUPPLIERS_INT
  • AP_SUPPLIER_SITES_INT
  • AP_SUP_SITE_CONTACT_INT
This is the open interface table for AP Suppliers. It holds Supplier information which is loaded by the user for import. The columns in the table map to corresponding columns in the PO_VENDORS table. The Oracle Payables application uses this information to create a new Supplier record when the Supplier Open Interface Import program is submitted. Each row in the table will be identified by a unique identifier, the VENDOR_INTERFACE_ID.
Mandatory Columns:
  • VENDOR_INTERFACE_ID (ap_suppliers_int_s.NEXTVAL)- Supplier interface record unique identifier
  • VENDOR_NAME – Supplier name
Other important columns:
  • SEGMENT1 – Supplier Number
  • VENDOR_TYPE_LOOKUP_CODE – Supplier type
  • SHIP_TO_LOCATION_CODE – Default ship-to-location name
  • BILL_TO_LOCATION_CODE – Default bill-to-location name
  • TERMS_NAME – Payment terms name
  • TAX_VERIFICATION_DATE – Tax verification date(1099)
  • VAT_REGISTRATION_NUM – Tax registration number
  • ATTRIBUTE1 -15 – Descriptive Flexfield Segments
  • PAY_GROUP_LOOKUP_CODE – Payment group type
  • INVOICE_CURRENCY_CODE – Default currency unique identifier
  • PAYMENT_CURRENCY_CODE – Default payment currency unique identifier
  • NUM_1099 – Tax identification number (1099)
  • VAT_CODE – Default invoice tax code
  • HOLD_FLAG – Indicates whether or not the supplier is on purchasing hold
  • SUMMARY_FLAG – Key flexfield summary flag
  • ENABLED_FLAG – Key flexfield enable flag
  • EMPLOYEE_ID – Employee unique identifier if supplier is an employee
AP_SUPPLIER_SITES_INT:
This is the open interface table for AP Supplier Sites. It holds Supplier Site information which is loaded by the user for import. The columns in the table map to corresponding columns in PO_VENDOR_SITES_ALL table. The Oracle Payables application uses this information to create a new Supplier Site record when the Supplier Sites Open Interface Import program is submitted. Each row in the table will be joined to the appropriate Supplier using the VENDOR_ID column.
Mandatory Columns:
  • VENDOR_SITE_INTERFACE_ID (ap_supplier_sites_int_s.NEXTVAL) – Supplier Site interface record unique identifier
  • VENDOR_SITE_CODE – Supplier Site name
Other important columns:
  • ADDRESS_LINE1 – First line of supplier address
  • ADDRESS_LINE2 – Second line of supplier address
  • ADDRESS_LINE3 – Third line of supplier address
  • CITY – City name
  • STATE – State name or abbreviation
  • ZIP – Postal code
  • COUNTRY – Country name
  • PHONE – Phone number
  • FAX – Supplier site facsimile number
  • SHIP_TO_LOCATION_CODE – Default ship-to-location name
  • BILL_TO_LOCATION_CODE – Default bill-to-location name
  • PAYMENT_METHOD_LOOKUP_CODE – Default payment method type
  • VAT_CODE – Invoice default tax code
  • PAY_GROUP_LOOKUP_CODE – Payment group type
  • TERMS_NAME – Payment terms name
  • INVOICE_CURRENCY_CODE – Default currency unique identifier
  • PAYMENT_CURRENCY_CODE – Default payment currency unique identifier
  • EMAIL_ADDRESS – E-mail address of the supplier contact
  • PURCHASING_SITE_FLAG – Indicates whether purchasing is allowed from this site
  • AUTO_TAX_CALC_FLAG – Level of automatic tax calculation for supplier
  • HOLD_ALL_PAYMENTS_FLAG – Indicates if Oracle Payables should place payments for this supplier on hold
AP_SUP_SITE_CONTACT_INT:
This is the open interface table for AP Supplier Site Contacts. It holds Supplier contact data. The columns in the table map to corresponding columns in PO_VENDOR_CONTACTS table. The Oracle Payables application uses this information to create a new Supplier Contact record when the Supplier Sites Open Interface Import program is submitted. Each row in the table will be joined to the appropriate Supplier Site using the VENDOR_SITE_CODE  and ORG_ID.
Mandatory Columns:
  • VENDOR_INTERFACE_ID – Supplier interface record unique identifier
  • VENDOR_CONTACT_INTERFACE_ID (AP_SUP_SITE_CONTACT_INT_S.NEXTVAL) – Vendor Contact Interface Identifier
  • VENDOR_SITE_CODE – Supplier Site name
  • FIRST_NAME – Contact First name
  • LAST_NAME – Contact last name
  • AREA_CODE – Area code of contact phone number
  • PHONE – Contact phone number
  • FIRST_NAME_ALT – Alternate Supplier contact first name
  • LAST_NAME_ALT – Alternate Supplier contact last name
  • EMAIL_ADDRESS – Email address for the Supplier Site contact
  • FAX – Facsimile number for the Supplier Site contact
  • VENDOR_ID – Supplier unique identifier
Validations:
  • Vendor Number (Check for duplicate records in ap_suppliers table)
  • Vendor Name (Check for duplicate records in staging as well as in ap_suppliers table)
  • Terms Name (Check for proper record in ap_terms_tl table)
  • Pay Group (Check for proper record in fnd_lookup_values_vl table where lookup_type = ‘PAY GROUP’)
  • Employee Id (Check for proper employee record in per_all_people_f table)
  • Vendor Type (Check for proper record in po_lookup_codes table where lookup_type = ‘VENDOR TYPE’)
  • Vendor Site Code (Check for duplicate records in ap_supplier_sites_all table)
  • Country Code ( Check for proper country code in fnd_territories_vl table)
  • Payment Method (Check for proper payment method in iby_payment_methods_vl table)
Interface programs:
  1. Supplier Open Interface Import
  2. Supplier Sites Open Interface Import
  3. Supplier Site Contacts Open Interface Import
The data inserted via these interfaces are automatically populated into TCA tables.
Note: AP_SUPPLIER_INT_REJECTIONS table contains suppliers, sites, contacts rejections information.
  • Share:

You Might Also Like

0 comments