cancel
Showing results for 
Search instead for 
Did you mean: 

IDoc to Multiple Files: Mapping-Based Split

JaySchwendemann
Active Contributor
0 Kudos

Hi all,

I have a simple IDoc to file scenario set up. All is running well. However, I now have to create multiple files according to the number of TANUMS (Transportation Numbers) in my sending IDoc. I already checked those two blogs (/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool and /people/jin.shin/blog/2006/02/07/multi-mapping-without-bpm--yes-it146s-possible) but failed to get the whole picture.

How Do I have to set up the mapping. Especially: Do I need to use node functions like "splitbyvalue" and if so, how. Like said, i want to create a new file for every occurence of TANUM.

Thanks a lot.

Cheers Jens

Here is my sending IDoc Structure

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

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
   <ns0:Message1>
      <_-SCWM_-WMCAID01>
         <IDOC BEGIN="">
            <EDI_DC40 SEGMENT="">
               <TABNAM/>
               <MANDT/>
               <DOCNUM/>
               <DOCREL/>
               <STATUS/>
               <DIRECT/>
               <OUTMOD/>
               <EXPRSS/>
               <TEST/>
               <IDOCTYP/>
               <CIMTYP/>
               <MESTYP/>
               <MESCOD/>
               <MESFCT/>
               <STD/>
               <STDVRS/>
               <STDMES/>
               <SNDPOR/>
               <SNDPRT/>
               <SNDPFC/>
               <SNDPRN/>
               <SNDSAD/>
               <SNDLAD/>
               <RCVPOR/>
               <RCVPRT/>
               <RCVPFC/>
               <RCVPRN/>
               <RCVSAD/>
               <RCVLAD/>
               <CREDAT/>
               <CRETIM/>
               <REFINT/>
               <REFGRP/>
               <REFMES/>
               <ARCKEY/>
               <SERIAL/>
            </EDI_DC40>
            <_-SCWM_-E1LTCAH SEGMENT="">
               <LGNUM/>
               <WHO/>
               <CNAME/>
               <CANRQ/>
               <CANCL/>
               <_-SCWM_-E1LTCAI SEGMENT="">
                 <TANUM/>
                  <VLENR/>
                  <NLENR/>
                  <SFEHL/>
                  <SFTXT/>
               </_-SCWM_-E1LTCAI>
               <_-SCWM_-E1LTCAI SEGMENT="">
                  <TANUM/>
                  <VLENR/>
                  <NLENR/>
                  <SFEHL/>
                  <SFTXT/>
               </_-SCWM_-E1LTCAI>
            </_-SCWM_-E1LTCAH>
         </IDOC>
      </_-SCWM_-WMCAID01>
   </ns0:Message1>
</ns0:Messages>

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Yes..you need to use split value. Change the occurance of target message to 0..unbounded as mentioned in blog.

TANUM -> Split By Value (each value) -> Collapse contexts -> Root Node of Target MT.

ID - Use enhanced interface determination and select the 1: n mapping.

former_member191435
Contributor
0 Kudos

Hi,

TANUM (Changed Contexts to top level) -


> splitby value -


> target.

If you want for every new value of TANUM then use splitby value( Value change) .

If you want for ever field of TANUM then use split by value (Each Value).

If u face any issue let me know.

Thanks,

Enivas.

JaySchwendemann
Active Contributor
0 Kudos

Ok, thanks so far, I got that using splitByValue is a key figure to solve this problem. However, say I have the same Messagetype on the target side (Receiver wants to have full IDoc as XML)...

<ol>

<li>I then do need to Map TANUM (Context -SCWM-WMCAID01) --> SplitByValue --> -SCWM-WMCAID01, right?</li>

<li>What about the next subsequent nodes like "IDOC" and "EDI_DC40" and "_-SCWM_-E1LTCAH". Do they also have to be mapped like TANUM (Context -SCWM-WMCAID01) --> SplitByValue --> [NodeName]?</li>

<li>What about the elements beneath the respective nodes, like "TABNAME" beneath the "EDI_DC40" node. How would you be mapping those?</li>

</ol>

Thanks again.

Cheers