Sie sind auf Seite 1von 34

R11I ORACLE E-COMMERCE

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

Copyright (C) 2002 Oracle Corporation


All Rights Reserved

Application Implementation Method


Overview 1
9/15/2002 10:27 AM
Implementation of Extension Columns Overview 2
9/15/2002 10:27 AM
Contents

Overview ........................................................................................................................................................................................5
Document Purpose ......................................................................................................................................................................5
Upgrade from Release 10.7 and 11 to Release 11i......................................................................................................................5

Additional Transaction Data........................................................................................................................................................7


Descriptive Flexfields .................................................................................................................................................................7
Extensible Architecture ...............................................................................................................................................................7

Extensible Architecture Components..........................................................................................................................................9

Implementation of an Extension Column Overview ................................................................................................................12

Example........................................................................................................................................................................................14

Customizing the Procedures.......................................................................................................................................................16


Transaction Package Generic Sample .......................................................................................................................................22

Sample Implementation Logic ...................................................................................................................................................24

Sample Log File ...........................................................................................................................................................................28

Sample Code ................................................................................................................................................................................30

Implementation of Extension Columns Overview 3


9/15/2002 10:27 AM
Implementation of Extension Columns Overview 4
9/15/2002 10:27 AM
Overview

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

Initial File Version with Extension Columns

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.

Transaction Description Oracle Application

ADVO Application Advice Multiple Applications


INO Invoice Receivables
POCO Purchase Orders Changes Procurement
POO Purchase Orders Procurement
PYO Payment and Remittance Advice Payables
SPSO Schedule Planning Supplier Scheduling
SSSO Schedule Shipping Supplier Scheduling
R11i Transaction using the R11 Extension Table Method

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.

Transation Tables in the Gateway Corresponding Extension Table

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)

Upgrade from Release 10.7 and 11 to Release 11i


There are changes in the procedures and insert statements for the Oracle e-Commerce Gateway
extension architecture from release 10.7 and 11 to release 11i. The R10.7/11 methods used
predefined extension tables for each transaction such as the outbound PO transaction.

Implementation of Extension Columns Overview 5


9/15/2002 10:27 AM
Obtain a copy of the following documents to understand each method:
Release 10.7 Oracle EDI Gateway Extension Architecture
Release 11 Oracle EDI Gateway Extension Architecture
Release 11i Oracle EDI Gateway Implementing Extension columns
This document explains the procedures to follow to enable the extension columns in select
release 11i transactions. This method does not have predefined extension tables for each
transaction. Instead the data is defined to an array in memory during processing.

Implementation of Extension Columns Overview 6


9/15/2002 10:27 AM
Additional Transaction Data
The Oracle e-Commerce Gateway provides two methods to add data elements to
transactions that are not defined in the Oracle Applications data models. The two
methods are:
Descriptive Flexfields
Extensible e-Commerce Gateway Architecture
Either method may be used separately, or both methods may be used to customize a
specific transaction to meet the business needs. Descriptive flexfields may be used for
both inbound and outbound transactions, while the Extensible Architecture feature
applies only to outbound transactions.

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.

Implementation of Extension Columns Additional Transaction Data 7


9/15/2002 10:27 AM
e-Commerce Gateway
and Extension Columns

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

Sample of Material Analyst Data being added to the DSNO transaction

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.

Implementation of Extension Columns Additional Transaction Data 8


9/15/2002 10:27 AM
Extensible Architecture Components
The following components are provided by the e-Commerce Gateway for the Extensible
Architecture.

Seeded Procedures
The Oracle e-Commerce Gateway provides packaged procedures to allow you to add
your own data to outbound transactions.

Package Body Stub Procedures within the Package Body

EC_CDMO_EXT CDMO_POPULATE_EXT_LEV01 through


CDMO_POPULATE_EXT_LEV16
EC_DSNO_EXT DSNO_POPULATE_EXT_LEV01 through
DSNO_POPULATE_EXT_LEV102
EC_GASNO_EXT GASNO _POPULATE_EXT_LEV01 through
GASNO _POPULATE_EXT_LEV09
EC_GPOAO_EXT GPOAO _POPULATE_EXT_LEV01 through
GPOAO _POPULATE_EXT_LEV07
EC_POAO_EXT POAO _POPULATE_EXT_LEV01 through
POAO _POPULATE_EXT_LEV02
EC_POCAO_EXT POCAO _POPULATE_EXT_LEV01 through
POCAO _POPULATE_EXT_LEV02
Package Bodies and Procedures

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

