Technical Articles
ID Mapping in CPI – A Better Chance to Avoid Duplicates
Hi,
SAP just launched the new mapping ID mapping in CPI (only found it in Neo yet, but I am sure it will be soon on CF).
At first it did not make sense why this could come in use for a business case, but then got some work done with it and saw some real time value. Let us understand with 2 use cases below
Within Integration Flow
1. Files with multiple purchase orders or Files with multiple parts of same product
2. You use Splitter in CPI to send each part
3. You can not expose the Purchase Order or the Part Number itself in the header, & message id remains same for all 3 split messages.
4. If a file contains 4 purchase orders or 4 parts, with 2 repeating (duplicates), the receiver only can identify by either going to payload or if the source numbers are in headers (makes more sense on API world)
Within the whole tenant
1. We receive many messages in a day with Purchase Orders or Parts
2. Sometime same comes via different flow.
3. Again in this case as the flow is different they have different message id, so again to find duplicates the receiver need to work upon the body.
ID mapping just solves this by provisioning a method to have the same ID (like the GUID) to be passed into header without sending the exact source data. This way the ID in headers could be used by Receivers to avoid processing duplicates again. So let us get going with an actual implemented example for this.
Disclaimers & Observation
1. In my view, this could be a really good feature with the EDI projects
2. I am using a file with 4 parts in same file for making an equipment out of which the 4th part is same as first part.
3. I have generated a header with the Source Part number just for the sake of understanding, the whole point of ID Mapping is to find duplicates without having to pass the source information , so this step is just for understanding purpose.
Step 1: Look at the new palette – ID mapping. I have an iFlow where I am using Splitter to split 4 parts, then a Content Modifier to set some properties, then ID mapping and rest as usual
Step 2: A custom EDI file below with 4 parts, where 1st and 4th part are same
Step3: After the Splitter saving the part number in a property (any unique field for your case PO, SO, MATNR etc.)
- The primary key is the combination of Source Message ID & Context
- So if you use ${property.CamelSplitIndex} as Context then you will have 4 unique combinations of part1-0, part2-1, part3-2,part4-3 and then the IDs generated will be unique and duplicates wont be detected
- If you choose the Visibility to be Global then name the Context Purchase Order in all interfaces which could send PurchaseOrder, which will again make it identify the same key with combination
- Expiration period – If the message 2 arrives after 30 days of message 1 then it will have a new ID.
That is pretty much it , now let us look at the result.
Part1 –
Part4 –
So the header set in ID mapping PartNumber has the same id for Part1 and Part4, I have just kept the other header PartSource for better visibility to readers to make them understand.
I think this is cool feature but I am still skeptical about the wide range adaptability of it. Do let me know your views in the comments if your business case could use this well and how ?
Meet you in the next One
Thank you very much.
I got a question, if I try to recover a value not saving it in a property, just recovering it from de body and saving it in a Header, it also save as an ID. Do you now if there is anyway to recover de original value of the created Header instead of the ID?
Thanks again
Hi Vikas,
I'm somehow not convinced here & SAP documentation is also not straightforwad. When you get repeating messages, ID Mapping generates unique ID. What is the further step ? What we can do with the unique ID ? Still the message goes to the thrid party from CPI right ? or will it get filtered in CPI itself.. Suppose we have three records with emp id as 123, 234, 123 . The first and third record will have unique ID generated by ID Mapping. But will it filter the message and send the first occurance of 123 and 234 alone ?
Regards,
Sidharth VR