<?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: How to implement multimapping in CPI in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794112#M4803573</link>
    <description>&lt;P&gt;Hi Keylla,&lt;/P&gt;&lt;P&gt;I tried your script and it works fine.&lt;/P&gt;&lt;P&gt;I have another script to write in much the same way only there i have string that allready contains double quotes (" ") and now the replace command gets confused and throws an error.&lt;/P&gt;&lt;P&gt;I want to do this: &lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;body.replaceAll("&amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&amp;gt;",""&amp;gt; ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But that command throws an error. Maybe this is because of the " " surrounding the namespace?&lt;/P&gt;&lt;P&gt;Or the :// in the namespace?&lt;/P&gt;&lt;P&gt;If there is a solution to this that would be helpfull&lt;/P&gt;&lt;P&gt;Kr&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;P&gt;ps. I allready found my answer; in the command replaceAll you can either use single quotes or double quotes, and thereby escaping the other one.&lt;/P&gt;</description>
    <pubDate>Mon, 17 Jul 2023 10:08:12 GMT</pubDate>
    <dc:creator>Robert_d_Hoedt</dc:creator>
    <dc:date>2023-07-17T10:08:12Z</dc:date>
    <item>
      <title>How to implement multimapping in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaq-p/12794102</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;I would like to know what is the best way to implement multimapping in CPI.&lt;/P&gt;
  &lt;P&gt;My requirement is to map 1 message to 2 messages.&lt;/P&gt;
  &lt;P&gt;In the editor it looks like this&lt;/P&gt;
  &lt;P&gt;Senderside&lt;/P&gt;
  &lt;P&gt;&amp;lt;Messages&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;Message1&amp;gt;&lt;/P&gt;
  &lt;P&gt;........&lt;/P&gt;
  &lt;P&gt;&amp;lt;/Message1&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;Messages&amp;gt;&lt;/P&gt;
  &lt;P&gt;and in the Receiverside&lt;/P&gt;
  &lt;P&gt;&amp;lt;Messages&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;Message1&amp;gt;&lt;/P&gt;
  &lt;P&gt;........&lt;/P&gt;
  &lt;P&gt;&amp;lt;/Message1&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;Message2&amp;gt;&lt;/P&gt;
  &lt;P&gt;.........&lt;/P&gt;
  &lt;P&gt;&amp;lt;Message2&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;Messages&amp;gt;.&lt;/P&gt;
  &lt;P&gt;I created the mapping and tested it, For testing purposes i added the &amp;lt;messages&amp;gt;&amp;lt;message1&amp;gt; tags to my message and the mapping worked. &lt;/P&gt;
  &lt;P&gt;For runtime i sent the message (without &amp;lt;messages&amp;gt;&amp;lt;message1&amp;gt; tags ) and it failed.&lt;/P&gt;
  &lt;P&gt;I then looked for a solution and one suggestion was to add a Content Modifier to the iFlow for the message body:&lt;/P&gt;
  &lt;P&gt;&amp;lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;ns3:Messages xmlns:ns3="http://sap.com/xi/XI/SplitAndMerge"&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;ns3:Message1&amp;gt;&lt;/P&gt;
  &lt;P&gt;${in.body}&lt;/P&gt;
  &lt;P&gt;&amp;lt;/ns3:Message1&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;/ns3:Messages&amp;gt;&lt;/P&gt;
  &lt;P&gt;I added the content modifier and now my mapping works.&lt;/P&gt;
  &lt;P&gt;But now i have a problem that the result message looks like this:&lt;/P&gt;
  &lt;P&gt;&amp;lt;Messages&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;Message1&amp;gt;&lt;/P&gt;
  &lt;P&gt;........&lt;/P&gt;
  &lt;P&gt;&amp;lt;/Message1&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;Message2&amp;gt;&lt;/P&gt;
  &lt;P&gt;.........&lt;/P&gt;
  &lt;P&gt;&amp;lt;Message2&amp;gt;&lt;/P&gt;
  &lt;P&gt;&amp;lt;Messages&amp;gt;.&lt;/P&gt;
  &lt;P&gt;How do get rid of all these tags?&lt;/P&gt;
  &lt;P&gt;And is this really the best solution to my mapping requirement? It seems to me a very clumsy way of doing a multimap. (compared to the way it was done in PO)&lt;/P&gt;
  &lt;P&gt;Regards&lt;/P&gt;
  &lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 11:39:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaq-p/12794102</guid>
      <dc:creator>Robert_d_Hoedt</dc:creator>
      <dc:date>2023-06-29T11:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multimapping in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794103#M4803564</link>
      <description>&lt;P&gt;Hello Robert ,&lt;/P&gt;&lt;P&gt;You can use content filter and trim these additional tags very easily.&lt;/P&gt;&lt;P&gt;Follow below to know more about content filter.&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2017/06/01/sap-cloud-platform-integration-content-filter-in-detail/" target="_blank"&gt;https://blogs.sap.com/2017/06/01/sap-cloud-platform-integration-content-filter-in-detail/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sriprasad S Bhat&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 11:48:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794103#M4803564</guid>
      <dc:creator>Sriprasadsbhat</dc:creator>
      <dc:date>2023-06-29T11:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multimapping in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794104#M4803565</link>
      <description>&lt;P&gt;That's the normal output structure of a multimapping in PI/PO - why would you remove the tags?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 11:55:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794104#M4803565</guid>
      <dc:creator>Ryan-Crosby</dc:creator>
      <dc:date>2023-06-29T11:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multimapping in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794105#M4803566</link>
      <description>&lt;P&gt;Hi Ryan, &lt;/P&gt;&lt;P&gt;These tags are not wanted by the receiver of the message&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 12:44:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794105#M4803566</guid>
      <dc:creator>Robert_d_Hoedt</dc:creator>
      <dc:date>2023-06-29T12:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multimapping in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794106#M4803567</link>
      <description>&lt;P&gt;In such a case, then why use multimapping instead of using a single map?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 12:48:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794106#M4803567</guid>
      <dc:creator>Ryan-Crosby</dc:creator>
      <dc:date>2023-06-29T12:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multimapping in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794107#M4803568</link>
      <description>&lt;P&gt;Hi Sriprasad,&lt;/P&gt;&lt;P&gt;I read your blog but still no sure how to proceed.&lt;/P&gt;&lt;P&gt;The output of my message is&lt;/P&gt;&lt;P&gt;&amp;lt;ns3:Messages &amp;gt;&lt;/P&gt;&lt;P&gt;	&amp;lt;ns3:Message1&amp;gt;&lt;/P&gt;&lt;P&gt;		&amp;lt;ns2:SessionHeader &amp;gt;&lt;/P&gt;&lt;P&gt;			&amp;lt;ns2:sessionId&amp;gt;xyz&amp;lt;/ns2:sessionId&amp;gt;&lt;/P&gt;&lt;P&gt;		&amp;lt;/ns2:SessionHeader&amp;gt;&lt;/P&gt;&lt;P&gt;	&amp;lt;/ns3:Message1&amp;gt;&lt;/P&gt;&lt;P&gt;	&amp;lt;ns3:Message2&amp;gt;&lt;/P&gt;&lt;P&gt;		&amp;lt;ns2:setPurchaseOrderResult &amp;gt;&lt;/P&gt;&lt;P&gt;			&amp;lt;ns2:assignmentId&amp;gt;1&amp;lt;/ns2:assignmentId&amp;gt;&lt;/P&gt;&lt;P&gt;			&amp;lt;ns2:success&amp;gt;true&amp;lt;/ns2:success&amp;gt;&lt;/P&gt;&lt;P&gt;			&amp;lt;ns2:message&amp;gt;message&amp;lt;/ns2:message&amp;gt;&lt;/P&gt;&lt;P&gt;			&amp;lt;ns2:purchaseOrderNr&amp;gt;123456789&amp;lt;/ns2:purchaseOrderNr&amp;gt;&lt;/P&gt;&lt;P&gt;		&amp;lt;/ns2:setPurchaseOrderResult&amp;gt;&lt;/P&gt;&lt;P&gt;	&amp;lt;/ns3:Message2&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/ns3:Messages&amp;gt;&lt;/P&gt;&lt;P&gt;And what i need is like&lt;/P&gt;&lt;P&gt;		&amp;lt;ns2:SessionHeader &amp;gt;&lt;/P&gt;&lt;P&gt;			&amp;lt;ns2:sessionId&amp;gt;xyz&amp;lt;/ns2:sessionId&amp;gt;&lt;/P&gt;&lt;P&gt;		&amp;lt;/ns2:SessionHeader&amp;gt;&lt;/P&gt;&lt;P&gt;		&amp;lt;ns2:setPurchaseOrderResult &amp;gt;&lt;/P&gt;&lt;P&gt;			&amp;lt;ns2:assignmentId&amp;gt;1&amp;lt;/ns2:assignmentId&amp;gt;&lt;/P&gt;&lt;P&gt;			&amp;lt;ns2:success&amp;gt;true&amp;lt;/ns2:success&amp;gt;&lt;/P&gt;&lt;P&gt;			&amp;lt;ns2:message&amp;gt;message&amp;lt;/ns2:message&amp;gt;&lt;/P&gt;&lt;P&gt;			&amp;lt;ns2:purchaseOrderNr&amp;gt;123456789&amp;lt;/ns2:purchaseOrderNr&amp;gt;&lt;/P&gt;&lt;P&gt;		&amp;lt;/ns2:setPurchaseOrderResult&amp;gt;&lt;/P&gt;&lt;P&gt;Could you provide the correct XPATH to do that?&lt;/P&gt;&lt;P&gt;And i suppose it is NODE or NODELIST from the dropdown list?&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 12:57:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794107#M4803568</guid>
      <dc:creator>Robert_d_Hoedt</dc:creator>
      <dc:date>2023-06-29T12:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multimapping in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794108#M4803569</link>
      <description>&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;&lt;A href="https://answers.sap.com/storage/temp/2181936-2023-06-29-16-02-45-window.png" data-attachment="2181936"&gt;2023-06-29-16-02-45-window.pn&lt;/A&gt;g&lt;/P&gt;&lt;P&gt;I received a wsdl containing a few messages. I need to use 2 of them in the message that i send out my iflow.&lt;/P&gt;&lt;P&gt;So i selected one message on the left side and 2 messages on the right side of my mapping editor.&lt;/P&gt;&lt;P&gt;The editor automatically creates these extra tags (messages, message 1, message 2) for me. &lt;/P&gt;&lt;P&gt; (like i said: in PO this is of no consequence for the runtime), but apparently in CPI one must specifically add and remove the extra tags to make the mapping work.&lt;/P&gt;&lt;P&gt;If there is an easier way to do it all, i'm game, please let me know&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 14:13:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794108#M4803569</guid>
      <dc:creator>Robert_d_Hoedt</dc:creator>
      <dc:date>2023-06-29T14:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multimapping in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794109#M4803570</link>
      <description>&lt;P&gt;Is the intent for the receiver to get a single message with one XML structure?  If so, then I would adjust the WSDL to match the expected structure and adjust the mapping accordingly.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 14:16:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794109#M4803570</guid>
      <dc:creator>Ryan-Crosby</dc:creator>
      <dc:date>2023-06-29T14:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multimapping in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794110#M4803571</link>
      <description>&lt;P&gt;Hi Ryan,&lt;/P&gt;&lt;P&gt;It would be a lot easier that way, i agree.&lt;/P&gt;&lt;P&gt;But if we go that way than the receiving application needs to do some changes and so far they werent willing to do that.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jul 2023 10:47:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794110#M4803571</guid>
      <dc:creator>Robert_d_Hoedt</dc:creator>
      <dc:date>2023-07-03T10:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multimapping in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794111#M4803572</link>
      <description>&lt;P&gt;Hi Robert, &lt;/P&gt;&lt;P&gt;After the multimapping step you can also use a groovy script to remove that unwanted tags generated. Please see below:&lt;/P&gt;&lt;P&gt;import com.sap.gateway.ip.core.customdev.util.Message;&lt;/P&gt;&lt;P&gt;import java.util.HashMap;&lt;/P&gt;&lt;P&gt;import java.io.*;&lt;/P&gt;&lt;P&gt;def Message processData(Message message) {&lt;/P&gt;&lt;P&gt;//get Body&lt;/P&gt;&lt;P&gt;	def body = message.getBody(java.lang.String) as String; &lt;/P&gt;&lt;P&gt;//replaceMultimap tag&lt;/P&gt;&lt;P&gt;	body = body.replaceAll('&amp;lt;ns2:Messages xmlns:ns2="http://sap.com/xi/XI/SplitAndMerge"&amp;gt;', "");&lt;/P&gt;&lt;P&gt;	body = body.replaceAll("&amp;lt;/ns2:Messages&amp;gt;", "");&lt;/P&gt;&lt;P&gt;	body = body.replaceAll("&amp;lt;ns2:Message1&amp;gt;", "");&lt;/P&gt;&lt;P&gt;	body = body.replaceAll("&amp;lt;/ns2:Message1&amp;gt;","");&lt;/P&gt;&lt;P&gt;	body = body.replaceAll("&amp;lt;ns2:Message2&amp;gt;", "");&lt;/P&gt;&lt;P&gt;	body = body.replaceAll("&amp;lt;/ns2:Message2&amp;gt;","");&lt;/P&gt;&lt;P&gt;	body = body.replaceAll("&amp;lt;ns2:Message3&amp;gt;", "");&lt;/P&gt;&lt;P&gt;	body = body.replaceAll("&amp;lt;/ns2:Message3&amp;gt;","");&lt;/P&gt;&lt;P&gt;//set body&lt;/P&gt;&lt;P&gt;	message.setBody(body); &lt;/P&gt;&lt;P&gt;	return message;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jul 2023 09:57:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794111#M4803572</guid>
      <dc:creator>Keylla_Lima</dc:creator>
      <dc:date>2023-07-10T09:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multimapping in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794112#M4803573</link>
      <description>&lt;P&gt;Hi Keylla,&lt;/P&gt;&lt;P&gt;I tried your script and it works fine.&lt;/P&gt;&lt;P&gt;I have another script to write in much the same way only there i have string that allready contains double quotes (" ") and now the replace command gets confused and throws an error.&lt;/P&gt;&lt;P&gt;I want to do this: &lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;body.replaceAll("&amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&amp;gt;",""&amp;gt; ;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;But that command throws an error. Maybe this is because of the " " surrounding the namespace?&lt;/P&gt;&lt;P&gt;Or the :// in the namespace?&lt;/P&gt;&lt;P&gt;If there is a solution to this that would be helpfull&lt;/P&gt;&lt;P&gt;Kr&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;P&gt;ps. I allready found my answer; in the command replaceAll you can either use single quotes or double quotes, and thereby escaping the other one.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 10:08:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794112#M4803573</guid>
      <dc:creator>Robert_d_Hoedt</dc:creator>
      <dc:date>2023-07-17T10:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multimapping in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794113#M4803574</link>
      <description>&lt;P&gt;Hi Robert, &lt;/P&gt;&lt;P&gt;Please try with single quote for the snippet you want to replace that has url with double quotes:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;body.replaceAll('&amp;lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&amp;gt;',""&amp;gt; ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Jul 2023 13:46:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794113#M4803574</guid>
      <dc:creator>Keylla_Lima</dc:creator>
      <dc:date>2023-07-17T13:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement multimapping in CPI</title>
      <link>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794114#M4803575</link>
      <description>&lt;P&gt;Hi Keylla,&lt;/P&gt;&lt;P&gt;Thx  for your answer.&lt;/P&gt;&lt;P&gt;Incidentally i found the same somewhere else, but didnt see your answer yet.&lt;/P&gt;&lt;P&gt;Whichever way, thank you for helping me out.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jul 2023 14:14:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/how-to-implement-multimapping-in-cpi/qaa-p/12794114#M4803575</guid>
      <dc:creator>Robert_d_Hoedt</dc:creator>
      <dc:date>2023-07-17T14:14:01Z</dc:date>
    </item>
  </channel>
</rss>

