cancel
Showing results for 
Search instead for 
Did you mean: 

Create two different IDoc types using Multi-Mapping?

peter_wallner2
Active Contributor
0 Kudos

Dear experts,

I am receiving XML files from a 3rd party.
This is the challenge: these files contain multiple business documents. I have to create ORDCHG (update sales order) and SHPCON (update outbound delivery) IDocs from these, depending on a field in the payload "DELIVERY_NO":

Is this possible? Can I do this using a multi-mapping, I looked at this blog for example: https://blogs.sap.com/2011/02/24/multi-mapping-without-bpm-for-idoc-scenarios-yes-it-s-possible/
But my target message would be 2 different IDoc types, so my structure would look like this:

<?xml version="1.0" encoding="UTF-8"?>
<DELVRY07>

<IDOC BEGIN="1">
...
</DELVRY07>
<ORDERS05>

<IDOC BEGIN="1">
...
</ORDERS05>

I appreciate any input on this. Thank you.

Best regards, Peter

.

Accepted Solutions (1)

Accepted Solutions (1)

peter_wallner2
Active Contributor
0 Kudos

Hello,

I solved this not using a multi-mapping but using the EDI Separator. This blog was helpful:

https://blogs.sap.com/2016/11/16/part-2-split-ups-are-hard-using-the-sap-b2b-edi-separator-adapter-f...

Best regards, Peter

Answers (1)

Answers (1)

sugata_bagchi2
Active Contributor
0 Kudos

Hi Peter,

You can split the message using condition and execute 2 different mappings. 1 for SHPCON and the other for ORDCHG.

The condition will check the existence of the field delivery no, if that is not blank execute the SHPCON else the ORDCHG.

In case of multiple Order detail segments, you can create a SHPCON and ORDCHG IDoc xsds with 0..unbounded occurrence.

Hope I understood your requirement correctly.

Thanks

Sugata

peter_wallner2
Active Contributor
0 Kudos

Hello Sugata,
this is what I have currently now which works well if I receive a file with DELIVERY_NO filled on all ORDER_DETAIL.
Or with DELIVERY_NO empty on all ORDER_DETAIL

The condition only checks the first occurrence. So if there is a mix the condition is not catching it. So from what I see the split needs to happen in the mapping, correct?

Best regards, Peter