Hello dear SAP Integration community,
In this Blog I want to show how to use one of the powerful features in Integration Advisor - the "Pre-Transformation". This feature allows to transform the source Message Implementation Guideline (MIG) structure which significantly simplifies the logic between source and target within the Mapping Guideline (MAG).
In this case a shipment based advanced shipping notification which is a key document in collaboration between suppliers and customers is exchanged. A SOAP message is send from SAP S/4HANA which must be transformed to UN/EDIFACT and send to the specific Trading Partner.
Please note that the scope of this blog does not describe how to create and qualify MIGs. As a starting point you can refer to this blog: Create a customized interface using MIG editor
The shipment on the source side consists of multiple item segments, one with the gross details, multiple with package details and multiple with product details. They are all on the same segment level.
However, one package can contain multiple products. And that is how the target side is expecting the content.
Looking at the source payload, for each PRD item an additional segment <HierarchyRelationship> is created pointing to the relevant PKG:
And that is the information we need to do the Pre-Transformation.
In this case we have following relationship:
PKG ID | PRD ID |
10 | 150, 200, 160, 220, 230 |
70 | 170 |
90 | 180 |
110 | 190 |
130 | 210 |
So 5 Packages and 9 Products whereas one of the packages contain 5 products.
Let's jump into the MAG:
What do we want to do exactly?
We want to copy the item segments qualified with PRD into the item segment qualified with PKG where the IDs are matching.
Which can be achieved by the following:
Let's see what the result looks like.
Here on the right side (After Pre-Transformation) we can see that inside Item (Package) another node has been created - Item_gq_PRD_Copy. The first package with ID=10 has 5 Item_gq_PRD_Copy elements (see the yellow highlighted area). Inside the first package the first product has the ID=150. Now let's look at the second product:
Here we can see that it has the ID=200. And this matches with the table above.
In this blog article we showed the powerful and easy to use feature of the Pre-Transformation, where we transformed the source structure in such a way that it matches the structure of the target which expects to group all products belonging to one package.
Especially in this case, the Pre-Transformation helps to avoid building complex mapping logics which is also an essential aspect and which will be beneficial for operations.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
30 | |
19 | |
15 | |
14 | |
10 | |
8 | |
7 | |
7 | |
7 | |
7 |