6 Creating and Running the Mapping
This chapter includes the following sections.
6.1 Creating the Mapping
Now that the source and target data models are created, it is possible to create a mapping to integrate data from the T005T and T005U SAP tables to the WS_GEO_DS Oracle table.
To create the mapping, perform the following steps:
6.1.1 Create the Mapping
-
Open Designer.
-
In the Projects tree view, expand the
SAP DemoProject. -
Expand the
SDE_SAP_GeoDimensionfolder. -
Select the Mappings node.
-
Right-click and select New Mapping.
-
In the Mapping Definition tab, enter the mapping name:
SDE_SAP_GeoDimension.W_GEO_DS. -
Save the mapping.
6.1.2 Define the Source and Target Datastores
To define the source and target datastores:
-
In the Models tree view, select the
WS_GEO_DSdatastore from theOracle TargetModel. -
Drag this datastore into the Target Datastore area of the Logical diagram. (Right area of the Logical diagram)
-
In the Models tree view, select the
T005T Country Namesdatastore from theSAP ERP Sourcemodel. -
Drag this datastore into the
Sourcesarea of the Logical diagram. -
Perform the same operation for the
T005U Taxes: Region Keydatastore from theSAP ERP Sourcemodel. The Sources area of the Logical diagram should look as shown below:
6.1.3 Define Joins between Sources
To create joins between the source datastores of a mapping:
-
In the Sources area of the Logical diagram drag the SPRAS attribute from the
T005T Country Namedatastore onto theSPRASattribute in theT005U Taxes: Region Keydatastore. -
On the Create Lookup or Join popup, select Join and click OK. This defines the first join on the Language Key identifier, as shown below:
-
Drag the
LAND1attribute from theT005T Country Namedatastore onto theLAND1attribute in theT005U Taxes: Region Keydatastore. The join is extended with the new attributes. In the Properties panel, you can see the join clause:T005T.SPRAS=T005U.SPRAS AND T005T.LAND1=T005U.LAND1 -
In the Properties panel, select Generate ANSI Syntax and Join Order options, and make sure that the Execute on Hint option is set to Source as shown below:
-
Make sure that table number of
T005Uis smaller than that ofT005T. In 1:n relationships the parent table has to be the first in a join.
6.1.4 Create the Mappings
To create the mappings of the target datastore:
-
Select the
LANGUAGE KEYattribute from the target datastore. -
Drag the
SPRASattribute from theT005T Country Namessource datastore onto the LANGUAGE KEY attribute of the target datastore. -
Make sure that the Execution on Hint option is set to Source. The mapping should look as shown below:
-
Repeat this operation to perform the following simple mappings:
-
W_GEO_DS.COUNTRY = T005T.LAND1 -
W_GEO_DS.COUNTY = T005T.LANDX -
W_GEO_DS.STATE_PROV = T005U.BLAND -
W_GEO_DS.NATIONALITY = T005T.NATIO
6.1.5 Define the Mapping Flow
To define the mapping flow:
-
Select the Physical diagram. The Physical diagram looks as shown below;
-
In the target group, select the access point for the source group that contains both the
T005TandT005Udatastores. This source group represents the source dataset made up of two joined SAP ERP datastores. -
In the Property panel, under Loading Knowledge Module, select
LKM SAP ERP to Oracle (SQLLDR)orLKM SAP ERP to SQLfrom the Loading Knowledge Module drop-down list.-
If you are using FTP for the data transfer, please set the FTP_TRANSFER_METHOD option to
FTP. If the FTP server is installed on your ODI agent machine, selectNONE. -
Leave other options as they are.
-
-
In the target group, select the target Oracle database, which is also used as the staging area for this mapping.
-
In Property panel, under Integration Knowledge Module, select
IKM Oracle Incremental Updatefrom the Integration Knowledge Module drop-down list. -
Set the IKM options as follows:
-
Select
Nofor the FLOW_CONTROL option. -
Leave other options as they are.
-
-
From the File menu, click Save and close your mapping.
6.2 Running the Mapping
This section contains the following topics.
6.2.1 Running the Mapping
To run the mapping:
-
In the Projects tree view, expand the
SAP DemoProject -
Expand the
SDE_SAP_GeoDimensionfolder. -
Expand the Mappings node.
-
Select the
SDE_SAP_GeoDimension.W_GEO_DSmapping. -
Right-click and select Execute.
-
In the Execution window that appears, click OK.
-
Click OK in the Session Started window.
What happens when you run the mapping?
First, Oracle Data Integrator creates an ABAP program that does the following:
-
It performs the extraction of the data on the SAP engine. In this example, the extraction joins the two source tables and then returns the joined resultset in an extraction file.
-
It uploads the extraction file into a FTP data server. This FTP host is specified via the File Logical Schema called
File Server for SAP ABAP. This Logical Schema is mapped to a Physical Schema and therefore a data server in the given context. This data server contains the connection information for the FTP host.
Then, the ABAP code is uploaded using the OdiSapAbapExecute tool. The ABAP program is pushed into the SAP Function group given in the SAP_FUNCTION_GROUP LKM option. This phase can be suppressed by setting the UPLOAD_ABAP_CODE LKM option to No.
The ABAP code is executed also by the OdiSapAbapExecute tool. At the end of the ABAP code execution, the extraction file is available in the FTP host.
The Oracle Data Integrator agent is able to download this extraction file from the FTP host, or directly access it, depending on the FTP_TRANSFER_METHOD specified in the IKM option.
Finally, when the agent accesses the extraction file, it uses SQL*Loader or a JDBC Connection to load this file into the Oracle/non-Oracle staging area. The rest of the integration process takes place within the Oracle/non-Oracle engine.
6.2.2 Review the Mapping Execution
To review the mapping execution:
-
Connect to Operator.
-
In the Operator, select the Session List tree view.
-
Expand the All Executions node in this tree view.
-
The latest session is the first entry of this list.
-
Double click the
SDE_SAP_GeoDimension.W_GEO_DSnode to see the session details and the number of lines processed.




