Integration Blog Posts
cancel
Showing results for 
Search instead for 
Did you mean: 
stefan_boller
Product and Topic Expert
Product and Topic Expert
2,100

Introduction

Recently, we delivered a new feature in Integration Advisor, which allows to create so called overlay mapping guidelines (overlay MAGs). Those overlay MAGs refer to a base mag, from which they inherit by default all mapping elements. The mapping elements inherited from the base MAG can be deleted, edited, and new elements can be added. In this blog post we describe with the help of a real life scenario, how such overlay MAGs can simplify your life while creating many MAGs for your different business partners.

Scenario

As an example to demonstrate the value of this new feature and how to use it we use the following simplified scenario which is inspired by a real use case: Assume you make e-business with several partners that all send their orders as UN/EDIFACT ORDERS message which you need to transform to IDoc ORDERS.ORDERS05 messages so that they can be processed in your S/4 HANA on premise system. Although all partners send UN/EDIFACT ORDERS messages there are small differences in how they send their messages. Examples of these differences are different conventions for dates or material numbers or how item descriptions are formatted. Previously, you would need to design a dedicated MAG for each partner. With the base-/overlay feature you now have the possibility to model one base MAG, which contains mapping elements which are necessary for the majority of the partners, and one dedicated overlay MAG for each partner, which contains only the deletions, additions, and overridings for the individual partner.

Preparation

For our base-/overlay mappings we need the following three MIGs:

  1. MIG 1 based on the UN/EDIFACT ORDERS message (we use the version D.21B S3 in our example, but it would work in the same way for other versions). This MIG will be used in the base MAG and all the overlay MAGs beside one as source MIG.
    Source MIG 1 (EDIFACT ORDERS)Source MIG 1 (EDIFACT ORDERS)

  2. MIG 2 based on the SAP S/4HANA On Premise IDoc ORDERS.ORDERS05 message (we use the version 1809 FPS02 in our example, but it would work in the same way for other versions). This MIG will be used in the base MAG and all the overlay MAGs as target MIG (this MIG represents our side of the communication, therefore, there is only one).
    Target MIG (IDoc ORDERS.ORDERS05)Target MIG (IDoc ORDERS.ORDERS05)

     

  3. Another MIG 3 based on the UN/EDIFACT ORDERS message. This MIG will be used in one of the overlay MAGs as alternative source MIG.
    Source MIG 2 (EDIFACT ORDERS) for Partner 2Source MIG 2 (EDIFACT ORDERS) for Partner 2

     

Creation of base and overlay MAGs

Creation of the base MAG

Now we are ready to create the base MAG. This is just a standard MAG without additional configurations. Therefore, go the the MAG overview and create a standard MAG using MIG 1 as source MIG and MIG 2 as target MIG and give it a meaningful name:

Creation of base MAG as standard MAGCreation of base MAG as standard MAG

Then you can add a couple of mapping elements to your MAG as in the following picture:

Mapping Elements of the base MAGMapping Elements of the base MAG

 You can add mapping elements of your choice, however to follow this article those elements are important:

Mapping Elements of base MAG

Source TargetComment
/Interchange/ORDERS
 /ORDERS05
 
/Interchange/ORDERS/DTM [2005 = 137]/C507/2380 [2379 = 102]
 /ORDERS05/E1EDK02/DATUM
Use date time conversion and add correct date time formats
/Interchange/ORDERS/DTM [2005 = 2]/ORDERS05/E1EDK03 [IDDAT = 002] 
/Interchange/ORDERS/DTM [2005 = 2]/C507/2380 [2379 = 102]/ORDERS05/E1EDK03 [IDDAT = 002]/DATUMUse date time conversion and add correct date time formats
002 (Constant)/ORDERS05/E1EDK03 [IDDAT = 002]/IDDAT 
/Interchange/ORDERS/SG29/ORDERS05/E1EDP01 
/Interchange/ORDERS/SG29/PIA/ORDERS05/E1EDP01/E1EDP19 [QUALF = 002] 
/Interchange/ORDERS/SG29/PIA/C212/7140/ORDERS05/E1EDP01/E1EDP19 [QUALF = 002]/IDTNR 
002 (Constant)/ORDERS05/E1EDP01/E1EDP19 [QUALF = 002]/QUALF 

Creation of first overlay MAG

