0% found this document useful (0 votes)
1K views

Oracle Interface - Oracle EBS R12 End To End Interface Process For Item Import

This document discusses Oracle interfaces, which are used to integrate external systems and transfer data between Oracle Applications and other systems. It describes the components of an interface, including source and destination applications, interface tables, validation, and error handling. The key types of interfaces are inbound interfaces, which transfer data into Oracle Applications, and outbound interfaces, which transfer data out of Oracle Applications. The document provides an overview of the end-to-end interface process, from loading source data into staging tables to validating and importing the data.

Uploaded by

nguoituyet66
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Oracle Interface - Oracle EBS R12 End To End Interface Process For Item Import

This document discusses Oracle interfaces, which are used to integrate external systems and transfer data between Oracle Applications and other systems. It describes the components of an interface, including source and destination applications, interface tables, validation, and error handling. The key types of interfaces are inbound interfaces, which transfer data into Oracle Applications, and outbound interfaces, which transfer data out of Oracle Applications. The document provides an overview of the end-to-end interface process, from loading source data into staging tables to validating and importing the data.

Uploaded by

nguoituyet66
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 68

Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

What are Interfaces?


 Interfaces are used in Oracle Applications to integrate external systems and Data Conversion.
 The interfaces are mainly used to either transfer data from Oracle Applications to a flat file or data from
legacy system to Oracle Applications.
 Used extensively at the time of Data Conversion from legacy/ old systems to a fresh implementation of
Oracle Applications.
 Used also at regular intervals when data transfer is from other live systems if the systems are not defined in
Oracle Applications implementation.
 Oracle provides flexible and flexible tools in the form of Interface programs to import the master and
transactional data like Customers, Invoices, and Sales Orders etc from external systems into Oracle
Applications.

Types of Interfaces
There are two major types of Interfaces:
 Inbound Interface : These interfaces are used to transfer data from external systems to Oracle Applications.
 Outbound Interface : These interfaces are used to transfer data from Oracle Applications to external systems.
 Two other distinctions of Interfaces:
 Open Interface: If the interface logic is provided by Oracle Applications, it is called an Open Interface.
 Custom Interface: If the interface logic needs to be developed by the implementation team, it is called a
Custom Interface.

Interface Components

Open Interface Logic

 First the data from the source application is loaded into a database table (called Interface table).
 Then the provided validation program logic validates the records whether they are correct or not .
 If the validation fails, the errors are transferred into another table (called Error Table).
 If the validation succeeds, the correct records are transferred through a process into the destination application table.

Components of an Interface
a] Source Application:

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

You obtain data from a source application to pass on to a destination application for further processing and/or
storage.

b] Source Data Issues:


Type of file, Size, Frequency of upload, Record Length (Variable or fixed), Delimiter, Datatype for each field, Any
unwanted data, Naming convention and uniqueness of file, Location of the file, Access on the file.

c] Destination Application:
You send data to a destination application so that the application can perform further processing and/or storage.

d] Interface Table:
For inbound interfaces, the interface table is the intermediary table where the data from your source application
temporarily resides until it is validated and processed into the destination application.

e] Identifier columns:
Uniquely identify rows in the interface table provide foreign key reference to both the source and destination
applications.

f] Control Columns:
 Control columns track the status of each row in the interface table, as it is inserted, validated, rejected,
processed, and ultimately deleted.
 WHO columns are also control columns.

g] Data Columns:
 Stores the data that is being converted.
 Required columns store the minimum information needed by the destination application to successfully
process the interface row.

h] Derived Columns:
Derived columns are created by the destination application from information in the required columns.

i] Optional Columns:
Optional columns are not necessarily required by the destination application, but can be used by the destination
application for additional value-added functionality beyond the basics.

j] Error Table:
 For inbound interfaces, the errors table stores all errors found by the validation and processing functions.
 In some cases, the errors table is a child of the interface table. This allows each row in the interface table to
have many errors, so that you can easily manage multiple errors at once.
 In other cases, the errors are stored in a column within the interface table, which requires you to fix each error
independently.

Developing an Interface
1] Identification:
Find out if there exists an Open Interface to carry out the functionality.

2] Creation of Pre-Interface table ( staging Table):


A table in the format of the data file which can be pruned to load as clean a data into the Interface table.

3] Load data into Pre-Interface table:


SQL*LOADER can be used to load the flat file into the pre-interface table.

4] Validate data in the Pre-Interface table:


Basic validation of the data loaded into the Pre-Interface table can be carried out like:
 For checking NULL values in required columns
 Checking for Foreign Key and Quick Code values.
 Duplication Validation

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

 Business Rule validation

5] Mapping the values:


Generated fields in Oracle Applications can be mapped in this step to either default values or sequences.

6] Load data into Interface table:


 Once the data is as clean as you can get it, the data can be inserted into the Interface table.
 At such a time, certain columns, which are necessary in Applications but not found in legacy system, need to
be populated accordingly like WHO columns.

7] Run the interface program


8] Check for Errors
9] Report on the Interface

ABOUT INTERFACES:
In Oracle Apps Interfaces are generally tables, which act as a medium to transfer the data from one module to another
module or to transfer the data from legacy system into Oracle Applications. There are 352 tables provided by the
Oracle Package. Each module has its own Interface Tables.

A typical path to transfer the data from Legacy System to Oracle Apps:

What is Interfacing?
It is the process of converting the records from one format to another format. The main components of this interfacing
are
• Transfer Program
• Interface Table and
• Import Program

A] Transfer Program:
If the source modules data are implemented in Oracle Applications then the Transfer Programs are integrated with the
Package. If the source modules are implemented in external system (i.e. other than Oracle Applications) then we have
to develop our own Transfer Programs. Generally these Transfer Programs are developed using PL/SQL, JAVA or
SQL Loader.

What they do?


 It maps the columns of source table with the columns of Interface Tables.
 It performs Row Level and Column Level validations.
 It transfers the data from Source to the Interface Table.

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

B] Interface Tables:
The Interface tables basically have 4 types of columns.
1. Mandatory Columns.
2. Conditionally Required Columns.
3. Optional Columns.
4. Internal Processing Columns.

Mandatory Columns:
These are the main columns which are required in the destination tables (i.e. Oracle Application Module Tables). With
the help of mandatory columns only the Import Program will converts the records from source to destination.

Conditionally Required Columns:


The values for these columns are based on the values of Mandatory columns. For Example: If you are converting
foreign currency transactions to INR then it as compulsory to provide conditionally required columns like Currency
conversion rate, Conversion Time and Conversion Date.

Optional Columns:
These are used when a client wanted to transfer some additional information from source to destination. These are
based on client’s requirement.

Internal Processing Columns:


Status and Error Message columns are called Internal Processing Columns. These are specific only to Interface Table.
These columns are going to be used by the Import Program to update the status and error message, if the record fails
its validation while importing from Interface Table to the Destination Table.
C] Import Program:
For all Interface Tables, Oracle Application Package is going to provide Import Programs. These are generally
registered with destination modules. These Import Programs are designed using PL/SQL, JAVA, C, C++, etc.

What they do?


 It maps the columns of the Interface Table with one or more columns in the destination table.
 It performs row level and column level validation.
 It imports the data from Interface Table to the Destination tables, if the records validated successfully.
 It deletes all the successfully validated records from Interface Table.
 If the record fails its validation then the Import Program will update the status and error message columns of
Interface Table.

Interface Vs. Application Program Interface (API):


Interfaces are used to transfer the data from legacy system to Oracle Application system where as API is used to
convert the data from one form to another form with in the Oracle Application Module.

Interfaces and conversions procedure


Data can seeded in 3 ways

The Data can be entered using the application Screens.


The data can be entered using Oracle’s Open System Interface.
The data can be stored in the database table directly

Conversion An overview of its process (Inbound Process)


1. Get data from legacy system Called Flat file.
2. Load the flat file data into temporary table called staging table using sqlloader (control files are used .ctl extensions)
3. Validate the data in staging table using pl/sql procedures to define rules of validation.
4. Successful Validation rakes up the data to the interface tables.
5. These Validate data can be directed to base tables using predefined Seeded programs. (Outbound process)

Difference Between Conversion and Interface


1. Conversion is one-time process 1. Interface is the post production which is performed once before process.

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

production go on live.(Pre-production process)


2. Data comes in to Oracle Applications 2. Interface is the integration of only (One way process) two systems.
3. Interative Process 3. Scheduled and repetive process.

Open Interface Tables are standard Oracle tables.


-Oracle uses OITs to provide a simple interface to Oracle base tables.
-Oracle has list of all the open interface that oracle offered in there product.

Interface Program
- It is an inbuilt program in most of the modules to pull up the data from the interface table Under validations sends
data to base tables, if validation fails Displays data to Error a error message

Important Interface Tables


GL INTERFACE TABLES
GL_BUDGET_INTERFACE TABLE
GL_DAILY_RATES_INTERFACE TABLE
GL_IEA_INTERFACE TABLE
GL_INTERFACE TABLE
GL_INTERFACE_CONTROL TABLE
GL_INTERFACE_HISTORY TABLE

AP INTERFACE TABLES
AP_INTERFACE_CONTROLS TABLE
AP_INTERFACE_REJECTIONS TABLE
AP_INVOICES_INTERFACE TABLE
AP_INVOICE_LINES_INTERFACE TABLE

AR INTERFACE TABLES
AR_PAYMENTS_INTERFACE_ALL TABLE
AR_TAX_INTERFACE TABLE
HZ_DQM_SYNC_INTERFACE TABLE
HZ_PARTY_INTERFACE TABLE
HZ_PARTY_INTERFACE_ERRORS TABLE
RA_CUSTOMERS_INTERFACE_ALL TABLE
RA_INTERFACE_DISTRIBUTIONS_ALL TABLE
RA_INTERFACE_ERRORS_ALL TABLE
RA_INTERFACE_LINES_ALL TABLE
RA_INTERFACE_SALESCREDITS_ALL TABLE

FA INTERFACE TABLES
FA_BUDGET_INTERFACE TABLE
FA_INV_INTERFACE TABLE
FA_PRODUCTION_INTERFACE TABLE
FA_TAX_INTERFACE TABLE

INVENTORY INTERFACE TABLES


MTL_CC_ENTRIES_INTERFACE TABLE
MTL_CC_INTERFACE_ERRORS TABLE
MTL_CI_INTERFACE TABLE
MTL_CI_XREFS_INTERFACE TABLE
MTL_COPY_ORG_INTERFACE TABLE
MTL_CROSS_REFERENCES_INTERFACE TABLE
MTL_DEMAND_INTERFACE TABLE
MTL_DESC_ELEM_VAL_INTERFACE TABLE
MTL_EAM_ASSET_NUM_INTERFACE TABLE
MTL_EAM_ATTR_VAL_INTERFACE TABLE
MTL_INTERFACE_ERRORS TABLE

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

MTL_INTERFACE_PROC_CONTROLS TABLE
MTL_ITEM_CATEGORIES_INTERFACE TABLE
MTL_ITEM_CHILD_INFO_INTERFACE TABLE
MTL_ITEM_REVISIONS_INTERFACE TABLE
MTL_ITEM_SUB_INVS_INTERFACE TABLE
MTL_OBJECT_GENEALOGY_INTERFACE TABLE
MTL_RELATED_ITEMS_INTERFACE TABLE
MTL_RESERVATIONS_INTERFACE TABLE
MTL_RTG_ITEM_REVS_INTERFACE TABLE
MTL_SECONDARY_LOCS_INTERFACE TABLE
MTL_SERIAL_NUMBERS_INTERFACE TABLE

MTL_SO_RMA_INTERFACE TABLE
MTL_SYSTEM_ITEMS_INTERFACE TABLE
MTL_TRANSACTIONS_INTERFACE TABLE
MTL_TRANSACTION_LOTS_INTERFACE TABLE
MTL_TXN_COST_DET_INTERFACE TABLE

PO INTERFACE TABLES
PO_DISTRIBUTIONS_INTERFACE TABLE
PO_HEADERS_INTERFACE TABLE
PO_INTERFACE_ERRORS TABLE
PO_LINES_INTERFACE TABLE
PO_REQUISITIONS_INTERFACE_ALL TABLE
PO_REQ_DIST_INTERFACE_ALL TABLE
PO_RESCHEDULE_INTERFACE TABLE
RCV_HEADERS_INTERFACE TABLE
RCV_LOTS_INTERFACE TABLE
RCV_SERIALS_INTERFACE TABLE
RCV_TRANSACTIONS_INTERFACE TABLE

BOM INTERFACE TABLES


BOM_BILL_OF_MTLS_INTERFACE TABLE
BOM_INTERFACE_DELETE_GROUPS TABLE
BOM_INVENTORY_COMPS_INTERFACE TABLE
BOM_OP_RESOURCES_INTERFACE TABLE
BOM_OP_ROUTINGS_INTERFACE TABLE
BOM_OP_SEQUENCES_INTERFACE TABLE
BOM_REF_DESGS_INTERFACE TABLE
BOM_SUB_COMPS_INTERFACE TABLE
CST_COMP_SNAP_INTERFACE TABLE
CST_INTERFACE_ERRORS TABLE
CST_ITEM_COSTS_INTERFACE TABLE
CST_ITEM_CST_DTLS_INTERFACE TABLE
CST_PC_COST_DET_INTERFACE TABLE
CST_PC_ITEM_COST_INTERFACE TABLE

WIP INTERFACE TABLES