EXT_FIND_POS To get the index position in the Staging table.


(This utility is used with the following two utilities.)
EXT_GET_KEY_VALUE To get the data value stored in the Staging table.
EXT_INSERT_VALUE To insert your custom value into the Staging table.
Extension Utilities

These procedures and utilities involve the e-Commerce Gateway


Transaction Staging table. It is a pl/sql table called g_map_tbl.
This table contains all the transaction data before it is written to the
interface file.
It will be called the Staging table in this document.

Implementation of Extension Columns Extensible Architecture Components 9


9/15/2002 10:27 AM
ec_utils.EXT_FIND_POS
Find an index in the Staging Table.

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

Implementation of Extension Columns Extensible Architecture Components 10


9/15/2002 10:27 AM
Procedure Sample

/** 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);

/* Given the position found above, get the data value in


INVENTORY_ITEM_ID */
ec_utils.EXT_GET_KEY_VALUE(
i_pos => key1Pos,
o_value => key1);

/** 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.**/

/** Find position of your extension column and store in Ext1Pos */


ec_utils.EXT_FIND_POS(
i_level => 1,
i_search_text => DSNO_LEV04_EXT01,
o_pos => Ext1Pos);

/* Insert your data into the column found in EXT1Pos, your extension
column */
ec_utils.EXT_INSERT_VALUE(
i_pos => Ext1Pos,
o_value => CustomData1);

Implementation of Extension Columns Extensible Architecture Components 11


9/15/2002 10:27 AM
Implementation of an Extension Column Overview
The setup required to use the Extensible Architecture in the R11i e-Commerce Gateway is
a two-step process:
Activate the predefined generic extension columns so they appear in the
transaction.
Modify seeded procedures to move the external source data to the extension
columns.

Step 1: Activate the Predefined Generic Extension Column

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.

The Oracle e-Commerce Gateway transaction predefines a set of extension columns at


each level in the transaction. Usually there are fifteen, but some transactions may have
more. You will find them listed in the Transaction Layout Definition form.
The naming convention of these fields is the following:
<trans>_LEV<level number>_EXT<column number)
where
<trans> is the transaction code
<level number> is the data level number within the given transaction, and
<column number> is the extension column number within that set.

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

DSNO Extension Columns

Implementation of Extension Columns Implementation of an Extension Column Overview 12


9/15/2002 10:27 AM
You may use any record number that is used by that data level. The following is possible:
Make up your own record numbers to insert your extension record between
existing records.
It is recommended that you use the x900 records if they are not used by the
regular transaction to make the records more recognizable by you in the
transactions. This will avoid Seed Data Reconciliation conflicts, if the Gateway
should add new data at the end of an existing record.
Place any extension column at the end of existing records.
It is recommended that you use higher position numbers and not just start with
the next number in the series. This will avoid Seed Data Reconciliation conflicts,
if the Gateway should add new data at the end of an existing record and your
position numbers are higher than the one provided by the Gateway transaction.
For example, if the Gateway originally needed in position 100 on a record, and
you created position 500. Then the Gateway created position 110. Your position
500 data will be pushed out on the record and affect your data mapping, but
there will not be a Seed Data Reconciliation overlay if you had used position 110
already.

Step 2: Modify Procedures to Move Your External Source Data to the Predefined
Extension Columns

Task: Modify the provided appropriate stub procedure in the extension


package body to populate the extension column(s) with your desired
data. This data could be a calculation.
You will use two pairs of the utilities:
Set 1: EXT_FIND_POS and EXT_GET_KEY_VALUE to determine the position in
the staging tables where the KEY VALUE is positioned. You will use this value to
access your external table, then get the value for that column.
Set 2: EXT_FIND_POS and EXT_INSERT_VALUE to determine the position in
the staging tables where the Extension Column, then insert the value into the
extension column.

Step 3: Recompile the Procedure


After the procedure is changed, it must be recompiled. Details are below.

Implementation of Extension Columns Implementation of an Extension Column Overview 13


