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:

  1. Create the Mapping
  2. Define the Source and Target Datastores
  3. Define Joins between Sources
  4. Create the Mappings
  5. Define the Mapping Flow

Create the Mapping

  1. Open Designer.

  2. In the Projects tree view, expand the SAP Demo Project.

  3. Expand the SDE_SAP_GeoDimension folder.

  4. Select the Mappings node.

  5. Right-click and select New Mapping.

  6. In the Mapping Definition tab, enter the mapping name: SDE_SAP_GeoDimension.W_GEO_DS.

  7. Save the mapping.

Define the Source and Target Datastores

To define the source and target datastores:

  • In the Models tree view, select the WS_GEO_DS datastore from the Oracle Target Model.

  • 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 Names datastore from the SAP ERP Source model.

  • Drag this datastore into the Sources area of the Logical diagram.

  • Perform the same operation for the T005U Taxes: Region Key datastore from the SAP ERP Source model. The Sources area of the Logical diagram should look as shown below:

Define Joins between Sources

To create joins between the source datastores of a mapping:

  1. In the Sources area of the Logical diagram drag the SPRAS attribute from the T005T Country Name datastore onto the SPRAS attribute in the T005U Taxes: Region Key datastore.

  2. 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:

  3. Drag the LAND1 attribute from the T005T Country Name datastore onto the LAND1 attribute in the T005U Taxes: Region Key datastore. 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

  4. 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:

  5. Make sure that table number of T005U is smaller than that of T005T. In 1:n relationships the parent table has to be the first in a join.

Create the Mappings

To create the mappings of the target datastore:

  1. Select the LANGUAGE KEY attribute from the target datastore.

  2. Drag the SPRAS attribute from the T005T Country Names source datastore onto the LANGUAGE KEY attribute of the target datastore.

  3. Make sure that the Execution on Hint option is set to Source. The mapping should look as shown below:

  4. 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

Define the Mapping Flow

To define the mapping flow:

  1. Select the Logical diagram. The Flow diagram looks as shown below;

  2. In the target group, select the access point for the source group that contains both the T005T and T005U datastores. This source group represents the source dataset made up of two joined SAP ERP datastores.

  3. In the Property panel, under Loading Knowledge Module, select LKM SAP ERP to Oracle (SQLLDR) or LKM SAP ERP to SQL from the Loading Knowledge Module drop-down list.

    1. 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, select NONE.

    2. Leave other options as they are.

  4. In the target group, select the target Oracle database, which is also used as the staging area for this mapping.

  5. In Property panel, under Integration Knowledge Module, select IKM Oracle Incremental Update from the Integration Knowledge Module drop-down list.

  6. Set the IKM options as follows:

    1. Select No for the FLOW_CONTROL option.

    2. Leave other options as they are.

  7. From the File menu, click Save and close your mapping.