Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
stefan_boller
Product and Topic Expert
Product and Topic Expert
594

Introduction

Recently, we have introduced a new feature in Integration Advisor for the duplication of target nodes. This feature allows the duplication of leaf as well as group nodes of a target Message Implementation Guideline (MIG) in the Message Guideline (MAG) editor. This feature helps in special mapping situations where you have two sources which must be mapped to (multiple instances of) the same target node.

In this blog post, I will show a scenario which illustrates some of the benefits of this new feature when applying it to the duplication of leaf nodes. In a previous article, a scenario with group nodes was presented.

Scenario

We use a similar scenario like in the previous article: Assume you have a source MIG based on UN/EDIFACT message ORDERS (version D.21B S3, e.g.) which shall be mapped to an SAP IDoc ORDERS.ORDERS05. But now we consider the mapping between the date time segments (the document date) in the header. You agreed with your partner, which sends the UN/EDIFACT ORDERS message, that they can use one of two date time formats: CCYYMMDD or CCYYMMDDHHMMSS. However, on your own side, which receives the SAP IDoc ORDERS.ORDERS05, you want to have both the date (DATUM) and the time field (UZEIT) filled, the latter set to 120000 (noon) by default, if the sender doesn't specify a time. Furthermore, you again want to use Integration Advisor's Date Time Conversion for the mapping:

stefan_boller_0-1717678327781.png

Solution

Mapping in a classical way, you would map source node 2380 to both target nodes DATUM and UZEIT. Because of the two different source formats, you would need to implement two mapping functions (e.g. using if-statements) and wouldn’t be able to make use of the in-built date time conversion.

Integration Advisor offers you here a more elegant solution: In the Edifact source MIG, you can qualify node 2380 (Date or time) based on the value of node 2379 (Date or time format code). As a result, your source MIG structure now shows two different nodes 2380 [2379 = 102] and 2380 [2379 = 204]. For each of the nodes, the date time format is fixed and known. Please note that in the payload only one of the 2380 nodes will be filled.

Now you can use duplication of leaf target nodes in your mapping: Duplicate the DATUM field as well as the UZEIT field (see Duplicate Target Nodes) of the target MIG and map the source field 2380 [2378 = 102] to the first instances and the source field 2380 [2379 = 204] to the second instances:

stefan_boller_1-1717678941786.png

Now switch all four mappings to "Date Time Mapping":

stefan_boller_0-1717681555125.png

And select the right date time formats, e.g.:

stefan_boller_1-1717681779568.png

In this example you can also see how you can specify fixed values for target date time fields, for which there is no source field available. Now you can simulate the mapping with the attached example payloads:

  1.  Example with DTM in format 102
    stefan_boller_1-1717683203122.png
  2. Example with DTM in format 204
    stefan_boller_0-1717683098382.png

Summary

In this blog article we showed how we can use the duplicate target nodes feature for solving a mapping challenge which involves leaf nodes in contrast to the previous article, which considered group nodes. We also would be happy to know more about your use cases for this new feature.
Please, share your ideas and feedback in a comment. Furthermore, you can follow the SAP Integration Suite topic page to get to know more about Integration Suite in general, or read other posts about Integration Advisor. You can also follow my profile if you want to read similar content in the future.

1 Comment