<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: Split many elements in others many elements in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536314#M2059366</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I  got a answer for you... replicated same scenario in my IR,  could test that and it is working great..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do you want me to send screen shots? or I can explain it to you..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fields are mapped like this;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 1)&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;MATNR&lt;/EM&gt; ---&amp;gt; removeContexts ---&amp;gt;MATERIAL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  where &lt;EM&gt;MATNR&lt;/EM&gt;  context is changed to SERVICE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SRVNR -&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&amp;gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MATERIAL -&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&amp;gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;MATNR&lt;/EM&gt; -&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="------" /&gt;&amp;gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;in the same order all 3 fields go to -&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&amp;gt; useOneAsMany -&lt;HR originaltext="-----" /&gt;&amp;gt; SplitByValue(Each Value) -&lt;HR originaltext="----" /&gt;&amp;gt; SRVNR&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;again &lt;EM&gt;MATNR&lt;/EM&gt;  context is changed to SERVICE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 3)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;MATNR&lt;/EM&gt; ---&amp;gt; SplitByValue(Each Value) -&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----" /&gt;&amp;gt;MATNR&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;again &lt;EM&gt;MATNR&lt;/EM&gt;  context is changed to SERVICE ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this should work for you.. please do try.. I have invested time to do this &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Apr 2009 20:51:08 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-22T20:51:08Z</dc:date>
    <item>
      <title>Split many elements in others many elements</title>
      <link>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaq-p/5536309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I have to follow source XML to map to receiver XML:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
source
....
&amp;lt;SERVICE&amp;gt;
  &amp;lt;SRVNR&amp;gt;1001&amp;lt;/SRVNR&amp;gt;
  &amp;lt;MATERIAL&amp;gt;
    &amp;lt;MATNR&amp;gt;QWERT&amp;lt;/MATNR&amp;gt;
  &amp;lt;/MATERIAL&amp;gt;
  &amp;lt;MATERIAL&amp;gt;
    &amp;lt;MATNR&amp;gt;ASDFG&amp;lt;/MATNR&amp;gt;
  &amp;lt;/MATERIAL&amp;gt;
&amp;lt;/SERVICE&amp;gt;
&amp;lt;SERVICE&amp;gt;
  &amp;lt;SRVNR&amp;gt;2002&amp;lt;/SRVNR&amp;gt;
&amp;lt;/SERVICE&amp;gt;
&amp;lt;SERVICE&amp;gt;
  &amp;lt;SRVNR&amp;gt;3003&amp;lt;/SRVNR&amp;gt;
  &amp;lt;MATERIAL&amp;gt;
    &amp;lt;MATNR&amp;gt;ZXCVB&amp;lt;/MATNR&amp;gt;
  &amp;lt;/MATERIAL&amp;gt;
&amp;lt;/SERVICE&amp;gt;
....

receiver must be as follow
....
&amp;lt;MATERIAL&amp;gt;
  &amp;lt;SRVNR&amp;gt;1001&amp;lt;/SRVNR&amp;gt;
  &amp;lt;MATNR&amp;gt;QWERT&amp;lt;/MATNR&amp;gt;
&amp;lt;/MATERIAL&amp;gt;
&amp;lt;MATERIAL&amp;gt;
  &amp;lt;SRVNR&amp;gt;1001&amp;lt;/SRVNR&amp;gt;
  &amp;lt;MATNR&amp;gt;ASDFG&amp;lt;/MATNR&amp;gt;
&amp;lt;/MATERIAL&amp;gt;
&amp;lt;MATERIAL&amp;gt;
  &amp;lt;SRVNR&amp;gt;3003&amp;lt;/SRVNR&amp;gt;
  &amp;lt;MATNR&amp;gt;ZXCVB&amp;lt;/MATNR&amp;gt;
&amp;lt;/MATERIAL&amp;gt;
....

but the result is below
&amp;lt;MATERIAL&amp;gt;
  &amp;lt;SRVNR&amp;gt;1001&amp;lt;/SRVNR&amp;gt;
  &amp;lt;MATNR&amp;gt;QWERT&amp;lt;/MATNR&amp;gt;
&amp;lt;/MATERIAL&amp;gt;
&amp;lt;MATERIAL&amp;gt;
  &amp;lt;SRVNR&amp;gt;2002&amp;lt;/SRVNR&amp;gt;
  &amp;lt;MATNR&amp;gt;ASDFG&amp;lt;/MATNR&amp;gt;
&amp;lt;/MATERIAL&amp;gt;
&amp;lt;MATERIAL&amp;gt;
  &amp;lt;SRVNR&amp;gt;3003&amp;lt;/SRVNR&amp;gt;
  &amp;lt;MATNR&amp;gt;ZXCVB&amp;lt;/MATNR&amp;gt;
