Beruflich Dokumente
Kultur Dokumente
GATEWAY
Implementation of Extension Columns
Prepared by Oracle Development
Author: Bonnie Shebat Williams
Creation Date: August 14, 2002
Last Updated: August 14, 2002
Control Number:
Version: 1.0
Overview ........................................................................................................................................................................................5
Document Purpose ......................................................................................................................................................................5
Upgrade from Release 10.7 and 11 to Release 11i......................................................................................................................5
Example........................................................................................................................................................................................14
Document Purpose
The purpose of this document is to explain the steps to enable E-Commerce Gateway Extension
Columns within the Release 11i Oracle E-Commerce Gateway.
This method is used by the following transactions since they were new transactions or
redesigned in Release 11i. The initial per transaction to include the logic to allow extension
tables are noted below.
Transaction Description Application Initial transaction Initial Patch with
file revision with Extension
Extension Columns Columns
CDMO Credit Memo/ Receivables ECCDMO2.sql 1819233
Debit Memo 115.6
DSNO Ship Notice Shipping Execution 2474979
GASNO OPMs Ship Notice Process Manufacturing 2474991
GPOAO OPMs Purchase Order Process Manufacturing 2474997
Acknowledgment
POAO Purchase Order Order Management 2474987
Acknowledgment
POCAO Purchase Order Change Order Management 2474987
Acknowledgment
The method used by Release 11 applies to the following transactions. Refer to the documents
on Metalink for the Extension tables in the previous release and the R11i Implementation Guide.
The R11i transactions using the R11 Extension table methodology are easily identified by their
corresponding extension table. The R11i Extension Column method does not have these _X
tables.
ECE_PO_INTERFACE_HEADERS ECE_PO_INTERFACE_HEADERS_X
ECE_PO_INTERFACE_LINES ECE_PO_INTERFACE_LINES_X
ECE_PO_INTERFACE_SHIPMENTS ECE_PO_INTERFACE_SHIPMENTS_X
R11i Transaction using the R11 Extension Table Method (they have _X tables)
Descriptive Flexfields
The Descriptive Flexfields feature of Oracle Applications provides a flexible method for
adding implementation-specific data elements to any of the Applications without
programming. These data elements are stored in the ATTRIBUTEn columns in the base
Applications tables where n is usually 1 to 15 or 20 attributes. All of the ATTRIBUTEn
columns associated with the relevant Application base tables for a specific transaction are
included in the e-Commerce Gateway interface tables for outbound transactions and in
the Application open interface tables for inbound transactions.
Like all Application base tables, the e-Commerce Gateway table ECE_TP_HEADERS
contains ATTRIBUTEn columns. The ATTRIBUTEn columns in ECE_TP_HEADERS may
be used to include additional Trading Partner-specific data in the transaction interface
file given the trading partner definition used with the transaction.
Use of the Descriptive Flexfields feature in the Oracle Applications requires no additional
setup for inclusion in e-Commerce Gateway transactions. Once the desired flexfields are
set up and defined in the Applications, any data stored in them is automatically included
in the relevant e-Commerce Gateway transaction.
Reference the Oracle Applications Flexfields Guide for details.
Extensible Architecture
The Extensible Architecture feature of the Oracle e-Commerce Gateway provides a
powerful and flexible method to include additional data for outbound transactions.
While most business needs for additional data can be accommodated by the use of the
Descriptive Flexfields feature in the Oracle Applications, the Extensible Architecture
feature is useful when:
More data elements are required than are allowed by the use of Descriptive
Flexfields
Data elements need to be extracted from custom Oracle Applications tables
Data elements need to be extracted from outside Oracle Applications
Every data level within a transaction in the e-Commerce Gateway has a set of extension
columns, that may be customized to fit the business needs.
Custom Table
ECE_POA_INTERFACE_LINES
* PO Number
* POType
o Release Number
* Line Number MATERIAL_ANALYST
* Line Order Quantity
* Line UOM
o Item ID #* Inventory Item ID
... ...
o Line Attribute 1
o Line Attribute 2
...
POAO_LEV02_EXT1 for
o o Material Analyst Code
Material Analyst Code
o Material Analyst Last Name
POAO_LEV02_EXT2 for o Material Analyst First Name
o
Material Analyst Last Name o Material Analyst Phone
POAO_LEV02_EXT3 for o Material Analyst Email
o ...
Material Analyst Last Name
POAO_LEV02_EXT4 for
o
Material Analyst Phone
POAO_LEVE02_EXT5 for Legend
o Material Analyst Email
#* Unique ID
* Reqired
o Optional
The source data to be copied to the extension columns may come from a standard or
custom Oracle database table, an external (non-Oracle) relational database, or a file.
The following process is performed to bring all the data together before writing the
records to the output transaction file.
1. The e-Commerce Gateway extracts and denormalizes all the relevant Oracle base
application data (including Trading Partner data) into a staging table in the e-
Commerce Gateway.
2. Any enabled code conversions are performed after the data is extracted from the
base application tables, but before the data is written to the staging table.
3. Using a unique identifier from other data in the base transaction as table keys
(like Item ID in the above picture), data elements are selected from the
appropriate external source and written to the extension columns. This is
directed by your custom procedure. (This is described below.)
4. All data elements from the base application and your extra desired data are
formatted into 1024-byte (or less) records, sequenced and written to the
transaction file.
Seeded Procedures
The Oracle e-Commerce Gateway provides packaged procedures to allow you to add
your own data to outbound transactions.
Seeded Utilities
The Oracle e-Commerce Gateway provides three utilities to implement the extension
columns. They are found in the EC_UTILS file.
Utilities Purpose
Input: i_level Specify the data level of the column found in the
transaction.
This is found in the Transaction Layout Definition
form.
Input: i_search_text Specify the column in the transaction that will be used
as a search key to the external source data.
This is found in the Transaction Layout Definition
form.
This column name must be from a level equal to the
i_level specified above or a lower level number.
This parameter is expected to be the datatype
VARCHAR2. Be sure to use quotes around it.
Output: o-pos The index number or position for that data is returned.
This is needed by the ec_utils.GET_KEY_VALUE and
ec_utils.INSERT_VALUE
ec_utils.GET_KEY_VALUE
Get the value in the column found at the position in the
Staging Table.
Input: i-pos The index number or position in the Staging table that
contains the data value to be used as a search key to the
external source data.
This was retrieved by the ec_utils.FIND_POS.
Output: o-value The value stored in this variable will be used as the
search key value to their external source data.
ec_utils.INSERT_VALUE
Insert the custom value into an extension column in the
Staging Table.
Input: i-pos The index number or position in the Staging table that
is the location of the extension column.
This was retrieved by the ec_utils.FIND_POS.
Output: i-value The value stored in this variable will be copied into the
extension column in the Staging table.
Utility Parameters
/** 1) Get the key value you need from the staging table using
EXT_FIND_POS to get the index position in the Staging table, then
2) EXT_GET_KEY_VALUE to get the data value stored in the
Staging table **/
/** Find the position of ITEM_ID in the Staging table and store in
key1Pos */
ec_utils.EXT_FIND_POS(
i_level => 1,
i_search_text => INVENTORY_ITEM_ID,
o_pos => key1Pos);
/** Your custom code here will retrieve the data from your custom
table
In this example, the column CustomData1 is retrieved**/
/** Find the position of your needed extension column in the Staging
table
using EXT_FIND_POS then insert your retrieved data into that
extension column.**/
/* Insert your data into the column found in EXT1Pos, your extension
column */
ec_utils.EXT_INSERT_VALUE(
i_pos => Ext1Pos,
o_value => CustomData1);
Task: Activate the desired new column(s) using the Transaction Layout
Definition form by associating the record number, position, length, record
layout code and record layout qualifier.
These extension columns are predefined in each transaction that uses this
method.
For Example DSNO_LEV04_EXT01 is the first extension column at Level 4 in the DSNO
transaction.
The DSNO Ship Notice has twelve levels of data that are displayed in the Transaction
Interface Definition Form. Each level usually corresponds to a data level in the
application that was the source of the data. Each level was created by a database view.
Level Level Description Predefined Extension Columns for the Given Level
1 1 Delivery DSNO_LEV04_EXT01 through DSNO_LEV04_EXT15
2 2 Delivery Attributes DSNO_LEV02_EXT01 through DSNO_LEV02_EXT15
3 3 Delivery Orders (loose) DSNO_LEV03_EXT01 through DSNO_LEV03_EXT15
4 4 Order Items (loose) DSNO_LEV04_EXT01 through DSNO_LEV04_EXT15
5 5 Item Freight Charges (loose) DSNO_LEV05_EXT01 through DSNO_LEV05_EXT15
6 6 Item Details (loose) DSNO_LEV06_EXT01 through DSNO_LEV06_EXT15
7 7 Container Hierarchy DSNO_LEV07_EXT01 through DSNO_LEV07_EXT15
8 8 Delivery Containers DSNO_LEV08_EXT01 through DSNO_LEV08_EXT15
9 9 Delivery Orders (containerized) DSNO_LEV09_EXT01 through DSNO_LEV09_EXT15
10 10 Order Items (containerized) DSNO_LEV10_EXT01 through DSNO_LEV10_EXT15
11 11 Item Freight Charges (containerized) DSNO_LEV11_EXT01 through DSNO_LEV11_EXT15
12 12 Item Details (containerized) DSNO_LEV12_EXT01 through DSNO_LEV12_EXT15
Step 2: Modify Procedures to Move Your External Source Data to the Predefined
Extension Columns
A Locate Code
1 Locate the desired Package Body.
For example: ECDSNOXB.pls for the DSNO transaction
2 Select the desired procedure associated with the level of data where you want to copy the
extension data.
For example DSNO_POPULATE_EXT_LEV04
B Analyze Data
3 Determine what data in the regular transaction will be used as part of a search key to
your external table. Note its column name. It may be any column name in the data level
that you are writing the extension data or any level above it.
You need this column name in the EC_UTILS.EXT_FIND_POS utility to find it in the
array in memory that is processing the transaction.
4 Note the following:
Which of your external columns will be mapped to the Transactions extension
columns?
What columns from the transaction will be used as search keys to your external
table?
C Modify the Procedure
5 Replace the logic in the procedure with your meaningful code.
Procedure names have the following naming convention:
<Tran>_POPULATE_EXT_LEVnn
Where <tran> is the transaction code and nn is the level number
6 Determine what data in the regular transaction will be used as part of a search key to
your external table. Note its column name. It may be any column name in the data level
that you are writing the extension data to or any level above it.
You need this column name in the EC_UTILS.EXT_FIND_POS utility to find it in the
array in memory that is processing the transaction.
7 Once you established the columns position in the array in memory, retrieve its value
and store it as a variable so you may use it as part or all of the search key in your external
table.
Retrieve this value by using EC_UTILS.EXT_GET_KEY_VALUE utility.
8 Select the desired data from your external table(s).
Manipulate or calculate the data if you wish.
9 Find the position of the Extension Column where you want to place the data.
You need this column name in the EC_UTILS.EXT_FIND_POS utility to find it in the
array in memory that is processing the transaction.
10 Copy your retrieved data into the appropriate extension column(s).
Use the EC_UTILS.EXT_INSERT_VALUE utility.
D Recompile the Procedure
11 Compile the Procedure. Be careful not to change its name.
The transaction is looking for specific procedure names that you cannot change.
The seeded procedures are just stub procedures that do nothing as they are currently
written. They are invoked with each execution of the transaction. You must modify the
appropriate procedure to move your desired data to the extension columns.
PROCEDURE DSNO_POPULATE_EXT_LEV02
(l_fkey IN NUMBER,
l_plsql_table IN ece_flatfile_pvt.interface_tbl_type)
IS
BEGIN
NULL;
END PROCEDURE DSNO_POPULATE_EXT_LEV02;
GOAL: Find the position of the Extension column in the Gateways staging table
where you want to place your custom data using EXT_FIND_POS, then
insert the data into that position in the Staging table.
STEP 1:
Find the Position of the key data in the Staging table that will be
used to access your custom table, then get its KEY Value to use in
the table search.
/** Get the key value you need from the staging table
using EXT_FIND_POS to get the index position in the
Staging table then EXT_GET_KEY_VALUE to get the
data value stored in the Staging table **/
/** Find the position of your search key and store in key1Pos */
ec_utils.EXT_FIND_POS(
i_level => 1,
i_search_text => ITEM_ID,
o_pos => key1Pos);
STEP 2:
Your custom code here will retrieve the data from your custom
table.
In this example, the column CustomData1 is retrieved
STEP 3:
Find the data position of the extension column in the Staging table,
then insert your data into it.
/** Get the key value you need from the Gateways staging table
using EXT_FIND_POS to get the index position in the
Staging table for the extension column then
EXT_GET_KEY_VALUE to
Get the data value stored in the Staging table **/
The customization process is complete. Each subsequent execution of the outbound Ship
Notice transaction will include the data in the new extension column in the output
transaction.
PROCEDURE <Tran>_POPULATE_EXT_LEVnn_<name>
declare
key1 VARCHAR2(2000); /* key1 data value from g_map_tbl*/
key1Pos NUMBER; /* Position in g_map_tbl of key1 */
ext1Data VARCHAR2(2000); /* Your custom data */
ext1Pos NUMBER; /* Position in g_map_tbl of
ECE_DSNO_LEV04_EXT1 */
begin
/** Get the key value you need from the Gateways staging table
using EXT_FIND_POS to get the index position in the
Staging table then EXT_GET_KEY_VALUE to get the
data value stored in the Staging table **/
/** Get position of the key to your external table and store in key1Pos */
ec_utils.EXT_FIND_POS (
i_level => 1,
i_search_text => INVENTORY_ITEM_ID,
o_pos => key1Pos);
/* Now take the key1 value to get the data you want from your tables. */
select my_truck_num
into DSNO_L04_E01DATA
from MATERIAL_ANALYST
where INVENTORY_ITEM_ID = key1;
/* Use that position to write the data to the Gateway Staging table */
ec_utils.EXT_INSERT_VALUE(
i_pos => ext1Pos,
i_value => DSNO_L04_E01DATA);
end;
This section explains the implementation details that are needed within the seeded stub
procedures.
Note on Levels:
A level number is a number assigned to each database view that extracts data in the
transaction. Use the correct level number so your desired data appears in the proper
place in the data hierarchy of the transaction.
The next section of this document has a portion of the log file where the call is made to
procedure CDMO_POPULATE_EXT_LEV01.
Procedures:
Use the following procedures to implement the customized code within any seeded
procedure that is provided such as CDMO_POPULATE_EXT_LEV01.
EXT_FIND_POSITION
EXT_GET_KEY_VALUE
EXT_INSERT_VALUE
These procedures are used in pairs:
a) To locate and get the value of the Key to use in your desired table:
Procedure EXT_FIND_POSITION is used to find a key column within the e-
Commerce Gateway staging table for the given transaction. First you are
searching for the column in the transaction to be the key to your desired table.
Procedure EXT_GET_KEY_VALUE is used once you have located that key
column in the transaction. Save its value so you can use it as a key value against
your desired table.
b) To locate and then insert the data into the extension column where you will place your
desired data.
Procedure EXT_FIND_POSITION is used to locate the desired extension column
within the e-Commerce Gateway staging table for the given transaction.
Procedure EXT_INSERT_VALUE is used to insert your retrieved value into the
desired extensible column.
CDMO_LEV01_EXT01 << COPY DATA CUST_DATA1 If you find the table entry given
your key value
Copy the content (placed into your INVOICE_VALUE,
in this variable variable move any column from the
into an extension MY_LEV01_EXT1_DAT CDMO_CUST_TABLE table row
column. * A) into the extension column in the
transactions.
* The data to be moved into an extension column may come from any existing column or it
may be manipulated before inserting the data into the extensible column.
This table illustrates the example of inserting the data from the CDMO_CUST_TABLE
table to the extensible column.
Logic:
For CDMO transaction, the column INVOICE_NAME is present at Level 1.
Step 1:
Get the value of the column INVOICE_NAME in the CDMO transaction using the
combination of the procedures EXT_FIND_POSITION and EXT_GET_KEY_VALUE.
Step 3:
Use the combination of procedures EXT_FIND_POSITION and EXT_INSERT_VALUE to
insert data into the extensible column CDMO_LEV01_EXT01.
The following is the implementation details:
Step 1 Detail
Step 1A. Determine the position of column INVOICE_NAME at level 1 in the
transactions staging table.
Use procedure EXT_FIND_POSITION to find the position of any column at a given
level within the e-Commerce Gateway staging table.
The EXT_FIND_POSITION parameters are:
Level
Column name
The placeholder for position is returned by this procedure. This value will be a parameter
in the EXT_GET_KEY_VALUE procedure also.
EC_UTILS.EXT_FIND_POSITION(I_level,INVOICE_NAME,invoice_positio
n)
| | |
Level (1,2..) Column Name Position of the
in the Staging column Value
table. Returned by
this
Procedure.
Step 1B: Once the position is obtained, get the value at this position in the Staging table.
To get the value at this particular position, use the procedure EXT_GET_KEY_VALUE.
The EXT_GET_KEY_VALUE parameters are:
Position
Placeholder for the value returned by the procedure.
To get the value of the column INVOICE_NAME, pass the position at which this column
is present. Position is obtained as mentioned above by calling the procedure
EXT_FIND_POSITION.
EC_UTILS.EXT_GET_KEY_VALUE(invoice_position, INVOICE_VALUE);
| |
Position of the column Value returned
Obtained by using by the procedure.
EXT_FIND_POSITION.
Step 2 Detail:
EC_UTILS.EXT_FIND_POSITION(I_level,CDMO_LEV01_EXT01,
POSITION_OF_EXT01);
| | |
Level Extensible Column Name Position of
extensible
column returned by
the procedure.
Step 3B: Once the position is determined, the next step is to insert the value into that
position.
To insert the value at the particular extension column, the procedure
EXT_INSERT_VALUE is used.
The EXT_INSERT_VALUE parameters are:
Position
Value to be inserted at this position.
EC_UTILS.EXT_INSERT_VALUE(POSITION_OF_EXT01,
MY_LEV01_EXT1_DATA);
| |
Position of the Extension Your data
Column that was determined to be inserted.
by EXT_FIND_POSITION.
The following is the portion of the log file that has calls to the procedure
CDMO_POPULATE_EXT_LEV01
Procedure name==>CDMO_EXT.CDMO_POPULATE_EXT_LEV01
Cursor Handle ==>41
Procedure name==>BEGIN CDMO_EXT.CDMO_POPULATE_EXT_LEV01;
END;
In Procedure CDMO_Populate_Ext_Lev01
i level==>1
Step 1 Start:
Step 1A: Get the position of INVOICE_NAME by passing the level 1 and
column name to the procedure EXT_FIND_POSITION.
Enter EC_UTILS.EXT_FIND_POSITION
i_level==>1
i_search_text==> INVOICE_NAME
o_pos==>57
Exit EC_UTILS.EXT_FIND_POSITION
Time Taken 0 seconds
Step 1B: Now use the procedure EXT_GET_KEY_VALUE to get the value
of
INVOICE_NAME by passing the position obtained.
Step 1 End:
Step 2 Start:
Now get the value with which to populate the extensible column
CDMO_LEV01_EXT01.
This section has the custom select statements to retrieve the desired data.
Refer to Step 2 Detail above that has the following piece of code.
select CUST_DATA1 into MY_LEV01_EXT1_DATA
from CDMO_CUST_TABLE
where INVOICE_NAME = INVOICE_VALUE;
Step 2 End:
Step 3 Start:
Step 3A: Get the position of CDMO_LEV01_EXT1 by passing the level 1 and
column name to the Procedure EXT_FIND_POSITION.
Enter EC_UTILS.EXT_FIND_POSITION
i_level==>1
i_search_text==>CDMO_LEV01_EXT1
o_pos==>369
Exit EC_UTILS.EXT_FIND_POSITION
Time Taken 0 seconds
Note: This is just a log message that is written in the procedure. This log message
displays the inserted value. The variable name that contains the value is not
displayed here. You can display any log messages using ec_debug package.
Step 3 End:
procedure CDMO_POPULATE_EXT_LEV01
is
i_level number:=1;
invoice_pos number;
invoice_value varchar2(50);
MY_LEV01_EXT1_DATA varchar2(50);
ext1pos number;
begin
ec_utils.EXT_GET_KEY_VALUE(invoice_pos,invoice_value);
begin
exception
when others then
ec_debug.pl(3,'Unable to get the value from the table CDMO_CUST_TABLE for
the given Invoice );
exit;
end;
ec_utils.EXT_INSERT_VALUE(ext1pos, MY_LEV01_EXT1_DATA);
end CDMO_POPULATE_EXT_LEV01;
procedure CDMO_POPULATE_EXT_LEV02
is
i_level number := 2;
begin
null;
end CDMO_POPULATE_EXT_LEV02;
procedure CDMO_POPULATE_EXT_LEV03
is
i_level number := 3;
begin
null;
end CDMO_POPULATE_EXT_LEV03;
procedure CDMO_POPULATE_EXT_LEV04
is
i_level number := 4;
begin
null;
end CDMO_POPULATE_EXT_LEV04;
procedure CDMO_POPULATE_EXT_LEV05
procedure CDMO_POPULATE_EXT_LEV06
is
i_level number := 6;
begin
null;
end CDMO_POPULATE_EXT_LEV06;
end EC_CDMO_EXT;
/
commit;