[OPTIONAL] Define the mapping - Manual Steps

[OPTIONAL] Define the mapping - Manual Steps

Note that there are 2 different approaches for this tutorial step.

You can do the first approach, Import Mapping to save some time.

You can instead do the second approach, Manual steps, which will teach you about how to create such mappings.

In this lesson, you will follow the Manual Steps approach.

  1. In the contextual menu of the mapping flow step, click on the create button.

Chap_3
  1. Enter the following name as mapping name: MM_APP_TO_S4 In the mapping editor we will now select the source and the target message structures.

  2. Click on Add source message and then on Upload from file system

  3. Select the OpenAPISpec.json file from your local device (that you copied at the beginning of the Technical Academy). You can download that file again from here.

  4. In the next steps, select the right message structure from the OpenAPI specification

    1. /Orders
    2. POST
    3. REQUEST
  5. Click on Add target message

  6. Select the A_SalesOrderEntityPOST.xsd message structure. It has been created when you defined the processing details of the OData adapter.

  7. Your mapping should look like this for now:

Chap_3

Create the Full Mapping in the Cloud Integration Service

Mapping is one of the most important parts in an integration project hence we will spend some time in the mapping editor now, in order to build the following mapping:

Chap_3

Note

the next steps will guide you through creating a full mapping in the Cloud Integration service.
  1. Click and hold the source field on the left side and drag the end of the line to the target field on the right side.

  2. Repeat for the following fields:

    1. CustomerID -> SoldToParty

    2. ProductID -> to_Item / A_SalesOrderItemType / Material

    3. Quantity -> to_Item / A_SalesOrderItemType / RequestedQuantity

    4. OrderReference -> PurchaseOrderByCustomer

    The result will look something like this:

    Chap_3
    • As you can see, some fields will require (based on the schema definition) some values. However, these values are of no importance because they will be created in the S/4 HANA system when an order is created. To stay compliant with the data model, simply assign a constant to these fields.
  3. Hover over the A_SalesOrderType target message field on the right and click on the symbol that appears.

  4. Select Assign constant.

    Chap_3
  5. Repeat for the following fields:

    1. to_Item
    2. A_SalesOrderItemType

    The end result looks something like this.

    Chap_3
    • As you can see, the target message is still missing some fields. The values of these fields could be calculated, looked up or sent by the calling system, but in our example, we will simply assign constants to them.

    In the next steps, you will see how easy it is, in a no-code approach, to dynamically fill fields during mapping. If needed, coding can be added though.

  6. Hover over the SalesOrderType target message field on the right and click on the symbol that appears (as you did before).

  7. Select Assign constant.

  8. Navigate to the Mapping Expression at the bottom of your screen, and resize it as needed.

  9. In the Constant field of the mapping expression, enter OR.

    Your mapping expression should look like this:

    Chap_3
  10. Just as you did before, assign constants and their values to the following fields:

    1. SalesOrganization: 1710
    2. DistributionChannel: 10
    3. OrganizationDivision: 00

    Your mapping should now look something like this:

    Chap_3
  11. Click on OK in the mapping editor and Save your integration flow.