WIP_COST_TXN_INTERFACE TABLE
WIP_INTERFACE_ERRORS TABLE
WIP_JOB_DTLS_INTERFACE TABLE
WIP_JOB_SCHEDULE_INTERFACE TABLE
WIP_MOVE_TXN_INTERFACE TABLE
WIP_SCHEDULING_INTERFACE TABLE
WIP_TXN_INTERFACE_ERRORS TABLE

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Single Insert Process for Inventory Item Creation


 Deriving Fields and Validations for Item Creation
 Insert Script for one item
 Verify the Interface table
 Submit Import items program (Interface to Base table)
 Verify the imported record in base table
 Verify the imported item from application

Inventory Item Interface Registration Process


Staging Table Creation
Control File Creation
Folder Structure in Oracle Server(Unix)
Host (Shell Script) File Creation
Soft link Creation
Register the Host file in application (XXAA Inventory Item Load File Program)

Package File Creation


Register the Package in application (XXAA Inventory Item Load Interface Program)

Procedure File Creation


Register the Procedure in application (XXAA Inventory Item Load Interface Report)

Assign the Concurrent Program to Request Group

Inventory Item Interface Execution the Process


Submit the XXAA Inventory Item Load File Program Concurrent Program
Verify the records in staging table
Verify the data file in Archive folder

Submit the XXAA Inventory Item Load Interface Program Concurrent Program
Verify record status in Staging table
Verify the loaded records in interface table

Submit the Import Items Concurrent Program (Standard Program)


Verify the Log report
Verify the Interface error records
Verify the loaded records in base table

Submit the XXAA Inventory Item Load Interface Report Concurrent Program
Verify the staging table record status
Verify the log report
Verify the Output report
Verify the loaded record from application
Verify the records in base table

Scheduling the Inventory Item Interface Process


Create the Request Set
Assign the Request set to Request Group
Schedule the Request set for daily

Migration Scripts for Concurrent Program and Request Set

Inventory Item Load Interface Code Pack list

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Single Insert for Inventory Item Creation

Deriving Fields and Validations for Item Creation


select * from mtl_parameters
where organization_code = 'M1'
and master_organization_id = 204 -- V1 (Master Org Code)
and organization_id = 207 -- M1 (Child Org Code)

select template_id, template_name


from mtl_item_templates
where template_name = 'Finished Good'
and template_id = 107

select unit_of_measure, uom_code primary_uom_code


from mtl_units_of_measure_tl
where unit_of_measure = 'Each'
and primary_uom_code = 'Ea'

select user_id
from fnd_user
where user_name = 'OPERATIONS'
and user_id = 1318

Along with the specific columns, we need to pass the following columns
1.process_flag = '1' (in process)
2.transaction_type = 'CREATE' (in case of creation)
'UPDATE' (in case of updating existing record)
3.set_process_id: used when multiple item open interface processes are run in parallel.
4.standard who columns like created_by, last_updated_by = user_id
and creation_date, last_update_date = sysdate.

Insert Script for one item


INSERT INTO MTL_SYSTEM_ITEMS_INTERFACE
(organization_id,
segment1,
description,
template_id,
primary_uom_code,
transaction_type,
set_process_id,
process_flag,
creation_date,
created_by,
last_update_date,
last_updated_by)
VALUES
(204, -- Master Organization Id
'Raj_Item_01', -- Segment1(Item Name)
'Raj_Item_01', -- Description(Description For The Item)
107, -- Template_Id
'Ea', -- Primary_Uom_Code
'CREATE', -- Transaction_Type
1, -- Set_Process_Id
1, -- Process_Flag
sysdate, -- Creation_Date
1318, -- Created_By
sysdate, -- Last_Update_Date
1318 -- Last_Updated_By
);

COMMIT;

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Verify the Interface table

Submit Import items program (Interface to Base table)


Nav: Inventory, Vision Operations (USA) -->Items -->Import -->Import Items

Select the Org

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Select the Importing parameter values

Verify the imported record in base table


select * from mtl_system_items_b
where 1=1
and segment1 = 'Raj_Item_01';

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Verify the imported item from application


Nav: Inventory, Vision Operations (USA) -->Items -->Master Items

Query with Item Number

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

End to End Inventory Item Interface Process

Staging Table Creation


Create the Staging table based on the Source (3 rd party system) data file fields, derived and who columns
Compile the script in database

CREATE TABLE apps.XXAA_INV_ITEM_LOAD_STG


(
--*****************************************************************
--** Date Developer Version Description
--** ----------- --------------- ------- ---------------
--** 10-Sep-2020 OracleApps88 1.0 Initial version
--*****************************************************************
status_stg VARCHAR2(7)
,transaction_id_stg NUMBER
,ls_item_number VARCHAR2(40)
,ls_description VARCHAR2(240)
,ls_organization_code VARCHAR2(3)
,ls_template_name VARCHAR2(40)
,ls_Pr_Unit_of_Measure VARCHAR2(25)
,ls_item_type VARCHAR2(30)
,ls_cos_account VARCHAR2(160)
,ls_expense_account VARCHAR2(240)
,ls_sales_account VARCHAR2(160)
,organization_id NUMBER
,template_id NUMBER
,inventory_item_id NUMBER
,pr_uom_code VARCHAR2(30)
,coS_account_id NUMBER
,expense_account_ID NUMBER
,sales_account_ID NUMBER
,created_by NUMBER
,creation_date DATE
,ERROR_CODE VARCHAR2(200)
);

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Control File Creation


Prepare the control file to load the data from data file to staging table

Save the file with XXAA_INV_ITEM_LOAD.ctl name


--*****************************************************************
--** Date Developer Version Description
--** ----------- --------------- ------- ---------------
--** 10-Sep-2020 OracleApps88 1.0 Initial version
--*****************************************************************
OPTIONS (SKIP=0)
LOAD DATA
--CHARACTERSET WE8MSWIN1252
INFILE *
APPEND INTO TABLE XXAA_INV_ITEM_LOAD_STG
FIELDS TERMINATED BY "," OPTIONALLY ENCLOSED BY '"'
TRAILING NULLCOLS
(
LS_ITEM_NUMBER "ltrim(rtrim(:LS_ITEM_NUMBER))"
,LS_DESCRIPTION "ltrim(rtrim(:LS_DESCRIPTION))"
,LS_ORGANIZATION_CODE "ltrim(rtrim(:LS_ORGANIZATION_CODE))"
,LS_PR_UNIT_OF_MEASURE "ltrim(rtrim(:LS_PR_UNIT_OF_MEASURE))"
,LS_TEMPLATE_NAME "ltrim(rtrim(:LS_TEMPLATE_NAME))"
,LS_COS_ACCOUNT "ltrim(rtrim(:LS_COS_ACCOUNT))"
,LS_EXPENSE_ACCOUNT "ltrim(rtrim(:LS_EXPENSE_ACCOUNT))"
,LS_SALES_ACCOUNT "ltrim(rtrim(:LS_SALES_ACCOUNT))"
,STATUS_STG CONSTANT "N"
,TRANSACTION_ID_STG SEQUENCE(MAX,1)
)

