Objective: The primary objective of this post is to understand why and how to import data into Oracle Applications in order to create Payables Invoices.
As one can understand the difference between a conversion process and an Interface – A conversion process is conducted once during a cycle to import legacy data into the Oracle, whereas an Interface is used on a daily basis to import external data into Oracle.
Many a times, users are given the task of importing external data into Oracle and create AP Invoices. Invoice data comes from sources including:
- EDI invoices from your suppliers that you load through Oracle e-Commerce Gateway.
- Supplier invoices that you transfer through the Oracle XML Gateway.
- Invoices that you load using Oracle SQL*Loader lease invoices from Oracle Property Manager.
- Lease payments from Oracle Assets, credit card transaction data that you load using the Credit Card Invoice Interface Summary.
- Invoices that you enter through the Invoice Gateway.
An Interface process goes through the following stages. A brief overview of the process is as below.
Step1: Loading into Staging table
Also, the inbound data can be loaded into the staging table in either of the following ways:
- Interfaced into the staging table using middleware technologies like webmethods or SOA.
- The data can be created and placed in a csv file and can be loaded into the staging table using SQL Loader. (Please check my sql loader tutorial for understanding this process).
Usually the data and the staging tables are designed in such a way that one row in the staging table has all the header and Line Information associated with the Payables Invoice. Also, the staging table is designed in such a way that it mimics the columns in the AP Invoice Header and Line tables. (AP_INVOICES_ALL and AP_INVOICE_LINES_ALL) tables.
Step 2: Validating Staging table
Once, the data is placed in the staging table, the data here goes through validation. Some of the basic validations that are required for AP Invoice Interface are:
- Validate Invoice Number.
- Validate Vendor Name.
- Validate Vendor Number
- Validate Invoice Type
- Validate Invoice Amount
- Validate Payment Terms.
- Validate Payment Method.
- Validate GL Date.
- Validate Payment Reason Code.
- Validate Line Type.
- Validate Sum of Line Amount
- Validate POET (Project, Organization, Expenditure, Task).
- Validate Tax Code.
- Validate Operating Unit.
- Validate Exchange Rate.
- Validate Exchange Type.
- Validate Bank Account.
- Validate Tax Location and Tax Code.
And depending on the data / columns in the staging table – more validations may be required based on the current requirement.
During the validation process, each record in the staging table is marked either as a Processed record or a failed record, depending on whether the record passed validation or not.
If the record fails validation, then the corresponding process_flag (or whatever the name of the column that you give) column in the staging table is marked as E (error). Else, if the record passes validation, then the process_flag for that record is marked as V (Validated)
Step 3: Loading into Interface Table.
All the records from the staging table that has the process_flag as ‘V‘ are then inserted into the Interface tables.
All the Header information from the staging table is passed to AP_Invoices_Interface table and all the Line Information is passed to AP_Invoice_lines_interface table.
Some of the important columns that have to be populated in the Interface tables are:
AP_INVOICES_INTERFACE:
INVOICE_ID | Invoice identifier. Must be unique. |
INVOICE_NUM | Supplier invoice number. Validation: must be unique for the supplier site. |
INVOICE_TYPE_LOOKUP_CODE | Type of invoice. Use the Manage Payables Lookups task, lookup type INVOICE TYPE to identify valid values. |
INVOICE_DATE | Invoice date used to calculate due date per payment terms. Date format: YYYY/MM/DD. |
PO_NUMBER | Document number used to request a seller supply a product or service for payment. Use the Manage Purchase Orders task to identify valid values. |
VENDOR_ID | Supplier identifier. If the identifier is not available, use the VENDOR_NAME column. Validated against POZ_SUPPLIERS.VENDOR_ID. |
VENDOR_NUM | Unique number to identify a supplier. Use the Manage Suppliers task to identify valid values. |
VENDOR_NAME | Supplier name. Use the Manage Suppliers task to identify valid values. |
VENDOR_SITE_ID | Supplier site identifier. If the identifier is not available, use the VENDOR_SITE_CODE column. Validated against POZ_SUPPLIER_SITES_ALL.VENDOR_SITE_ID. |
VENDOR_SITE_CODE | Physical location of the supplier. Use the Manage Suppliers task to identify valid values. |
INVOICE_AMOUNT | Invoice amount in transaction currency. Should be positive for standard and prepayment invoices. Should be negative for credit memos. |
INVOICE_CURRENCY_CODE | Currency of invoice. Use the Manage Currencies task to identify valid values. Use the three character ISO currency code. Example: US Dollars is USD. |
EXCHANGE_RATE | Exchange rate used for foreign currency invoices. User entered conversion rate. Not validated. |
EXCHANGE_RATE_TYPE | Exchange rate type for foreign currency invoices. Use the Manage Conversion Rate Types task to identify valid values. Validated against GL_DAILY_CONVERSION_TYPES.CONVERSION_TYPE. |
EXCHANGE_DATE | Date exchange rate is effective. Usually the accounting date of the transaction. Date format: YYYY/MM/DD. |
TERMS_ID | Payment terms identifier. If the identifier is not available, use the TERMS_NAME column. Validated against AP_TERMS_TL.TERM_ID. |
TERMS_NAME | Name of payment term for an invoice. Use the Manage Payment Terms task to identify valid values. |
DESCRIPTION | Invoice description. Free text field. Not validated. |
AP_INVOICE_LINES_INTERFACE:
INVOICE_ID | Invoice identifier. Must be unique. |
INVOICE_LINE_ID | Unique number for each invoice line of an invoice. If NULL, populated by AP_INVOICE_LINES_INTERFACE_S sequence. |
LINE_NUMBER | Invoice line number. Must be a positive integer. Must be unique per invoice. |
LINE_TYPE_LOOKUP_CODE | Type of invoice line. Use the Manage Payables Lookups task, lookup type INVOICE LINE TYPE to identify valid values. |
LINE_GROUP_NUMBER | Line group number. Used to prorate charges across a group of lines. Must be a positive integer. |
AMOUNT | Amount of the invoice line. Validated against the invoice type. Example: standard invoices must have positive amounts. Amount precision is validated against the currency. |
ACCOUNTING_DATE | Date when the invoice line is to be accounted. Date format: YYYY/MM/DD. |
DESCRIPTION | Description of the invoice line. Free text field. Not validated. |
Step 4: Submit Standard Program.
Once the data is inserted into the Interface table, submit the “Payables Open Interface Import” standard import program to import the Interface data and create the Payables Invoices.
l_request_id := FND_REQUEST.SUBMIT_REQUEST ( application => application_short_name , program => 'APXIIMPT' , description => NULL , start_time => SYSDATE , sub_request => FALSE , argument1 => org_id , argument2 => p_source , argument3 => NULL , argument4 => NULL , argument5 => NULL , argument6 => NULL , argument7 => NULL , argument8 => NULL , argument9 => NULL , argument10 => NULL -- Debug Flag , argument11 => NULL , argument12 => NULL , argument13 => NULL --g_user_id , argument14 => NULL --g_login_id
Step 5: Error Handling in Interface tables.
When data is being migrated from Interface tables to the base tables in the above step – some of the data in the Interface tables may get into error and will not be used to create the Invoices. These records can be found in the AP_INTERFACE_REJECTIONS table.
The join between the AP_Interface_Rejections and the two Interface tables is:
select air.reject_lookup_code, air.* from ap_interface_rejections air ,ap_invoices_interface ait where air.parent_id = ait.invoice_id and air.parent_table = 'AP_INVOICES_INTERFACE'
select air.reject_lookup_code, air.* from ap_interface_rejections air ,ap_invoice_lines_interface ail where air.parent_id = ail.invoice_line_id and air.parent_table = 'AP_INVOICE_LINES_INTERFACE'
Step 6: Verify the created Invoices
Login into Oracle Applications and navigate to Payables Superuser to query the created Invoices from the front end application and in the following base tables:
select * from ap_invoices_all select * from ap_invoice_lines_all
Thanks very nice blog!
Nice Article..Really helpful to understand the Data migration process in detailed and very simple language..thanks Alot..