9/15/2002 10:27 AM
Example
Suppose a business assigns a material analyst to each purchased item to determine data
such as item specifications, tolerances, and quality standards. Further suppose that the
business has created a custom database table called MATERIAL_ANALYSTS to hold the
data about the material analyst. The business wishes to send contact data from this
custom table with each Ship Notice line in the event that the customer has any item-
related questions. The data the business wishes to send are from the following columns
in the custom table:
MATERIAL_ANALYST_CODE
MATERIAL_ANALYST_LAST_NAME
MATERIAL_ANALYST_FIRST_NAME
MATERIAL_ANALYST_PHONE
MATERIAL_ANALYST_EMAIL
Step 1: Activate Column to Appear in the File
First, locate the extension columns at the proper level in the Transaction Interface
Definition form. As installed, the regular and extension columns may be visualized in
the Transaction Definition form. You assign the record number, record position, data
length, record layout code, and record qualifier code to the desired number of extension
columns to activate those columns to appear in the transaction file. You may not need all
the fields that are predefined.

Step 2: Modify the Procedure


Secondly you must enter your own logic in the DSNO_POPULATE_EXT_LEV04 procedure
to move your desired data into these fields in the DSNO transaction at level 4.
Sample Transaction Columns at level 4. Record Record Record Record
Number Position Length Layout Qualifier

RLM_ATTRIBUTE11 4880 10 80 A2 LP3


RLM_ATTRIBUTE12 4880 20 80 A2 LP3
RLM_ATTRIBUTE13 4880 30 80 A2 LP3
RLM_ATTRIBUTE14 4880 40 80 A2 LP3
RLM_ATTRIBUTE15 4890 50 80 A2 LP4

DSNO_LEV04_EXT01 4900 10 50 L1 EXT


DSNO_LEV04_EXT02 4900 20 50 L1 EXT
DSNO_LEV04_EXT03 4900 30 50 L1 EXT
DSNO_LEV04_EXT04 4900 40 50 L1 EXT
DSNO_LEV04_EXT05 4900 50 50 L1 EXT
DSNO_LEV04_EXT06
DSNO_LEV04_EXT07
DSNO_LEV04_EXT08
DSNO_LEV04_EXT09
DSNO_LEV04_EXT10
through
DSNO_LEV04_EXT15
(Note: Level 04 data starts with record 3060)
DSNO Level 04 Extension columns appear at the end of Level 04 columns
External Data DSNO Transaction Columns Record Record
(Copied to Transaction Extension Number Position
Columns)

MATERIAL_ANALYST_CODE DSNO_LEV04_EXT01 4900 10


MATERIAL_ANALYST_LAST_NAME DSNO_LEV04_EXT02 4900 20
MATERIAL_ANALYST_FIRST_NAME DSNO_LEV04_EXT03 4900 30
MATERIAL_ANALYST_PHONE DSNO_LEV04_EXT04 4900 40
MATERIAL_ANALYST_EMAIL DSNO_LEV04_EXT05 4900 50
Sample Material Analyst Data to copy to the Extension Columns on Level 04

Implementation of Extension Columns Example 14


9/15/2002 10:27 AM
Step 3: Recompile the Procedure
After the procedure is changed, it must be recompiled. Details are below.

Step 4: Data Mapping to the EDI Transaction:


The extension column names are generic. See the DSNO transaction columns in the table
above. You must know what data you placed in which extension column so you can
map the correct data to the proper data element in the EDI standard transaction.
For example, the DSNO_LEV04_EXT01 maps to a field on the X12 PER segment.

Implementation of Extension Columns Example 15


9/15/2002 10:27 AM
Customizing the Procedures

Modify Procedures to Move Data to the Extension Columns

Task: Modify the Package Body Code


The following table summarizes what you need to do to copy your external data into the
extension columns. The details follow.
Step Description

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.

Implementation of Extension Columns Customizing the Procedures 16


9/15/2002 10:27 AM
Steps to Implement Extension Columns

Implementation of Extension Columns Customizing the Procedures 17


9/15/2002 10:27 AM
Step A: Locate Code
The Extensible Architecture of the Oracle e-Commerce Gateway provides packaged
procedures that may be customized to populate the extension columns with data. There
is one extension procedure for each outbound transaction. The Extension package
consists of a package body with file names in the form:
ECxxxxXB.pls
where xxxx denotes the unique three or four letter identifier for a given transaction.
These source code files are usually found in the directory:
$EC_TOP/patch/115/sql
It may be modified with any text editor. The package body requires modification in order
for your desired data to be copied into the transaction.
For example, the outbound Ship Notice (DSNO) transaction has the corresponding
extension package body ECEDSNOXB.pls. It contains the procedures that are listed in
the following table:
Level Level Description Predefined Stub Procedures Associated Extension
for the Given Level Columns