Upload the Control file into server $XXCUST_TOP/bin location (/u02/E-


BIZ/apps/apps_st/appl/XXCUST/12.0.0/bin) and provide the permission

chmod 777 XXAA_INV*

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Folder Structure in Oracle Server(Unix)


Create the interface folder structure in home directory in oracle server and provide the grant permissions to all
folders
mkdir RAJ
mkdir RAJ/INV
mkdir RAJ/INV/ITEM
mkdir RAJ/INV/ITEM/Archive

chmod 777 RAJ


chmod 777 RAJ/INV
chmod 777 RAJ/INV/ITEM
chmod 777 RAJ/INV/ITEM/Archive

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Host File Creation


Prepare the Host (Shell Script) file to process the below steps
 Connect to 3rd party system using FTP credentials
 Download the data files from 3rd party system into oracle location (File name start with RAJ_INV)
 Run the control command to load the data into staging table
 Send the log and bad files to user with email
 Once the file processed then move the file into Archive folder

Save the file with XXAA_INV_ITEM_LOAD.prog name


# -->:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:
# --> Date By Whom Version Details Of Change
# --> ----------- ------------- ------- ------------------------
# --> 10-Sep-2020 OracleApps88 1.0 Initial Creation
# -->:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:~:
# --> Step 01 : Concurrent program parameter values
ORA_PATH=`echo $0`
ORA_LOGIN=`echo $1`
ORA_USERID=`echo $2`
LOGIN_NAME=`echo $3`
REQUESTID=`echo $4`
# --> Step 01 : User defined Concurrent program parameter values
# -->Source (3rd party system) File Path
SRC_FILE_PATH=`echo $5`
# -->Oracle Application(Unix) server path
ORL_FILE_PATH=`echo $6`
EMAIL=`echo $7`
xdate=`date +_%Y%m%d_%H%M%S`
# --> Step 02 : Control File, Bad and Log file location
controlfile=$XXCUST_TOP/bin/XXAA_INV_ITEM_LOAD.ctl
badfile=$ORL_FILE_PATH/Archive/XXAA_INV_ITEM_LOAD$xdate.bad
logfile=$ORL_FILE_PATH/Archive/XXAA_INV_ITEM_LOAD$xdate.log
# --> Step 03 : Changing to Oracle data file location
cd $ORL_FILE_PATH
# --> Step 04 : Connecting to Source (3rd party system) with FTP credentials
user=XXAAFTP
pwd=Ora458
ftp -nv 164.30.503.629 <<TEST
user $user $pwd
ascii
# --> Step 05 : Changing to Source and Oracle path
lcd $SRC_FILE_PATH
cd $ORL_FILE_PATH
prompt noprompt
# --> Step 06 : Downloading the files from Source (3rd party system) path which are
the file name start with RAJ_INV
mget RAJ_INV*.*
# --> Step 07 : Deleting the downloaded files from Source (3rd party system) path
which are the file name start with RAJ_INV
delete RAJ_INV*.*
# --> Step 08 : Disconnecting the Source (3rd party system)
quit
TEST
echo "Oracle File Path is : "$ORL_FILE_PATH
# --> Step 09 : Data files will be downloaded into Oracle data file location (Refer
Step 03)
echo "Data File is : "$datafile
# --> Step 10 : With sqlldr command loading the data file data into staging table,
# --> If any records are failed load into stage table that will
move to BAD and LOG file
# --> These files created in Step2
datafile= RAJ_INV*.csv

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

sqlldr userid=$ORA_LOGIN control=$controlfile data=$datafile bad=$badfile


log=$logfile
# --> Step 11 : If any record is failed to load int stg table then retcode value will
will be 1
retcode=`echo $?`
#echo "$retcode"
# --> Step 12 : If the retcode value 1 then printing the BAD and LOG information
if [ "$retcode" != "0" ]
then
# --> Step 13 : Also emailing the BAD and log files to user
echo "Please find the attached bad file." | mailx -s "Bad file for Interface Loader
Program" -a $badfile $EMAIL
fi
# --> Step 14 : Moving the Processed data files to Archive location
mv -f $ORL_FILE_PATH/$datafile $ORL_FILE_PATH/Archive/$fname$xdate.csv
echo "The data file has been moved to Archive directory"
exit 0

Upload the Host file into server $XXCUST_TOP/bin location (/u02/E-


BIZ/apps/apps_st/appl/XXCUST/12.0.0/bin) and provide the permission

chmod 777 XXAA_INV*

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Soft link Creation


Connect to $XXCUST_TOP/bin location (/u02/E-BIZ/apps/apps_st/appl/XXCUST/12.0.0/bin) and run the
below command

ln -s $FND_TOP/bin/fndcpesr XXAA_INV_ITEM_LOAD

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Register the Host file in application


Nav : Application Developer Concurrent Executable

Field Value
Executable XXAA_INV_ITEM_LOAD_FILE
Short Name XXAA_INV_ITEM_LOAD_FILE
Application Custom Development
Description XXAA Inventory Item Load File Program
Execution Method Host
Execution File Name XXAA_INV_ITEM_LOAD

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Create the concurrent program


Nav : Application Developer Concurrent Program

Field Value
Program XXAA Inventory Item Load File Program
Short Name XXAA_INV_ITEM_LOAD_FILE
Application Custom Development
Description
Executable name XXAA_INV_ITEM_LOAD_FILE

Click on the parameters

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Create the parameters and save

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Package File Creation


Prepare the Package Specification and Body files to process the below steps
Map : Assign the default values
Validate : Validate the records and derive the id into staging table
Load : Load the validated records into interface table

Compile the script in database

CREATE OR REPLACE PACKAGE XXAA_INV_ITEM_LOAD_PKG


AS
/*
*************************************************************************
** Date Developer Version Description
** ----------- --------------- ------- ---------------
** 10-Sep-2020 OracleApps88 1.0 Initial version
*************************************************************************
*/

PROCEDURE MAIN (p_retmsg OUT VARCHAR2, p_retcode OUT NUMBER);


PROCEDURE MAP;
PROCEDURE VALIDATE;
PROCEDURE LOAD;
END XXAA_INV_ITEM_LOAD_PKG;
/

CREATE OR REPLACE PACKAGE BODY XXAA_INV_ITEM_LOAD_PKG


