Case Study: Migration of AP
Invoices using Open Interface
Author: Chandan A Kumar
Creation Date: Mar 09, 2009
Last Updated: Aug 06, 2013
Approvals:
Copy Number _____
Aug 06, 2013
Document Control
Change Record
1
Date Author Version Change Reference
Reviewers
Name Position
Distribution
Copy No. Name Location
1
Library Master Project Library
2 Project Manager
3
4
Note To Holders:
If you receive an electronic copy of this document and print it out, please write
your name on the equivalent of the cover page, for document control purposes.
If you receive a hard copy of this document, please write your name on the front
cover, for document control purposes.
Error Handling 25 of 26
Case Study: Migration of AP Invoices using Open Interface
File Ref: [Link]
Aug 06, 2013
Contents
Document Control..............................................................................................ii
Introduction........................................................................................................1
Purpose.........................................................................................................1
Background..................................................................................................1
Scope and Application..................................................................................1
Audience.......................................................................................................2
Source system..............................................................................................2
Assumptions.................................................................................................2
Pre-Requisites..............................................................................................3
Data Dependencies.......................................................................................3
Business Rules...........................................................................................3
Approach......................................................................................................4
Module List........................................................................................................5
Registering Concurrent Program........................................................................9
Downloading Concurrent Program Script........................................................18
Deployment......................................................................................................19
Extract File Layout...........................................................................................20
Extract File Mapping to Staging Table Columns..............................................21
Calling Custom Concurrent Program...............................................................22
Calling Standard Import Concurrent Program.................................................23
Query interface records....................................................................................24
Error Handling.................................................................................................25
Open and Closed Issues for this Deliverable....................................................26
Open Issues................................................................................................26
Closed Issues..............................................................................................26
Error Handling 25 of 26
Case Study: Migration of AP Invoices using Open Interface
File Ref: [Link]
Introduction
The AP Invoice has been designed to assist the accounts payable department in
the organization of vendor invoices for approval and payment. It can be of
Standard, Credit Memo, and Debit Memo, PrePayment, Expense Report etc.
Use the Payables Invoice window to enter the standard invoices, debit memos,
credit memos, Expense Report etc. You can also query and update supplier
invoices in this window.
To enter or query an AP Invoices from front end navigate to Payables
Responsibility, Select Invoice -> Entry -> Invoices .
This document demonstrates the use of open interface table for AP Invocies to
migrate AP Invoices from source system to Oracle Applications.
Purpose
This document describes the:
This case study is intended to demonstrate the creation of Standard
Invoices Using Oracle Payables Interface table.
Detailed data mapping from the source system(s) to the Oracle
Applications E-Business Suite (EBS) Payables (AP) Transactions
records
File layout to be used for interface.
Approach and technical design for the interface
Background
This case study document is designed to demonstrate a practical scenario that
occurs during implementation of oracle Payables.
Scope and Application
The following boundaries are specific to the Interfaces of AP Invoices
using AP_INVOICES_INTERFACE and AP_INVOICE_LINES_INTERFACE
open interface table
All Invoices, Credit & Debit Memos would be migrated to Oracle
Applications
Error Handling 25 of 26
File Ref: [Link]
The ‘XX<EMPID>: AP Invoice Interface Program’ uploads AP
Invoices data from data file into staging table
“XXAR_INVOICE_IFACE_STG” and will perform validation and
transfer valid records into Oracle Payables interface tables. The
standard import program ‘Payables Open Interface Import’ is then
run to perform the validation on data in the interface table and load
valid data into base tables.
1. The AP Invoices data will be provided through data files.
This data file will be loaded into staging table(s) on the
Oracle applications database using loader program.
2. The loaded data will be validated from staging tables and
then moved into the standard transaction interface tables.
3. The standard Payables Open Interface Import program will
be called to import the invoices from Interface table to
Oracle payables base tables.
Audience
This document is intended for the following individuals:
This document should be used for demonstration purposes only.
Source system
The implementation team studies the source system and understands the data
required to be migrated to Oracle Applications. This data is then extracted and
cleansed from the source system (this is done by IT team of source system) in
the format as agreed by the client, source system IT team and the
implementation team. The data mapping section describes the data format of
source system to Oracle Applications.
Assumptions
This case study document is based on the following assumptions:
Users have access to Oracle Applications for the following responsibility.
Payable Manager
System Administrator
Users have access to Oracle Applications server access with write
privilege.
Users have access to Oracle Applications database (apps schema)
Error Handling 25 of 26
File Ref: [Link]
All the functional setups and master data (as listed in pre-requisites) are
already completed in Oracle Applications.
The extract-file layout must be in the format as specified in the extract
file layout section
Pre-Requisites
Prerequisite set-ups are required for the interface. These setups include,
but are not limited to:
1. Payables System Options
2. Payment Terms
3. Invoice Lookup Types
4. Invoice Sources
5. Distribution Set Rules (Must be setup a distribution set for PUB)
6. Currency
7. System Profile Options for Oracle Payables
8. Tax Codes and Rates
Data Dependencies
AP Invoices
In order to migrate AP Invoices the following entities must have been migrated
successfully:
Suppliers
Source Extract Data Upload Data Staging Table Create
Applications files
PL/SQL
Business Rules
Package
Following business rules are applicable for the AP Invoices conversion process.
N/A
AP Interface Call custom conc Register package as
Call Standard
Table program for validation conc program
import Program
Approach
Error Handling 25 of 26
File Ref: [Link]
Affected base tables Oracle Apps
The Approach for migrating AP Invoices data from source system to Payables
open interface table
1. Extract the data file from source system
2. Load the data file into staging table
3. Using PL/SQL write a package
4. Register the PL/SQL package as concurrent program in Oracle
Applications
5. Call the custom concurrent program for validation and loading the
records available in staging table to open interface table
6. Call the standard import program, which will create the records in
AP_INVOICES_ALL, AP_INVOICE_LINES_ALL and
AP_INVOICE_DISTRIBUTIONS_ALL tables based on open interface
records.
7. Query the records, which got created for interface table and see the
result in Oracle Applications front end.
Error Handling 25 of 26
File Ref: [Link]
Module List
Concurrent Programs
‘XX<EMPID>: AP Invoices Interface Program’ includes the following
concurrent programs:
‘XX<EMPID>: AP Invoices Interface Program’
The ‘XX<EMPID>: AP Invoices Interface Program’ concurrent
program is based on the stored procedure
XXINT_AP_INVOICE_PKG.main that is registered as a PL/SQL
executable.
The above program calls loader program (XX<EMPID>: AP
Invoices Interface Loader Program) to load data into staging
tables, performs validations on the staging table data and uploads
data into the open interface tables (AP_INVOICES_INTERFACE and
AP_INVOICE_LINES_INTERFACE ).
‘XX<EMPID>: AP Invoices Interface Loader Program’
The ‘XX<EMPID>: AP Invoices Interface Loader Program’
concurrent program is based on the SQL* Loader control file, that is
registered as a Loader executable.
The above program loads data from the path specified as parameter
value in loader concurrent program to the staging table.
NOTE:
1. Change the <EMPID> with your Employee ID,
2. Follow the steps for registering concurrent program from Registering
Concurrent Program section.
Stored Procedures
XXINT_AP_INVOICE_PKG package consist the following stored
procedures:
XXINT_AP_INVOICE_PKG.main
This is the main procedure that calls the load, validate, import, print_error
and record_summary procedures.
XXINT_AP_INVOICE_PKG.validate
Error Handling 25 of 26
File Ref: [Link]
This procedure performs the necessary validations on the staging tables.
XXINT_AP_INVOICE_PKG.import
This procedure loads all the valid data from the staging table to Oracle
Invoices interface tables AP_INVOICES_INTERFACE and
AP_INVOICE_LINES_INTERFACE.
XXINT_AP_INVOICE_PKG.print_error
This procedure reports the errored records in the log file.
XXINT_AP_INVOICE_PKG.record_summary
This procedure will display the status of staging table records
NOTE: Please refer the attached documents for Package Specifications and
Package body. Kindly open the attached script in notepad.
XX_AP_INVOICE_PK
[Link]
1. Package Specification:
XX_AP_INVOICE_PK
[Link]
2. Package Body:
Staging Table
XXAP_INVOICE_IFACE_STG table created in database to store records
from source system data file.
NOTE: Please refer the attached script staging table creation. Kindly open the
attached script in notepad.
XX_AP_INVOICE_TA
[Link]
Table Creation Script:
Grant Script
If table and package are created in custom schema then grant the table and
package to APPS schema
NOTE: Please refer the attached script for table and package granting. Kindly
open the attached script in notepad.
Error Handling 25 of 26
File Ref: [Link]
XX_AP_INVOICE_PK
[Link]
1. Package Grant Script:
XX_AP_INVOICE_TA
[Link]
2. Table Grant Script:
Synonym Script
If table and package are created in custom schema then grant the package and
create synonym for table and package in APPS schema
NOTE: Please refer the attached script for table and package synonym. Kindly
open the attached script in notepad.
XX_AP_INVOICE_PK
[Link]
1. Package synonym script:
XX_AP_INVOICE_TA
[Link]
2. Table synonym script:
SQL* Loader Script
SQL*Loader is controlled by its own data definition language, which is kept in
the control file. The control file describes the data to be loaded, the destination
tables of the data and describes the interdependency between the data and the
columns within the tables. Which in-turn used to register as a concurrent
program in Oracle Applications to load the data file into staging table.
NOTE: Please refer the attached SQL* Loader script for loading data file into
staging table. Kindly open the attached script in notepad.
XX_AP_INVOICE_LO
[Link]
1. SQL* Loader Script:
Install Script
Install script contains UNIX Shell Script and will be used to deploy the objects
attached to this document on Oracle Applications Server.
Following are the object to be deployed on server.
Error Handling 25 of 26
File Ref: [Link]
1. Package Specification Script
2. Package Body Script
3. Staging Table Script
4. SQL* Loader Script
NOTE: Please refer the attached Install script for deployment of AP Invoices
object on Oracle Applications Server. Kindly open the attached script in
notepad.
XX_AP_INVOICE.inst
all
1. Install Script:
Note: Please prefix your employee ID for each object you create and deploy in
Application Server and Database.
A.) Package Name
B.) Table Name
C.) Synonym Name
D.) Concurrent Program Executable.
E.) Concurrent Program Name.
Error Handling 25 of 26
File Ref: [Link]
Registering Concurrent Program
Registering Interface Loader Concurrent Program
To register a concurrent program for ‘XX<EMPID>: AP Invoices Interface
Loader Program’ in Oracle Applications Navigate to System Administrator
Responsibility
1. Select Concurrent -> Program -> Executable
2. Enter The Following in the Concurrent Program Executable Form
a. Executable Name: Enter unique name for executable.
b. Short Name: Enter unique short name and this short name later
will be use for defining Concurrent Program.
c. Application: Enter the Application Name from List of Values
(LOV), as we are developing an interface program for AP Invoices
so the Application Name should be Custom Application.
d. Description: Enter the description of Executable
e. Execution Method: Execution method should be SQL*Loader,
because we are registering a concurrent program for loading the
data to staging table.
f. Execution File Name: Here we would be passing the file name of
SQL*Loader control file. As discussed in Module List the control
file name would be XX_AP_INVOICE_LOAD
Error Handling 25 of 26
File Ref: [Link]
Executable Registering Form
3. Select Concurrent -> Program -> Define
Error Handling 25 of 26
File Ref: [Link]
4. Enter The Following in the Concurrent Program Form
a. Program Name: Enter “XX<EMPID>: AP Invoices Interface
Loader Program”
b. Short Name: Enter a unique concurrent program short name, for
example: XXAPINVOICELOAD
c. Application: Select the value from LOV, as we would be executing
this concurrent program from Payables Applications so select
Payables.
d. Description: Enter the description of this concurrent program.
e. Executable Name: Select the executable name from LOV, as we
have already registered an executable for loader program so select
XXAPINVOICELOAD from LOV.
f. Executable Method: Executable method will be populated
automatically.
g. Parameters if any: Select the Parameter Button to specify the
parameter list. In our case there should be two parameters we
would be passing. A). Data File
Concurrent Program Form
Error Handling 25 of 26
File Ref: [Link]
Concurrent Program Parameters Form
Registering Interface Concurrent Program
To register a concurrent program for ‘XX<EMPID>: AP Invoices Interface
Program’ in Oracle Applications Navigate to System Administrator
Responsibility
1. Select Concurrent -> Program -> Executable
Error Handling 25 of 26
File Ref: [Link]
2 Enter The Following in the Concurrent Program Executable Form
a. Executable Name: Enter unique name for executable.
b. Short Name: Enter unique short name and this short name later
will be use for defining Concurrent Program.
c. Application: Enter the Application Name from List of Values
(LOV), as we are developing an interface program for AP Invoices
so the Application Name should be Custom Application.
d. Description: Enter the description of Executable
e. Execution Method: Execution method should be PL/SQL Stored
Procedure.
f. Execution File Name: Here we would be passing the package
name with one public procedure. As discussed in Module List the
package name would be XXINT_AP_INVOICE_PKG and the
public procedure define in this package is main.
Concurrent Program Executable Form
Error Handling 25 of 26
File Ref: [Link]
3. Select Concurrent -> Program -> Define
4. Enter The Following in the Concurrent Program Form
a. Program Name: Enter “XX<EMPID>: AP Invoices Interface
Program”
b. Short Name: Enter a unique concurrent program short name, for
example: XXAPINVOICEMAIN
c. Application: Select the value from LOV, as we would be executing
this concurrent program from Payables Applications so select
Custom Development and add this concurrent program to the
Payables Request Group.
d. Description: Enter the description of this concurrent program.
e. Executable Name: Select the executable name from LOV, as we
have already registered an executable for loader program so select
XXAPINVOICEMAIN from LOV.
f. Executable Method: Executable method will be populated
automatically.
g. Parameters if any: Select the Parameter Button to specify the
parameter list. In our case there should be two parameters we
would be passing. A) Data File Path B) Data File Name
Error Handling 25 of 26
File Ref: [Link]
Concurrent Program Form
Concurrent Program Parameters Form
Error Handling 25 of 26
File Ref: [Link]
Registering Interface Concurrent Program in Request Group
To register a concurrent program ‘XX<EMPID>: AP Invoices Interface
Program’ in Request Group, Navigate to System Administrator
Responsibility
1. Select Security -> Responsibility-> Request
Error Handling 25 of 26
File Ref: [Link]
2. Query the Request Group – All Reports and Applications as Payables
Request Group Form
3. Add an entry for Concurrent Program in the Request Group and save the
work.
Request Group Form
Error Handling 25 of 26
File Ref: [Link]
Downloading Concurrent Program Script
After completion of Registering Concurrent program in System Administrator
responsibility, we can download the script for concurrent program and further
it can be used to install in another Application Server.
Before downloading the script of Concurrent Program, connect your local
system to Applications Server
Run the Following Command to download the script
FNDLOAD <Apps User/Apps Pwd> 0 Y DOWNLOAD
$FND_TOP/patch/115/import/[Link] <File_Name.ldt> PROGRAM
CONCURRENT_PROGRAM_NAME=<Concurrent_Program_Short_Name>
For Example:
To Download the “XX<EMPID>: AP Invoices Interface Loader
Program” script please enter the below command at unix/linux
prompt.
FNDLOAD apps/apps 0 Y DOWNLOAD
$FND_TOP/patch/115/import/[Link] [Link]
PROGRAM CONCURRENT_PROGRAM_NAME =
XXAPINVOICELOAD
To Download the “XX<EMPID>: AP Invoices Interface Program”
script please enter the below command at unix/linux prompt.
FNDLOAD apps/apps 0 Y DOWNLOAD
$FND_TOP/patch/115/import/[Link] [Link]
PROGRAM CONCURRENT_PROGRAM_NAME =
XXAPINVOICEMAIN
Error Handling 25 of 26
File Ref: [Link]
Deployment
To deploy the attached zip file which contains package, table scripts, grant
script, synonym script, concurrent program script and install script, please
follow the below steps
[Link]
1. Save the attached zip file in local system
2. Transfer the zip to the Oracle Applications Server
3. Create a Staging Directory [E.g. XXAPINTOIT] in temporary area
on Oracle Application Server.
4. mkdir -p XXAPINTOIT
5. Change the Permissions on the temp directory.
6. chmod 755 XXAPINTOIT
7. FTP the [Link] file in BINARY mode to directory
XXAPINTOIT
8. Change directory to XXAPINTOIT as given below
9. cd XXAPINTOIT
10. Uncompress [Link] as given below
11. gunzip [Link]
12. Untar the file [Link] using
13. tar -xvf [Link]
14. Grant the execute permission on the install script using
15. chmod 755 XX_AP_INVOICE.install
16. Run XX_AP_INVOICE.install
17. sh XX_AP_INVOICE.install
18. Enter the apps schema user name password (apps/
<apps_pwd>), when asked for.
Error Handling 25 of 26
File Ref: [Link]
Extract File Layout
Please find the attached extract file for AP Invoices.
AP_INVOICE_SAMPL
E_DATA.csv
Note: Please remove the header row before putting the same file on Oracle
Application Server for loading purpose.
Below is the example of extract file for AP Invoices
Error Handling 25 of 26
File Ref: [Link]
Extract File Mapping to Staging Table Columns
Data File Columns Datatype Size Staging Table’s Columns
Invoice_type Varchar2 50 Invoice_type
Invoice_num Varchar2 20 Invoice_num
Curr_code Varchar2 20 Curr_code
Vendor_number Varchar2 30 Vendor_number
Vendor_site Varchar2 30 Vendor_site
Payment_term Varchar2 10 Payment_term
Line_number Varchar2 10 Line_number
Description Varchar2 250 Description
Header_amount Number Header_amount
Line_amount Number Line_amount
Source Varchar2 100 Source
Distribution_set_name Varchar2 100 Distribution_set_name
Error Handling 25 of 26
File Ref: [Link]
Calling Custom Concurrent Program
After installation of all the script attached with this document run the
concurrent program “XX<EMPID>: AP Invoices Interface Program”. To run
the concurrent program navigate to Payables Responsibility.
Select View Menu -> Request, Submit a new request, and click on single
request and than click OK Button.
SRS Form
1. Select the Concurrent Program name from LOV
2. Enter the parameter value for Data File Path and Data File Name.
3. Click on Submit Button to run the request.
Error Handling 25 of 26
File Ref: [Link]
Calling Standard Import Concurrent Program
When “XX<EMPID>: AP Invoices Interface Program” completed
successfully, run the standard import program to populate the data from AP
Transaction Interface Table (RA_INTERFACE_LINES_ALL) to Payables
base table.
The standard Import “Payables Open Interface Import” program will fetch the
data from interface table and populate it into the Payables base tables.
Call the “Payables Open Interface Import” Program with the following
Parameters
a. Transaction Source: Test
b. Default Date: Sysdate
c. Base Due Date on Trx Date: No
Error Handling 25 of 26
File Ref: [Link]
Query interface records
When “Payables Open Interface Import” standard import program completes
successfully navigates to Payables Responsibility, Select Invoices -> Entry
-> Invoices and queries the records of interface table.
AP Transaction Form
Error Handling 25 of 26
File Ref: [Link]
Error Handling
Following error can occur while processing the AP Transaction data file?
1. During loading data into staging table.
o When error occurred while loading the data file using
SQL*Loader concurrent program it generates two files they are
SQL*Loader Bad File: The bad file contains
records that weren't loaded into the staging table. These
records could have been rejected by SQL*Loader due to
an invalid format. Also they could have been rejected by
the Oracle database if they violate an integrity constraint
or had an invalid data type for the staging table.
SQL*Loader Log File: Detailed information about
the load is stored in the log file. Any errors found during
parsing of the control file are stored in the log file. The
log file also identifies the number of records successfully
loaded. The log file must be available during the entire
run of the SQL*Loader. When loading data with
SQL*Loader, nothing should be assumed without
reviewing the log files
2. Validating the records in staging table
o While validating the data in staging table it can complete with
error and the concurrent program will complete with warning,
in this case look into the output report of concurrent program
and correct the data file and re-load it again.
3. While calling the Standard AutoInvoice Import Program
o After populating the records in interface table it again validated
by the standard import program and in few cases it completes
with error or warning, in this case see the output report of
Standard Import Program and correct the data in data file and
re-load it, than re-run the custom concurrent program.
Error Handling 25 of 26
File Ref: [Link]
Open and Closed Issues for this Deliverable
Open Issues
ID Issue Resolution Responsibility Target Date Impact Date
Closed Issues
ID Issue Resolution Responsibility Target Date Impact Date
Error Handling 25 of 26
File Ref: [Link]