Go back to the MAG overview and create the the overlay MAG for our first partner. Now you need to use the second option of the "Create"-Button to create the overlay:

Creation of first overlayCreation of first overlay

In the first step of the overlay creation wizard you must select the base MAG created in the previous steps (use the search functionality to find it):

Selection of base MAGSelection of base MAG

In the next two steps (selection of source and target MIG) we accept the standard selections, which are the source and target MIGs of the base MAG. After giving it a meaningful name and pressing create in the last step we have created our first overlay MAG:

First overlay MAG with initial mappings from base MAGFirst overlay MAG with initial mappings from base MAG

As you can see the overlay MAG has already got all the mappings inherited from the base MAG. In our example scenario, however, the first partner doesn't need the additional product id (element /Interchange/ORDERS/SG29/PIA in the source edifact interchange). Therefore, switch to edit mode, look for the corresponding elements in the mapping list table, and exclude them from the overlay MAG with the corresponding icon:

Mapping elements to excludeMapping elements to exclude

Alternatively, you can select the mapping lines and delete them via a right mouse click, which has the same effect.

Save the MAG and simulate it with the attached test payload to see if the mapping is executed correctly (note that we use the plain EDIFACT file here, see also https://help.sap.com/docs/integration-suite/sap-integration-suite/simulating-mapping-guideline).

Creation of second overlay MAG

Now we are going to create the second overlay MAG. In this example we agreed with our second partner to use a slightly different MIG 3, since they use different date time formats. The creation of the overlay MAG, however, is nearly the same like of the first one. The only difference is that we need to select a different MIG in the second step of the MAG creation wizard:

stefan_boller_1-1744902251931.png

The other steps will remain the same. Again the mapping elements of the base MAG are automatically added to the overlay MAG, but with one exception: Since the 2380 fields are qualified with a different qualifier in the source MIG and therefore handled as different fields, the corresponding mapping elements are not valid for this overlay MAG and therefore automatically excluded:

Excluded mapping elements of second overlay MAGExcluded mapping elements of second overlay MAG

 As replacement we add now two new mapping elements to the overlay MAG which use the 2380 fields with the different qualifier from the source MIG and map them to the corresponding IDoc fields with a date time conversion and a changed date time format:

New mapping elements in second overlay MAGNew mapping elements in second overlay MAG

Note: If we hadn't used the qualification feature of Integration Advisor to model the different date time formats, we nevertheless could have used the base/overlay approach and could have excluded the base date time conversion manually like in the first example and could have added the right date time conversion in exactly the same way.

Again you can use the attached payload for partner 2 to simulate the MAG and verify it.

Creation of third overlay MAG

As last example of an overlay MAG we have a partner that sends us item description which we also want to map to our IDoc structure. To model this case, we proceed like in the first example and create an overlay MAG with the same base MAG and the same source and target MIGs from the base MAG. We then switch to edit mode and add the additional mapping element (in this case a mapping of type "String Processing") as we would do in any other normal mapping:

Additional Mapping for third overlay MAGAdditional Mapping for third overlay MAG

 Again you can simulate the MAG with the attached payload.

Modification of base MAG

To illustrate the benefit of the base/overlay approach we now change something in the base MAG which is the immediately reflected in all overlay MAGs. Assume that we forgot to add the mapping for the field "/ORDERS05/E1EDP01/E1EDP01/MENEE" (Unit of measure) in our target IDoc structure. To fix this we add now a mapping line from "Interchange/ORDERS/SG29/QTY/C186/6411" to "/ORDERS05/E1EDP01/E1EDP01/MENEE" in the base MAG and save it. 

Additional mapping element of the base MAGAdditional mapping element of the base MAG

 After a refresh of the overlay MAGs we see this additional mapping element in all the overlay MAGs, e.g.:

Additional mapping element from base MAG available in overlay MAGAdditional mapping element from base MAG available in overlay MAG

Summary

In this blog post we showed how you can model a communication with a couple of partners which share a common type system, but have slightly different implementations, in an efficient manner with the newly released feature base-/overlay mapping in Integration Advisor. We explained how you create base and overlay MAGs and how you can add, override, and delete base mapping elements in the overlay MAGs.

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 in general or about Integration Advisor. You can also follow my profile if you want to read similar content in the future.

 

 

 

 

 

 

3 Comments