/*
*************************************************************************
** Date Developer Version Description
** ----------- --------------- ------- ---------------
** 10-Sep-2020 OracleApps88 1.0 Initial version
*************************************************************************
*/
AS
PROCEDURE MAIN (p_retmsg OUT VARCHAR2, p_retcode OUT NUMBER)
AS
BEGIN
FND_FILE.PUT_LINE (FND_FILE.LOG,'+-----------------------------------------+');
FND_FILE.PUT_LINE (FND_FILE.LOG, 'Starting MAP Procedure ');
MAP;

FND_FILE.PUT_LINE (FND_FILE.LOG,'+-----------------------------------------+');
FND_FILE.PUT_LINE (FND_FILE.LOG, 'Starting VALIDATE Procedure ');
VALIDATE;

FND_FILE.PUT_LINE (FND_FILE.LOG,'+-----------------------------------------+');
FND_FILE.PUT_LINE (FND_FILE.LOG, 'Starting LOAD Procedure ');
LOAD;

END;

/* **-------------------------------------------------
** Procedure Name: MAP
** Purpose :Procedure to map the staging table fields.
**------------------------------------------------- */
PROCEDURE map
IS
BEGIN
/*===================================================

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Creation Date and User id


===================================================*/
UPDATE XXAA_INV_ITEM_LOAD_STG
SET creation_date = SYSDATE,
created_by = fnd_profile.value ('USER_ID');
COMMIT;

/*===================================================
Default Organization Code to V1
===================================================*/
UPDATE XXAA_INV_ITEM_LOAD_STG
SET ls_organization_code = 'V1';

COMMIT;

/*===================================================
Update Status of the Duplicate Records (Records given in data file and already
present in Oracle)
===================================================*/
UPDATE XXAA_INV_ITEM_LOAD_STG a
SET status_stg = 'ME',
ERROR_CODE = ERROR_CODE ||
'Duplicate Combination of Item and Organization;'
WHERE ls_item_number IN (SELECT segment1
FROM mtl_system_items_b m
WHERE m.segment1 = a.ls_item_number
AND m.organization_id IN
(SELECT organization_id
FROM mtl_parameters p
WHERE p.organization_code IN ('V1')));

COMMIT;

/*===================================================
Default Cost of Sales Account
===================================================*/
UPDATE XXAA_INV_ITEM_LOAD_STG
SET ls_cos_account = '01-600-5110-0000-000';

COMMIT;

/*===================================================
Default Expense Account
===================================================*/
UPDATE XXAA_INV_ITEM_LOAD_STG
SET ls_expense_account = '01-000-2440-0000-000';

COMMIT;

/*===================================================
Default Sales Account
===================================================*/
UPDATE XXAA_INV_ITEM_LOAD_STG
SET ls_sales_account = '01-110-9110-0000-000';

COMMIT;

/*===================================================
Default Template Name to 'Finish Good' if it is NULL
===================================================*/
UPDATE XXAA_INV_ITEM_LOAD_STG
SET ls_template_name = 'Finished Good'

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

WHERE ls_template_name IS NULL;

COMMIT;

/*===================================================
Default Primary Unit Of Measure
===================================================*/
UPDATE XXAA_INV_ITEM_LOAD_STG
SET ls_pr_unit_of_measure = 'Each'
WHERE ls_pr_unit_of_measure IS NULL;

COMMIT;

/*===================================================
Update Status of Records that are successfully mapped
===================================================*/
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'M'
WHERE 1 = 1
AND status_stg = 'N';

COMMIT;
END map;

/* **-------------------------------------------------
** Procedure Name: VALIDATE
** Purpose :Procedure to validate the staging table fields.
**------------------------------------------------- */
PROCEDURE VALIDATE
IS
l_organization_id NUMBER;
l_template_id NUMBER;
l_planner_code VARCHAR2 (50);
l_buyer_id NUMBER;
l_subinv_name VARCHAR2 (100);
l_sa_id NUMBER;
l_cogs_id NUMBER;
l_primary_uom mtl_units_of_measure.uom_code%TYPE;
l_buyer_name po_agents_name_v.full_name%TYPE;
l_buyer_id po_agents_name_v.buyer_id%TYPE;
l_planner_code mtl_planners.planner_code%TYPE;
l_cos_account_id NUMBER;
l_expense_account_id NUMBER;
l_sales_account_id NUMBER;

CURSOR cur_org_code
IS
SELECT DISTINCT ls_organization_code
FROM XXAA_INV_ITEM_LOAD_STG
WHERE ls_organization_code IS NOT NULL;

CURSOR cur_uom_code
IS
SELECT DISTINCT ls_pr_unit_of_measure
FROM XXAA_INV_ITEM_LOAD_STG;

CURSOR cur_item_template
IS
SELECT DISTINCT ls_template_name
FROM XXAA_INV_ITEM_LOAD_STG

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

WHERE ls_template_name IS NOT NULL;

CURSOR cur_item_cos_account
IS
SELECT DISTINCT ls_cos_account
FROM XXAA_INV_ITEM_LOAD_STG
WHERE 1 = 1;

CURSOR cur_item_expense_account
IS
SELECT DISTINCT ls_expense_account
FROM XXAA_INV_ITEM_LOAD_STG
WHERE 1 = 1;

CURSOR cur_item_sales_account
IS
SELECT DISTINCT ls_sales_account
FROM XXAA_INV_ITEM_LOAD_STG
WHERE 1 = 1;

BEGIN
/*===================================================
Validation for Organization if it is null
===================================================*/
BEGIN
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'VE',
ERROR_CODE = ERROR_CODE || 'Organization Code Cannot Be NULL;;'
WHERE ls_organization_code IS NULL;
EXCEPTION
WHEN OTHERS
THEN
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'VE',
ERROR_CODE = ERROR_CODE || 'Organization Code Cannot Be NULL;;'
WHERE ls_organization_code IS NULL;
END;

COMMIT;

/*===================================================
Validation for Organization id
===================================================*/
FOR org_code_rec IN cur_org_code
LOOP
BEGIN
SELECT organization_id
INTO l_organization_id
FROM mtl_parameters
WHERE organization_code = org_code_rec.ls_organization_code;

UPDATE XXAA_INV_ITEM_LOAD_STG
SET organization_id = l_organization_id
WHERE ls_organization_code = org_code_rec.ls_organization_code;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'VE',
ERROR_CODE = ERROR_CODE ||
'Organization Code does not exist in Oracle;;'
WHERE ls_organization_code = org_code_rec.ls_organization_code;

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

WHEN OTHERS
THEN
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'VE',
ERROR_CODE = ERROR_CODE ||
'Organization Code does not exist in Oracle;;'
WHERE ls_organization_code = org_code_rec.ls_organization_code;
END;
END LOOP;

COMMIT;

/*===================================================
Validation for Primary UOM Code
===================================================*/
FOR uom_code_rec IN cur_uom_code
LOOP
BEGIN
SELECT uom_code
INTO l_primary_uom
FROM mtl_units_of_measure
WHERE NVL (disable_date, SYSDATE + 1) > SYSDATE
AND unit_of_measure = LTRIM(RTRIM(uom_code_rec.ls_pr_unit_of_measure));

UPDATE XXAA_INV_ITEM_LOAD_STG
SET pr_uom_code = l_primary_uom
WHERE ls_pr_unit_of_measure = uom_code_rec.ls_pr_unit_of_measure;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'VE',
ERROR_CODE = ERROR_CODE || 'Invalid Primary UOM Code;;'
WHERE ls_pr_unit_of_measure = uom_code_rec.ls_pr_unit_of_measure;
WHEN OTHERS
THEN
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'VE',
ERROR_CODE = ERROR_CODE || 'Invalid Primary UOM Code;;'
WHERE ls_pr_unit_of_measure = uom_code_rec.ls_pr_unit_of_measure;
END;
END LOOP;

COMMIT;

/*===================================================
Validation for Template id
===================================================*/
FOR item_template_rec IN cur_item_template
LOOP
BEGIN
SELECT template_id
INTO l_template_id
FROM mtl_item_templates
WHERE template_name = item_template_rec.ls_template_name;

UPDATE XXAA_INV_ITEM_LOAD_STG
SET template_id = l_template_id
WHERE ls_template_name = item_template_rec.ls_template_name;
EXCEPTION
WHEN NO_DATA_FOUND
THEN

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'VE',
ERROR_CODE = ERROR_CODE || 'Invalid Template id;;'
WHERE ls_template_name = item_template_rec.ls_template_name;
WHEN OTHERS
THEN
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'VE',
ERROR_CODE = ERROR_CODE || 'Invalid Template id;;'
WHERE ls_template_name = item_template_rec.ls_template_name;
END;
END LOOP;

COMMIT;

/*===================================================
Validation for COS Account
===================================================*/
FOR item_cos_account_rec IN cur_item_cos_account
LOOP
IF item_cos_account_rec.ls_cos_account IS NOT NULL
THEN
BEGIN
SELECT code_combination_id
INTO l_cos_account_id
FROM gl_code_combinations_kfv
WHERE 1 = 1
AND chart_of_accounts_id = 101
AND concatenated_segments = item_cos_account_rec.ls_cos_account
AND enabled_flag = 'Y';

UPDATE XXAA_INV_ITEM_LOAD_STG
SET cos_account_id = l_cos_account_id
WHERE ls_cos_account = item_cos_account_rec.ls_cos_account;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'VE',
ERROR_CODE = ERROR_CODE || 'Invalid COS Account;;'
WHERE ls_cos_account = item_cos_account_rec.ls_cos_account;
WHEN OTHERS
THEN
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'VE',
ERROR_CODE = ERROR_CODE || 'Invalid COS Account;;'
WHERE ls_cos_account = item_cos_account_rec.ls_cos_account;
END;
END IF;
END LOOP;

COMMIT;

/*===================================================
Validation for Expense Account
===================================================*/
FOR item_expense_account_rec IN cur_item_expense_account
LOOP
IF item_expense_account_rec.ls_expense_account IS NOT NULL
THEN
BEGIN
SELECT code_combination_id

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

INTO l_expense_account_id
FROM gl_code_combinations_kfv
WHERE 1 = 1
AND chart_of_accounts_id = 101
AND concatenated_segments =
item_expense_account_rec.ls_expense_account
AND enabled_flag = 'Y';

UPDATE XXAA_INV_ITEM_LOAD_STG
SET expense_account_id = l_expense_account_id
WHERE ls_expense_account =
item_expense_account_rec.ls_expense_account;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'VE',
ERROR_CODE = ERROR_CODE || 'Invalid Expense Account;;'
WHERE ls_expense_account =
item_expense_account_rec.ls_expense_account;
WHEN OTHERS
THEN
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'VE',
ERROR_CODE = ERROR_CODE || 'Invalid Expense Account;;'
WHERE ls_expense_account =
item_expense_account_rec.ls_expense_account;
END;
END IF;
END LOOP;

COMMIT;

/*===================================================
Validation for Sales Account
===================================================*/
FOR item_sales_account_rec IN cur_item_sales_account
LOOP
BEGIN
SELECT code_combination_id
INTO l_sales_account_id
FROM gl_code_combinations_kfv
WHERE enabled_flag = 'Y'
AND concatenated_segments = item_sales_account_rec.ls_sales_account;

UPDATE XXAA_INV_ITEM_LOAD_STG
SET sales_account_id = l_sales_account_id
WHERE ls_sales_account = item_sales_account_rec.ls_sales_account;
EXCEPTION
WHEN NO_DATA_FOUND
THEN
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'VE',
ERROR_CODE = ERROR_CODE || 'Invalid Sales Account;;'
WHERE ls_sales_account = item_sales_account_rec.ls_sales_account;
WHEN OTHERS
THEN
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'VE',
ERROR_CODE = ERROR_CODE || 'Invalid Sales Account;;'
WHERE ls_sales_account = item_sales_account_rec.ls_sales_account;
END;

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

END LOOP;

COMMIT;

UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'V'
WHERE status_stg = 'M';

COMMIT;
END VALIDATE;

/* **-------------------------------------------------
** Procedure Name: LOAD
** Purpose : Procedure to write the errored data into the errors table.
** ------------------------------------------------ */
PROCEDURE LOAD
IS
l_transaction_type VARCHAR2 (10) := 'CREATE';
l_process_flag NUMBER := 1;
l_user_id NUMBER;
l_creation_date DATE := SYSDATE;
l_last_update_date DATE := SYSDATE;
l_organization_id NUMBER;

CURSOR cur_items
IS
SELECT *
FROM XXAA_INV_ITEM_LOAD_STG
WHERE status_stg = 'V';
BEGIN
BEGIN
SELECT user_id
INTO l_user_id
FROM fnd_user
WHERE user_name = 'OPERATIONS';
EXCEPTION
WHEN NO_DATA_FOUND
THEN
l_user_id := 0;
END;

FOR items_rec IN cur_items


LOOP
BEGIN
INSERT INTO MTL_SYSTEM_ITEMS_INTERFACE
(creation_date,
created_by,
segment1,
description,
organization_id,
primary_uom_code,
template_id,
cost_of_sales_account,
expense_account,
sales_account,
last_update_date,
last_updated_by,
process_flag,
set_process_id,
transaction_type,
attribute14

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

)
VALUES (SYSDATE,
l_user_id,
items_rec.ls_item_number,
items_rec.ls_description,
items_rec.organization_id,
items_rec.pr_uom_code,
items_rec.template_id,
items_rec.cos_account_id,
items_rec.expense_account_id,
items_rec.sales_account_id,
l_last_update_date,
l_user_id,
l_process_flag,
112,
--MOD (items_rec.transaction_id_stg, 5),
l_transaction_type,
items_rec.transaction_id_stg
);
EXCEPTION
WHEN OTHERS
THEN
UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'LE'
WHERE status_stg = 'V'
AND transaction_id_stg = items_rec.transaction_id_stg;

COMMIT;
DBMS_OUTPUT.put_line (SQLERRM);
END;
END LOOP;

UPDATE XXAA_INV_ITEM_LOAD_STG
SET status_stg = 'L'
WHERE status_stg = 'V';

COMMIT;
EXCEPTION
WHEN OTHERS
THEN
FND_FILE.PUT_LINE (FND_FILE.LOG, 'Unexpected error occurred in load procedure ->');
END LOAD;

END XXAA_INV_ITEM_LOAD_PKG;

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Register the Package in application


Nav : Application Developer Concurrent Executable

Field Value
Executable XXAA_INV_ITEM_LOAD
Short Name XXAA_INV_ITEM_LOAD
Application Custom Development
Description XXAA Inventory Item Load Interface Program
Execution Method PL/SQL Stored Procedure
Execution File Name XXAA_INV_ITEM_LOAD_PKG.MAIN

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Create the concurrent program


Nav : Application Developer Concurrent Program

Field Value
Program XXAA Inventory Item Load Interface Program
Short Name XXAA_INV_ITEM_LOAD
Application Custom Development
Description
Executable name XXAA_INV_ITEM_LOAD

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Procedure File Creation


Prepare the Procedure file to process the below steps
 Update the staging table record status for the loaded and failed in interface records
 Display the report with details

Compile the script in database

CREATE OR REPLACE PROCEDURE XXAA_INV_ITEM_LOAD_REP_PROC


(out_chr_errbuf OUT NUMBER,
out_chr_retcode OUT VARCHAR2
)
AS

G_CREATION_DATE DATE := SYSDATE;


G_USER_ID NUMBER := FND_PROFILE.VALUE ('USER_ID');
G_USERNAME VARCHAR2(40) := FND_PROFILE.VALUE ('USERNAME');
G_RESPONSIBILITY_ID NUMBER := FND_PROFILE.VALUE ('RESP_ID');
G_RESP_APPL_ID NUMBER := FND_PROFILE.VALUE ('RESP_APPL_ID');
G_REQUEST_ID NUMBER := FND_PROFILE.VALUE ('CONC_REQUEST_ID');
G_ORG_ID NUMBER := NVL (MO_GLOBAL.GET_CURRENT_ORG_ID,
FND_PROFILE.VALUE ('ORG_ID'));
l_cur_row_count NUMBER := 0;
l_chr_program_name VARCHAR2(100);
l_inventory_item_id NUMBER;

CURSOR update_cur
IS
SELECT *
FROM xxaa_inv_item_load_stg
WHERE 1 = 1
-- AND organization_id = fnd_global.org_id
-- AND TRUNC(creation_date) = TRUNC(SYSDATE)
AND status_stg = 'L'
ORDER BY ls_item_number;