1 1 Delivery DSNO_POPULATE_EXT_LEV0 DSNO_LEV04_EXT01 through


4 DSNO_LEV04_EXT15
2 2 Delivery Attributes DSNO_POPULATE_EXT_LEV0 DSNO_LEV02_EXT01 through
2 DSNO_LEV02_EXT15
3 3 Delivery Orders (loose) DSNO_POPULATE_EXT_LEV0 DSNO_LEV03_EXT01 through
3 DSNO_LEV03_EXT15
4 4 Order Items (loose) DSNO_POPULATE_EXT_LEV0 DSNO_LEV04_EXT01 through
4 DSNO_LEV04_EXT15
5 5 Item Freight Charges (loose) DSNO_POPULATE_EXT_LEV0 DSNO_LEV05_EXT01 through
5 DSNO_LEV05_EXT15
6 6 Item Details (loose) DSNO_POPULATE_EXT_LEV0 DSNO_LEV06_EXT01 through
6 DSNO_LEV06_EXT15
7 7 Container Hierarchy DSNO_POPULATE_EXT_LEV0 DSNO_LEV07_EXT01 through
7 DSNO_LEV07_EXT15
8 8 Delivery Containers DSNO_POPULATE_EXT_LEV0 DSNO_LEV08_EXT01 through
8 DSNO_LEV08_EXT15
9 9 Delivery Orders (containerized) DSNO_POPULATE_EXT_LEV0 DSNO_LEV09_EXT01 through
9 DSNO_LEV09_EXT15
10 10 Order Items (containerized) DSNO_POPULATE_EXT_LEV1 DSNO_LEV10_EXT01 through
0 DSNO_LEV10_EXT15
11 11 Item Freight Charges DSNO_POPULATE_EXT_LEV1 DSNO_LEV11_EXT01 through
(containerized) 1 DSNO_LEV11_EXT15
12 12 Item Details (containerized) DSNO_POPULATE_EXT_LEV1 DSNO_LEV12_EXT01 through
2 DSNO_LEV12_EXT15

Procedures Found in Package Body ECDSNOXB.pls

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;

Sample Stub Procedure

Implementation of Extension Columns Customizing the Procedures 18


9/15/2002 10:27 AM
Step B: Analyze Data

Determine the following data:


Where is your source data to be copied to in the extension columns?
What column is the key to that table?
What column in the transaction has the value to be used as a search key to
that custom table?
What data level and which extension columns in that level are to receive
your data.

Step C: Modify the Procedure

Modify any procedure stub procedure to process your custom code.


The procedures are formatted PROCEDURE <Tran>_POPULATE_EXT_LEVnn
Utilities:
GOAL: Get the key value you need from the staging table using EXT_FIND_POS
to get the index position in the Staging table then use
EXT_GET_KEY_VALUE to get the data value stored in the Staging table.

Utility Utility Description


ec_utils.EXT_FIND_POS Get position and store in key1Pos *
ec_utils EXT_GET_KEY_VALUE Use position to get the data value *

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.

Utility Utility Description


ec_utils.EXT_FIND_POS Get position and store in key1Pos *
ec_utils EXT_INSERT_VALUE Insert the value into the desired extension column.

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);

Implementation of Extension Columns Customizing the Procedures 19


9/15/2002 10:27 AM
Implementation of Extension Columns Customizing the Procedures 20
9/15/2002 10:27 AM
/* Given the position of the search key, get its data value */
ec_utils.EXT_GET_KEY_VALUE(
i_pos => key1Pos,
o_value => key1);

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 **/

/** Get position and store in key1Pos */


ec_utils.EXT_FIND_POS(
i_level => 1,
i_search_text => DSNO_LEV04_EXT01,
o_pos => key1Pos);

/* Use position to get the data value */


ec_utils.EXT_INSERT_VALUE(
i_pos => key1Pos,
o_value => CustomData1);

Step D: Recompile the Procedure


Once the procedure has been modified, it must be recompiled for the changes to take
effect. Log into SQL*Plus as the APPS user, and issue the following command:
SQL> @ECDSNOXB.pls
Package body created.

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.

Implementation of Extension Columns Customizing the Procedures 21


9/15/2002 10:27 AM
Transaction Package Generic Sample
To complete the earlier example, suppose that the custom table MATERIAL_ANALYSTS
contains the column ITEM_ID to associate the material analyst contact data with a specific
purchasable item.
The transaction has the column INVENTORY_ITEM_ID that contains the value equal to
that ITEM_ID in the custom table. The value in INVENTORY_ITEM_ID is searched for in
the MATERIAL_ANALYST table.
The following modifications to the DSNO_POPULATE_EXT_LEV04 procedure extracts
the necessary data from the custom database table and inserts it into the extension
column(s).

Release 11i Procedure Sample

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);

/* Use position to get the data value */


ec_utils EXT_GET_KEY_VALUE(
i_pos => key1Pos,
o_value => key1);

/* 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;

Implementation of Extension Columns Customizing the Procedures 22


9/15/2002 10:27 AM
/* Take the data you retrieved and place it into the Staging table in the
ECE_DSNO_LEV04_EXT1 column */

/* Get position of the extension column and store in ext1Pos */


ec_utils.EXT_FIND_POS(
i_level => 1,
i_search_text => ECE_DSNO_LEV04_EXT01,
o_pos => ext1Pos);

/* 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;

Recompile the Procedure:


Recompile the procedure as noted in the previous section.

Implementation of Extension Columns Customizing the Procedures 23


9/15/2002 10:27 AM
Sample Implementation Logic

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.

Implementation of Extension Columns Sample Implementation Logic 24


9/15/2002 10:27 AM
Sample Implementation:
The following sample shows dummy implementation logic to demonstrate the process
to be followed:
Scenario. Table CDMO_CUST_TABLE contains the columns CUST_DATA1 and
INVOICE_VALUE where INVOICE_VALUE is the key to that table. CUST_DATA1 is to
be copied to the extension column CDMO_LEV01_EXT01.
The CDMO transaction has a column INVOICE_NAME that should find a match to the
INVOICE_VALUE in the custom CDMO_CUST_TABLE table. Once this table entry is
found, its data may be copied to the extension columns.

Column in Action Column in Note


CDMO transaction CDMO_CUST_TABLE
Custom table
INVOICE_NAME MATCH INVOICE_VALUE Find the location of
VALUES >> INVOICE_NAME in the
Transaction Staging table and use
Given the value its value as INVOICE_VALUE to
in the transaction, find the CDMO_CUST_TABLE
find its entry in entry.
the custom table.

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.

Implementation of Extension Columns Sample Implementation Logic 25


9/15/2002 10:27 AM
Step 2:
Use this keys value against your own table CDMO_CUST_TABLE that has the
columns CUST_DATA1 and INVOICE_VALUE.
Based on the value of the key INVOICE_NAME obtained in Step 1, retrieve the
value of CUST_DATA1.

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:

Implementation of Extension Columns Sample Implementation Logic 26


9/15/2002 10:27 AM
Now the value of the column INVOICE_NAME is known and it can be a key to any other
table such as CDMO_CUST_TABLE to derive any values that are to be inserted into the
extensible columns.
For example, custom table CDMO_CUST_TABLE contains data based on the
INVOICE_VALUE that needs to be inserted into one of the extensible columns,
CDMO_LEV01_EXT01. The procedure EXT_GET_KEY_VALUE was used to obtain the
value of INVOICE_NAME.

select CUST_DATA1 into MY_LEV01_EXT1_DATA


from CDMO_CUST_TABLE
where INVOICE_NAME = INVOICE_VALUE;

Now MY_LEV01_EXT1_DATA must be inserted into the extensible column


CDMO_LEV01_EXT01.
Note that you determine the full derivation logic to insert the values into the extensible
columns. It is mentioned here just to explain how to use the new procedures.
Step 3 Detail:
Step 3A: The procedure EXT_FIND_POSITION finds the position of any column at a
given level. It is used at this point to find the position of the desired extension column.
The returned position number will be used in EXT_INSERT_VALUE.

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.

Implementation of Extension Columns Sample Implementation Logic 27


9/15/2002 10:27 AM
Sample Log File

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

This returns the position of INVOICE_NAME


Position of INVOICE_NAME ==>57

Step 1B: Now use the procedure EXT_GET_KEY_VALUE to get the value
of
INVOICE_NAME by passing the position obtained.

Enter EC_UTILS. EXT_GET_KEY_VALUE


i_position==>57
INVOICE_NAME Value ==> Credit Memo

Exit EC_UTILS. EXT_GET_KEY_VALUE


Time Taken 0 seconds

This returns the value in the column INVOICE_NAME.


INVOICE_NAME Value => Credit Memo

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.

Data to be populated in CDMO_LEV01_EXT01 ==>

Implementation of Extension Columns Sample Log File 28


9/15/2002 10:27 AM
My Data for ext.column1 that is found in variable
MY_LEV01_EXT1_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

This returns the position of CDMO_LEV04_EXT1


CDMO_LEV04_EXT1 position :==>369

Step 3B: Now use the procedure EXT_INSERT_VALUE to insert the


value
into the column CDMO_LEV04_EXT01 by passing the position obtained
and
the value to be inserted.

Enter EC_UTILS. EXT_INSERT_VALUE


i_position==>369
i_value==>My data for ext.column1
Exit EC_UTILS. EXT_INSERT_VALUE

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:

Implementation of Extension Columns Sample Log File 29


9/15/2002 10:27 AM
Sample Code
This is a sample of the code that can be placed in any package body. It includes debug
messages.

CREATE OR REPLACE PACKAGE BODY EC_CDMO_EXT AS

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

/* A dummy table CDMO_CUST_TABLE is used to illustrate this explanation.


This table has two columns INVOICE_NAME and CUST_DATA1.

The code in this procedure does the following.


1) Gest the Value in one of a regular column (Invoice_Name).
2) Then uses this value to get the value of CUST_DATA1 from the table
CDMO_CUST_TABLE.
Stores the value of CUST_DATA1 into a variable
MY_LEV01_EXT1_DATA
3) Then inserts the value in MY_LEV01_EXT1_DATA into the extensible
column CDMO_LEV01_EXT01
*/

