Skip to Content

Create two different IDoc types using Multi-Mapping?

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

.

multipleidocs.png (16.0 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jul 24, 2020 at 05:38 PM

    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-for-a-xml-message-split/

    Best regards, Peter

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 22, 2020 at 08:36 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.