CURSOR main_cursor
IS
SELECT status_stg, decode(status_stg, 'D', 'Successfully Loaded', 'LE', 'Load
Error', 'Validation Error') as status, ls_item_number, ls_organization_code,
error_code
FROM xxaa_inv_item_load_stg
WHERE 1 = 1
AND status_stg in ('N', 'VE', 'LE', 'D')
-- AND TRUNC(stg.creation_date) = TRUNC(SYSDATE)
UNION
SELECT status_stg, 'Interface Error' as status, ls_item_number,
ls_organization_code, intr.error_message as error_code
FROM xxaa_inv_item_load_stg stg,
mtl_system_items_interface inti,
mtl_interface_errors intr
WHERE 1 = 1
AND stg.transaction_id_stg = inti.attribute14
AND inti.transaction_id = intr.transaction_id
AND stg.status_stg = 'FI'
-- AND TRUNC(stg.creation_date) = TRUNC(SYSDATE)
ORDER BY 2 desc, 1, 3;

BEGIN
out_chr_retcode := 0;
out_chr_errbuf := '';

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

l_cur_row_count := NULL;
-- To Find the Concurrent Program Name
BEGIN
SELECT user_concurrent_program_name
INTO l_chr_program_name
FROM apps.fnd_concurrent_programs_tl
WHERE concurrent_program_id = fnd_global.conc_program_id
and language= USERENV('LANG');
EXCEPTION
WHEN OTHERS
THEN l_chr_program_name := NULL;
END;

--> Updatingt the staging table with Oracle loaded record status
FOR update_rec IN update_cur LOOP
BEGIN
SELECT inventory_item_id
INTO l_inventory_item_id
FROM mtl_system_items_b
WHERE segment1 = update_rec.ls_item_number
AND organization_id = update_rec.organization_id
AND attribute14 = update_rec.transaction_id_stg;

UPDATE xxaa_inv_item_load_stg
SET status_stg = 'D'
,inventory_item_id = l_inventory_item_id
WHERE status_stg = 'L'
AND transaction_id_stg = update_rec.transaction_id_stg;
EXCEPTION
WHEN OTHERS THEN
UPDATE xxaa_inv_item_load_stg stg
SET status_stg = 'FI',
error_code = (select intr.error_message
from mtl_system_items_interface inti,
mtl_interface_errors intr
where inti.attribute14 = stg.transaction_id_stg
AND inti.transaction_id = intr.transaction_id
)
WHERE status_stg = 'L'
AND transaction_id_stg = update_rec.transaction_id_stg;
END;
END LOOP;

COMMIT;

--> Concurrent Program Output File


fnd_file.put_line (fnd_file.output, RPAD('Status STG',12,' ')||RPAD('Status', 22,
' ')||RPAD('Item Number', 20, ' ')||RPAD('Org Code', 10, ' ') ||'Error Code');
FOR x1 in main_cursor
LOOP
l_cur_row_count := main_cursor%rowcount;
IF l_cur_row_count <> 0 THEN
BEGIN
fnd_file.put_line (fnd_file.output, RPAD(x1.status_stg,12,'
')||RPAD(x1.status, 22, ' ')||RPAD(x1.ls_item_number, 20, '
')||RPAD(x1.ls_organization_code, 10, ' ') ||x1.error_code);
EXCEPTION
WHEN OTHERS
THEN
fnd_file.put_line (fnd_file.log,'Exception While Printing :
'||SQLCODE||'-'||SQLERRM);
END;

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

END IF;
END LOOP;

COMMIT;

--> Concurrent Program Log File


fnd_file.put_line (fnd_file.log,' ');
fnd_file.put_line (fnd_file.log,' ');
fnd_file.put_line (fnd_file.log,'+-----------------------------------------------
----------------------------+');
fnd_file.put_line (fnd_file.log,'+------------------ Start of the Log File of the
Request -------------------+');
fnd_file.put_line (fnd_file.log,'+-----------------------------------------------
----------------------------+');
fnd_file.put_line (fnd_file.log,'Concurrent Program Name : '||
l_chr_program_name);
fnd_file.put_line (fnd_file.log,'Submitted By the User Name : '||
fnd_global.user_name);
fnd_file.put_line (fnd_file.log,'Submitted Responsibility Name : '||
Fnd_profile.value('RESP_NAME'));
fnd_file.put_line (fnd_file.log,'Concurrent Program Submitted on : '|| TO_CHAR
(SYSDATE,'DD-Mon-YYYY HH24:MI:SS'));
fnd_file.put_line (fnd_file.log,'No of Records : '||
l_cur_row_count);
fnd_file.put_line (fnd_file.log,'+-----------------------------------------------
----------------------------+');
fnd_file.put_line (fnd_file.log,' ');
fnd_file.put_line (fnd_file.log,' ');
END XXAA_INV_ITEM_LOAD_REP_PROC;
/

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Register the Procedure in application


Nav : Application Developer Concurrent Executable

Field Value
Executable XXAA_INV_ITEM_LOAD_REP
Short Name XXAA_INV_ITEM_LOAD_REP
Application Custom Development
Description XXAA Inventory Item Load File Report
Execution Method PL/SQL Stored Procedure
Execution File Name XXAA_INV_ITEM_LOAD_REP_PROC

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Create the concurrent program


Nav : Application Developer Concurrent Program

Field Value
Program XXAA Inventory Item Load File Report
Short Name XXAA_INV_ITEM_LOAD_REP
Application Custom Development
Description
Executable name XXAA_INV_ITEM_LOAD_REP

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Assign the Concurrent Program to Request Group


Get the responsibility request group
Nav : System Administrator Security Responsibility Define

Query with responsibility and copy the request group name

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Move the request group


Nav : System Administrator Security Responsibility Request

Search with request group name and enter new record and select the concurrent programs and save it

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Submit the XXAA Inventory Item Load File Program Concurrent Program
Program will process the below steps
 Connect to 3rd party system using FTP credentials
 Download the data files from 3rd party system into oracle location (File name start with RAJ_INV)
 Run the control command to load the data into staging table
 Send the log and bad files to user with email
 Once the file processed then move the file into Archive folder

Nav: Inventory, Vision Operations (USA) -->Requests

Select the program and enter the parameter values and click on Submit

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Once the program is completed verify the records in staging table

Verify the data file Archive folder

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Submit the XXAA Inventory Item Load Interface Program Concurrent Program
Program will process the below steps
 Map : Assign the default values
 Validate : Validate the records and derive the id into staging table
 Load : Load the validated records into interface table

Nav: Inventory, Vision Operations (USA) -->Requests

Select the program and click on Submit

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Verify record status in Staging table

Verify the loaded records in interface table

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Submit the Import Items Concurrent Program


Program will load the data from interface table to base table

Nav: Inventory, Vision Operations (USA) -->Items Import Import Items

Select the Org

Select the parameter values and click on Submit

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Click on the View Log

It will display the interface error details

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Verify the Interface error records in error and interface tables

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Verify the loaded records in base table

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Submit the XXAA Inventory Item Load Interface Report Concurrent Program
Program will process the below steps
 Update the staging table record status for the loaded and failed in interface records
 Display the report with details

Nav: Inventory, Vision Operations (USA) -->Requests

Select the program and click on Submit

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Verify the staging table record status

Click on the View Log

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Report to show the number of record processed

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Click on View Output

Report to show the record details

Verify the loaded record from application


Nav: Inventory, Vision Operations (USA) -->Items -->Master Items

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Select the Org

Query with Item number

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Verify the records in base table

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Create the Request Set


Nav : System Administrator Requests Set

Enter the Request et details and Click on Define Stages

Enter stage and click on Requests

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Select the Concurrent Program and click on parameters

Select the parameter values

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Once define the stages for concurrent programs


Click on the Link stages in request set

Select the sequence of request to be run and Save it

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Assign the Request set to Request Group


Nav : System Administrator Security Responsibility Request

Select the request set

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Schedule the Request set for daily


Nav: Inventory, Vision Operations (USA) Requests

Select the Org

Select the Request Set

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Select the Request set and click on the Schedule

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Select the frequency and click on ok

Click on Submit

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Migration Scripts for Concurrent Program and Request Set

Download Commands for Concurrent Program


FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct
XXAA_INV_ITEM_LOAD_FILE_CONC.ldt PROGRAM APPLICATION_SHORT_NAME="XXCUST"
CONCURRENT_PROGRAM_NAME="XXAA_INV_ITEM_LOAD_FILE"
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct
XXAA_INV_ITEM_LOAD_CONC.ldt PROGRAM APPLICATION_SHORT_NAME="XXCUST"
CONCURRENT_PROGRAM_NAME="XXAA_INV_ITEM_LOAD"
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct
XXAA_INV_ITEM_LOAD_REP_CONC.ldt PROGRAM APPLICATION_SHORT_NAME="XXCUST"
CONCURRENT_PROGRAM_NAME="XXAA_INV_ITEM_LOAD_REP"

Download Commands for Request Set


FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct
XXAA_INV_ITEM_LOAD_RS.ldt REQ_SET_LINKS REQUEST_SET_NAME='XXAA_INV_ITEM_LOAD'

Upload Commands for Concurrent Program


FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct
XXAA_INV_ITEM_LOAD_FILE_CONC.ldt - CUSTOM_MODE=FORCE
FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct
XXAA_INV_ITEM_LOAD_REP_CONC.ldt - CUSTOM_MODE=FORCE
FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct
XXAA_INV_ITEM_LOAD_REP_CONC.ldt - CUSTOM_MODE=FORCE

Upload Commands for Request Set


FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct
XXAA_INV_ITEM_LOAD_RS.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE

RAJU CHINTHAPATLA
Oracle Interface – Oracle EBS R12 End to End Interface Process for Item Import OracleApps88

Code Pack list

S. No. Command Type DB/Unix


1 XXAA_INV_ITEM_LOAD_STG.sql Staging Table Apps
2 XXAA_INV_ITEM_LOAD.ctl Control $XXCUST_TOP/bin
3 XXAA_INV_ITEM_LOAD.prog Shell Script $XXCUST_TOP/bin
4 XXAA_INV_ITEM_LOAD_PKG.pks Package Specification Apps
5 XXAA_INV_ITEM_LOAD_PKG.pkb Package Body Apps
6 XXAA_INV_ITEM_LOAD_REP_PROC.sql Procedure Apps

Download the code pack from below Google Drive link


https://drive.google.com/drive/u/7/folders/13LknqzJdYgx-p-c7KWbykhf8EencPnwH

RAJU CHINTHAPATLA

You might also like