ec_debug.pl(3,'In Procedure CDMO_POPULATE_EXT_LEV01');


ec_debug.pl(3,'i level', i_level);

ec_debug.pl(3,'Get the position of invoice ');


ec_utils.EXT_FIND_POSITION(i_level,'INVOICE_NAME',invoice_pos);
ec_debug.pl(0,'Position of invoice number ', invoice_pos);

ec_debug.pl(3,'Get the value of Invoice name using EXT_GET_KEY_VALUE');

ec_utils.EXT_GET_KEY_VALUE(invoice_pos,invoice_value);

ec_debug.pl(0,'invoice value -> ', invoice_value);

/* Now we have the Invoice Value in the variable invoice_value.


Get the corresponding cust_data1 value from the table cdmo_cust_table
*/

ec_debug.pl(3,'Get the data which needs to populated in extensible columns');

begin

Implementation of Extension Columns Sample Code 30


9/15/2002 10:27 AM
select CUST_DATA1 into MY_LEV01_EXT1_DATA
from CDMO_CUST_TABLE
where INVOICE_NAME = INVOICE_VALUE;

ec_debug.pl(3,'Data to be populated in CDMO_lev01_ext1-> ', MY_LEV01_EXT1_

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_debug.pl(3,'Get the position of CDMO_LEV01_EXT01');


ec_utils.EXT_FIND_POSITION(i_level,'CDMO_LEV01_EXT01', ext1pos);

ec_debug.pl(0,'Position of CDMO_LEV01_EXT1 :->',ext1pos);

/* Now we have the position of the column CDMO_LEV01_EXT01 in the variable


ext1pos and the value that needs to be inserted at this position in the variable
MY_LEV01_EXT1_DATA */

ec_debug.pl(3,'Put the value of CDMO_LEV01_EXT1 using EXT_INSERT_VALUE');

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

Implementation of Extension Columns Sample Code 31


9/15/2002 10:27 AM
is
i_level number := 5;
begin
null;
end 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;

Implementation of Extension Columns Sample Code 32


9/15/2002 10:27 AM
Implementation of Extension Columns Sample Code 33
9/15/2002 10:27 AM
Implementation of Extension Columns Sample Code 34
9/15/2002 10:27 AM

Das könnte Ihnen auch gefallen