&amp;lt;/MATERIAL&amp;gt;

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; I've tried the code below:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
 for (int i=0; i&amp;lt;a.length;i++){
  result.addValue(b[0]);
}
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where the parameter a is my root &amp;lt;MATERIAL&amp;gt; and the parameter b is element &amp;lt;SRVNR&amp;gt;, but the result is wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've tried node function useOneAsMany but doesn't work too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My difficult is associate root &amp;lt;SERVER&amp;gt; with corresponding roots &amp;lt;MATERIAL&amp;gt; in the result using either a node function or an user define function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Someone can help me, please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advanced.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 15:42:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaq-p/5536309</guid>
      <dc:creator>former_member200572</dc:creator>
      <dc:date>2009-04-22T15:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Split many elements in others many elements</title>
      <link>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536310#M2059362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;under node functions you can use 'split by value'  on 'vale change' for SRVNR...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 17:38:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536310#M2059362</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T17:38:51Z</dc:date>
    </item>
    <item>
      <title>Re: Split many elements in others many elements</title>
      <link>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536311#M2059363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prema.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  I've done your tip but doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 18:20:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536311#M2059363</guid>
      <dc:creator>former_member200572</dc:creator>
      <dc:date>2009-04-22T18:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Split many elements in others many elements</title>
      <link>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536312#M2059364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure your UDF is context type.&lt;/P&gt;&lt;P&gt;I do not see any reason why useOneAsMany does not work.&lt;/P&gt;&lt;P&gt;Liang&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Liang Ji on Apr 22, 2009 9:02 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 19:02:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536312#M2059364</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T19:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Split many elements in others many elements</title>
      <link>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536313#M2059365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;can you change the context of  MATNR to SERVICE..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 19:35:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536313#M2059365</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T19:35:41Z</dc:date>
    </item>
    <item>
      <title>Re: Split many elements in others many elements</title>
      <link>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536314#M2059366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I  got a answer for you... replicated same scenario in my IR,  could test that and it is working great..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do you want me to send screen shots? or I can explain it to you..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fields are mapped like this;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 1)&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;MATNR&lt;/EM&gt; ---&amp;gt; removeContexts ---&amp;gt;MATERIAL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  where &lt;EM&gt;MATNR&lt;/EM&gt;  context is changed to SERVICE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 2)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SRVNR -&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&amp;gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;MATERIAL -&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&amp;gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;MATNR&lt;/EM&gt; -&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="------" /&gt;&amp;gt; &lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;in the same order all 3 fields go to -&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----" /&gt;&amp;gt; useOneAsMany -&lt;HR originaltext="-----" /&gt;&amp;gt; SplitByValue(Each Value) -&lt;HR originaltext="----" /&gt;&amp;gt; SRVNR&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;again &lt;EM&gt;MATNR&lt;/EM&gt;  context is changed to SERVICE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Step 3)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;MATNR&lt;/EM&gt; ---&amp;gt; SplitByValue(Each Value) -&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----" /&gt;&amp;gt;MATNR&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;again &lt;EM&gt;MATNR&lt;/EM&gt;  context is changed to SERVICE ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this should work for you.. please do try.. I have invested time to do this &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Apr 2009 20:51:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536314#M2059366</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-22T20:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Split many elements in others many elements</title>
      <link>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536315#M2059367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prema.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I delayed to answer to you because your tip is was almost what I needed, but with it I got the solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've never done an &lt;STRONG&gt;useOneAsMany&lt;/STRONG&gt; function with a context instead of elements as you suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My scenario it was a little more complex then I wrote, but now it's solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for the tip!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 19:27:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536315#M2059367</guid>
      <dc:creator>former_member200572</dc:creator>
      <dc:date>2009-04-23T19:27:46Z</dc:date>
    </item>
    <item>
      <title>Re: Split many elements in others many elements</title>
      <link>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536316#M2059368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are very welcome.. Happy that it worked for you..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Apr 2009 19:42:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536316#M2059368</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-23T19:42:59Z</dc:date>
    </item>
    <item>
      <title>Re: Split many elements in others many elements</title>
      <link>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536317#M2059369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ss&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Wolfgang Disch on Apr 28, 2009 5:45 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 14:54:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536317#M2059369</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-28T14:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Split many elements in others many elements</title>
      <link>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536318#M2059370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;Edited by: Wolfgang Disch on Apr 28, 2009 5:30 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Wolfgang Disch on Apr 28, 2009 5:45 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Apr 2009 15:30:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/split-many-elements-in-others-many-elements/qaa-p/5536318#M2059370</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-28T15:30:04Z</dc:date>
    </item>
  </channel>
</rss>

