Skip to Content
0
Former Member
May 15, 2008 at 12:36 PM

MultiMapping Split 1 to N issue

9 Views

Hi all,

in my scenario I have to realize a Message Mapping (with MultiMapping) to split 1 MT into N others MT of the same type (Message Instance Level).

I summarize in following the MT-source and MT-target structures.

Source MT Structure (Messages Occurrence 1)

<Messages>						1..1
   <Message1>						1..1
      <MT_SPLIT>					1..1
         <PAYLOAD>				        0..1
            <B001>				        0..N
               <PAYLOAD1>				1..1
                  <KEY1>K1A</KEY1>			1..1
                  <VALUE>V1A</VALUE>		        1..1
            <B002>					0..N
               <PAYLOAD2>				1..1
                  <KEY2>K2C</KEY2>			1..1
                  <VALUE>V2C</VALUE>		        1..1

Target MT Structure (Messages Occurrence 0..UNBOUNDED)

<Messages>						1..1
   <Message1>						1..1
      <MT_SPLIT>					0..N
         <PAYLOAD>				        0..1
            <B001>				        0..N
               <PAYLOAD1>				1..1
                  <KEY1>K1A</KEY1>			1..1
                  <VALUE>V1A</VALUE>		        1..1
            <B002>					0..N
               <PAYLOAD2>				1..1
                  <KEY2>K2C</KEY2>			1..1
                  <VALUE>V2C</VALUE>		        1..1

In this way I need to realize the type of behaviour shown in the following example.

Source Instance

<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
   <ns0:Message1>
      <ns1:MT_SPLIT xmlns:ns1="http://test.com">
         <PAYLOAD>
            <B001>
               <PAYLOAD1>
                  <KEY1>K1A</KEY1>
                  <VALUE>V1A</VALUE>
               </PAYLOAD1>
            </B001>
            <B001>
               <PAYLOAD1>
                  <KEY1>K1B</KEY1>
                  <VALUE>V1B</VALUE>
               </PAYLOAD1>
            </B001>
            <B002>
               <PAYLOAD2>
                  <KEY2>K2A</KEY2>
                  <VALUE>V2A</VALUE>
               </PAYLOAD2>
            </B002>
            <B002>
               <PAYLOAD2>
                  <KEY2>K2B</KEY2>
                  <VALUE>V2B</VALUE>
               </PAYLOAD2>
            </B002>
            <B002>
               <PAYLOAD2>
                  <KEY2>K2C</KEY2>
                  <VALUE>V2C</VALUE>
               </PAYLOAD2>
            </B002>
         </PAYLOAD>
      </ns1:MT_SPLIT>
   </ns0:Message1>
</ns0:Messages>

Target Instance (my target result)

<?xml version="1.0" encoding="UTF-8" ?> 
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
   <ns0:Message1>
      <ns1:MT_SPLIT xmlns:ns1="http://test.com">
         <PAYLOAD>
            <B001>
               <PAYLOAD1>
                  <KEY1>K1A</KEY1> 
                  <VALUE>V1A</VALUE> 
               </PAYLOAD1>
            </B001>
         </PAYLOAD>
      </ns1:MT_SPLIT>
      <ns1:MT_SPLIT xmlns:ns1="http://test.com">
         <PAYLOAD>
            <B001>
               <PAYLOAD1>
                  <KEY1>K1B</KEY1> 
                  <VALUE>V1B</VALUE> 
               </PAYLOAD1>
            </B001>
         </PAYLOAD>
      </ns1:MT_SPLIT>
      <ns1:MT_SPLIT xmlns:ns1="http://test.com">
         <PAYLOAD>
            <B002>
               <PAYLOAD2>
                  <KEY2>K2A</KEY2> 
                  <VALUE>V2A</VALUE> 
               </PAYLOAD2>
            </B002>
         </PAYLOAD>
      </ns1:MT_SPLIT>
      <ns1:MT_SPLIT xmlns:ns1="http://test.com">
         <PAYLOAD>
            <B002>
               <PAYLOAD2>
                  <KEY2>K2B</KEY2> 
                  <VALUE>V2B</VALUE> 
               </PAYLOAD2>
            </B002>
         </PAYLOAD>
      </ns1:MT_SPLIT>
      <ns1:MT_SPLIT xmlns:ns1="http://test.com">
         <PAYLOAD>
            <B002>
               <PAYLOAD2>
                  <KEY2>K2C</KEY2> 
                  <VALUE>V2C</VALUE> 
               </PAYLOAD2>
            </B002>
         </PAYLOAD>
      </ns1:MT_SPLIT>
  </ns0:Message1>
</ns0:Messages>

Does anyone suggest me some ideas?

Thanks in advance,

Gianluca