SAP Connector > Part IV: Data Integration using SAP Table > Mappings and mapping tasks with SAP Table > Mapping with an SAP Table source example
  

Mapping with an SAP Table source example

You can create a mapping to read data from a single SAP object and write the data to a target object.
You can read data from an SAP purchasing document header, the EKKO table, and write the purchasing details to any target.
In this example to read data from the EKKO table and write the data to a flat file target object, perform the following steps:
  1. 1. Define the mapping.
  2. 2. To configure an SAP Table source, select an SAP Table connection and select the EKKO table.
  3. 3. To configure a flat file target, select a flat file connection, specify a flat file object, and map the source and target fields.
  4. 4. Save the mapping and create a mapping task.

Step 1: Define the mapping

    1. To create a mapping, click Data Integration > New > Mappings. Select Mapping and click Create.
    2. Enter a name and description for the mapping.
    The following image shows the New Mapping dialog box:
    The name of the mapping that you want to map with an SAP Table source.
    3. Click OK.

Step 2: Configure the SAP Table source

    1. To configure an SAP source, on the Transformation palette, click Source.
    2. In the Properties panel, on the General tab, enter a name and description.
    3. Click the Source tab to configure source details.
    4. Specify an SAP Table connection as the source object connection.
    5. Specify the source type as Single Object and click Select.
    6. In the Select Source Objectdialog box, select the EKKO table,
    7. Click Query Options in the Source tab to specify any filter and sort options for the SAP Table object.
    8. Click Advanced to specify the advanced source properties.
    The following image shows the source details page:
    The configured source properties to map with an SAP Table source.

Configure an ABAP CDS view as an SAP source

To read from an ABAP CDS view, configure the ABAP CDS view as the source in a mapping.
    1. On the Transformation palette, click Source.
    2. In the Properties panel, on the General tab, enter a name and description.
    3. Click the Source tab to configure source details.
    4. Specify an SAP Table connection as the source object connection.
    5. Specify the source type as Single Object and click Select.
    6. In the Select Source Objectdialog box, select the CDS view object:
    The following image displays a CDS view object:
    7. When you select a CDS view, on the Fields tab, you can view the mandatory and optional parameters:
    8. Click Query Options in the Source tab to specify any filter and sort options for the CDS view:
    The following image shows the basic filter options configured for the CDS view:
    9. Click Advanced to specify the advanced source properties.

Configure an ABAP CDS view as a lookup

You can configure an uncached lookup in a mapping to look up data in an ABAP CDS view.
    1. From the Transformation palette, add a lookup.
    2. In the Properties panel, on the General tab, enter a name and description.
    3. On the Lookup Object tab, configure the lookup object details.
    1. a. Specify an SAP Table connection for the lookup object.
    2. b. Specify the source type as Single Object.
    3. c. In the Lookup Object field, click Select, and then select the CDS view object as the lookup object.
    4. On the Lookup Condition tab, specify the lookup condition:
    5. On the Advanced tab, do not select the Lookup Caching Enabled checkbox, and then specify the lookup properties:

Step 3: Configure the flat file target

    1. To add a flat file Target transformation, on the Transformation palette, click Target.
    2. On the General tab, enter a name and description.
    3. Draw a link to connect the Source transformation to the Target transformation.
    4. Click the Target tab to configure the flat file target details.
    5. Specify a flat file connection as the target connection.
    6. Select the target type as Single Object and click Select.
    7. Specify a flat file object.
    The following image shows the target details:
    The configured flat file target details.
    8. To preview fields, click Incoming Fields.
    The following image shows the incoming field details:
    The configured incoming fields to map with an SAP Table source.
    9. Click Field Mapping and map the fields that you want to write to the target.
    The following image shows the field mapping details:
    The configured field mapping details in the Field Mapping tab.

Step 4: Save the mapping and create a mapping task

    1. Click Save > Save and New Configuration Task.
    The New Mapping Task page appears.
    2. Enter a name and description for the task.
    3. Select the runtime environment that contains the Secure Agent you want to use to access SAP tables.
    The following image shows the mapping task details:
    The configured mapping task details to map with an SAP Table source.
    4. Click Nextto configure the schedule and advanced options.
    5. Save and run the mapping task.