Академический Документы
Профессиональный Документы
Культура Документы
Inter face is a process loading data from legacy system to oracle database
(or) Oracle database to Text files or Excel files. We have mainly two types of
interfae
1.Inbound interface
2.Outbound interface
1 . Inbound interface :
Inbound interrface
Exceldata Oracle Database
All Interfaes having its own interface tables before loading data into Base
table.
Ex: AP_INVOICE_INTERFACE
PO_INVOICE_INTERFACE
If any error
Sql*loader :
1 . Data file
2 . Control file
3 . log file
4 . band file
5 . discard file
1 . Data file :
Data file is a flatfile having the budines data to load flat file in the
formatt of “.txt” , ”.csv” , “.dat” ……..etc
2 . Control file:
Syntax :
Load Data
C:\XXSTD Data_txt
..
.1000
XXSTDDATA.ctl :
Load data
Infile ‘c:\XXSTDDATA.txt’
Filelds terminated by ‘ , ’
Optionally terminated by ‘ “ ’
Insert :
Append :
In “append” method the new records rewrite to the old data from the
lastline.
Replace :
Truncate :
In “ truncate ” method data will be overwrite and delete the space also.
Flatfile having 1000 records out of which skip 50 records between 751 to
800 and commit the data for every 100 reords
Load = 750
Skip = 50
Load =200
Rows = 100
Filter :
When :
When(1:1)<> ‘*’
We can use all predefined functions in control file like Upper() , Trim() ,
Sum() , Constant and we can’t use any userdefined functions
(Sno Trim(:Sno) ,
Sname Upper(:sname) ,
Fee Filter,
Joindate)
How to run Sql*loader :
Oracle :
Oracle apps:
3 .log file :
Log file generate automatically once run the control files execution
should be .log and It provide information like how many records are loaded ,
Notloaded ……….etc
4.Bad file :
5.Discard file :
Stage 1 :
Use sql*loader write the control files. To load the data from flat file
to staging table.
Stage 2:
Stage 3 :
Create a Request set for stage1 and stage2 to run sequentially and
schedule the Request set to run on specific interval(Shell script prog)
Stage 5 :
Develop a outbound interface to extract all error table data into excel
sheet
Stage 6 :
Develop a email procedure which will send the status to client status.
Onsite team will identify the type of issue raise the error records and reload
the data Once again.
Syntax :
As select column 1,
Column 2,
Column 3
Where 1=2;
Interface component:
Worked on GL interface to upload the legacy flat file journal data into
GL base table
Note: journal is a transaction and each record having two lines i.e Credit and
Debit
Credit Debit
10,000 0
0 10,000
XXGLDATA.ctl XXGLDATA.dat
3 .external file/Tables
XXGLDATA_PROC
XXGL_INTERFACE_STG Pl/sql program
GL_JE_BATCHES
GL_JE_HEADERS
GL_JE_LINES
XXGLDATA.dat :
"NEW","1","11_AUG_2002","USD","11_AUG_2002","1318","A","Inventory","Jfor
ms","Corporate","01","110","7730","0000","000","1100","0","1100","0","62","XX
SIVA","BATCH_SIVA","XXSIVA_JOURNAL","JOURNL_DESC"
"NEW","1","11_AUG_2002","USD","11_AUG_2002","1318","A","Inventory","Jfor
ms","Corporate","01","110","7730","0000","000","0","1000","0","1000","62","XX
SIVA","BATCH_SIVA","XXSIVA_JOURNAL","JOURNL_DESC"
as select
status
,ledger_id
,accounting_date
,currency_code
,date_created
,created_by
,actual_flag
,user_je_category_name
,user_je_source_name
,user_currency_conversion_type
,segment1
,segment2
,segment3
,segment4
,segment5
,entered_dr
,entered_cr
,accounted_dr
,accounted_cr
,group_id
from
gl_interface
where 1=2;
Sql>Grant Successful
Sql>Conn apps/apps@vis
Sql>Synonym created
Stage1:
Ex:XXGLDATA.ctl
Load data
infile '/u01/oracle/VIS/apps/apps_st/appl/gl/12.0.0/bin/XXGLDATASP1.dat'
Trailing nullcols
(status
,LEDGER_ID
,accounting_date
,currency_code
,date_created
,created_by
,actual_flag
,user_je_category_name
,user_je_source_name
,user_currency_conversion_type
,segment1
,segment2
,segment3
,segment4
,segment5
,entered_dr
,entered_cr
,accounted_dr
,accounted_cr
,group_id
,reference1
,reference2
,reference4
,reference5
Step2:
Step3:
Executable : XXGLDATA_EXEC
Description :
14/02/2014
Stage 2:
Steps:
--cursor declaration
CURSOR gl_cur IS
SELECT STATUS
,LEDGER_ID
,ACCOUNTING_DATE
,CURRENCY_CODE
,DATE_CREATED
,CREATED_BY
,ACTUAL_FLAG
,USER_JE_CATEGORY_NAME
,USER_JE_SOURCE_NAME
,USER_CURRENCY_CONVERSION_TYPE
,SEGMENT1
,SEGMENT2
,SEGMENT3
,SEGMENT4
,SEGMENT5
,ENTERED_CR
,ENTERED_DR
,ACCOUNTED_CR
,ACCOUNTED_DR
,REFERENCE1
,REFERENCE2
,REFERENCE4
,REFERENCE5
,GROUP_ID
FROM XXGL_INTERFACE_STG_SP;
l_currencycode varchar2(25);
l_ledger_id number(3);
l_flag varchar2(2);
l_error_msg varchar2(100);
l_err_flag varchar2(10);
BEGIN
LOOP
l_count:=l_count+1;
l_flag:='A';
--ledger ID validation
BEGIN
SELECT ledger_ID
INTO l_ledger_id
FROM GL_LEDGERS
WHERE ledger_id=rec_cur.ledger_id;
EXCEPTION
l_flag:='E';
END;
BEGIN
SELECT currency_code
INTO l_currencycode
FROM fnd_currencies
WHERE currency_code=rec_cur.currency_code
AND currency_code='USD';
EXCEPTION
l_flag:='E';
END;
IF l_flag!='E' THEN
,LEDGER_ID
,ACCOUNTING_DATE
,CURRENCY_CODE
,DATE_CREATED
,CREATED_BY
,ACTUAL_FLAG
,USER_JE_CATEGORY_NAME
,USER_JE_SOURCE_NAME
,USER_CURRENCY_CONVERSION_TYPE
,SEGMENT1
,SEGMENT2
,SEGMENT3
,SEGMENT4
,SEGMENT5
,ENTERED_CR
,ENTERED_DR
,ACCOUNTED_CR
,ACCOUNTED_DR
,REFERENCE1
,REFERENCE2
,REFERENCE4
,REFERENCE5
,GROUP_ID)
VALUES(rec_cur.STATUS
,rec_cur.LEDGER_ID
,rec_cur.ACCOUNTING_DATE
,rec_cur.CURRENCY_CODE
,rec_cur.DATE_CREATED
,rec_cur.CREATED_BY
,rec_cur.ACTUAL_FLAG
,rec_cur.USER_JE_CATEGORY_NAME
,rec_cur.USER_JE_SOURCE_NAME
,rec_cur.USER_CURRENCY_CONVERSION_TYPE
,rec_cur.SEGMENT1
,rec_cur.SEGMENT2
,rec_cur.SEGMENT3
,rec_cur.SEGMENT4
,rec_cur.SEGMENT5
,rec_cur.ENTERED_CR
,rec_cur.ENTERED_DR
,rec_cur.ACCOUNTED_CR
,rec_cur.ACCOUNTED_DR
,rec_cur.REFERENCE1
,rec_cur.REFERENCE2
,rec_cur.REFERENCE4
,rec_cur.REFERENCE5
,rec_cur.GROUP_ID);
END IF;
l_flag:=NULL;
l_error_msg:=NULL;
END LOOP;
COMMIT;
END;
Stage3:
Import
Run
Source Jetforms
It asks you are you start general import click on yes the request is submitted. Find
the request. Once request completes normal the data goes from the interface
table to base table and check the base tables
(GL_JE_HEADERS,GL_JE_LINES,GL_JE_BATCHES)
15/02/2014
Request Set :
Steps:
Go to system administrator
Navigation is
concurrent
set
click on request set wizard button
Set : XXGLREQUEST_INTERFACE
Application : General Ledger
Select As each request in the set completes
Select your programs and click on finish button. Request set has been
created
Assign the Request set to Request Group
In Request Group
Type
Set
Click on next
1. As soon as possible
It’s a default and request submitted automated or Immedia
2. F
To fire only once on a specific date and time.
3. S
To schedule request on a given date range for every day month mins……
4. On specific
To submit a request on a given date range and given cal days
To save the schedule select save the schedule and provide schedule
name
To apply same schedule to other program click on apply a saved schedule
button and select the schedule
Note:
Component2:
Flat file
Staging table
GL_Daily_Rates_Interface
GL_Daily_Rates
OUTBOUND INTERFACE
Extracting all employee payroll data into excel sheet and sending to
bank for crediting their salaries
Oracle Outbound
Excel/textfiles
Databse Interface
UTL_File :
UTL_File.File_Type
UTL_File.Fopen
UTL_File.put-line
UTL_File.Fclose
UTL_File.Fclose_all
UTL_File.File_Type:
Ex:
UTL_File.Fopen :
Filepath:
Files will generate I only specific directory path by the following query we
can find UTL_File in directory path.
Ex: UTL_File_dir(‘d:\outbound’)
Filename :
Method :
We have 3 methods
W for writing
Out bound purpose
A for append pipurpose
R for read In bound purpose
UTL_File.put_line :
UTL_File.Fclose :
This attribute is used to close the UTL_file variables which are opened
UTL_File.fclose_all :
This attribute is used to close all the UTL_File variable which are opened
and mostly we can using Exceptions.
UTL_File Exceptions :
UTL_File.Invalid_path
UTL_File.Invalid_mode
UTL_File.Invalid_file
UTL_File.Write_error
UTL_File.Read_error
When others
Example:
Develop a outbound interface to extract all invoices details which are paid
in the given date range.
18/02/2014
In database columns
we have System columns
Business columns
Flat file having only business columns and to load the business data, setup
columns , sequence colums must be required. i.e setup columns must be exist and
business data should not be exist
Ex:
Insert into gl_interface (ledger_id
,currency_code
,created_by
,creation_date
.
.
.
Values(i.ledger_id
,i.currency_code
.
.
Fnd_global.user_id,
Sysdate,
,fnd_global.login_id);
Conversion S:
Conversion Interface
In conversion loading data directly into the In interface loading data into interface
base tableby calling the standard API’s table and then into base table by running
the standard concurrent program
In conversion we know exact volume of the In interface we don’t know size of the flat
datatype file
Conversion mostly we are using Interface mostly using supporting time
implementation time
Conversion process Interface process
Faltfile Flat file
Staging table
Temporary table
Interface table
Base table
Base table
1. HZ_PARTY_V2PUB.CREATE_PERSON :
Party_id
Party_name
Person_number
Party_title
Profile_id
2. HZ_CUSTOMER_PROFILE_V2PUB.CREATE_CUSTOMER_PROFILE :
‘HZ_CUSTOMER_PROFILES’
3. HZ_CUST_ACCOUNTS_V2PUB.CREATE_CUST_ACCOUNTS :
4. HZ_LOCATION_V2PUB.CREATE_LOCATION :
5. HZ_PARTY_CONTACT_V2PUB.CREATE_ORG_CONTACT :
This API is used to create contact point details for an party or party_site
that table is HZ_CONTACT_POINTS.
Component 3:
Pl/sql Stored
Staging table
procedure
Standard concurrent
AP_Invoices_Interface Payables open
program
AP_Invoice_lines_Interface interface import
If any error
AP_Invoices_all
AP_Interface_rejections
AP_Invoice_lines_all
AP_Invoice_distributions_all
AP_Payment_Schedules_all
21/02/2014
Email Procedure :
UTL_SMTP.Connection
UTL_SMTP.mail
UTL_SMTP.rcpt
UTL_SMTP.quit (connection,variable)
1. UTL_SMTP.Invalid operation
2. UTL_SMTP.Transient_error
3. UTL_SMTP.Perminent_error
When error
Example: