<?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: Context Handling - Message Mapping in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/context-handling-message-mapping/qaa-p/683476#M181840</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We managed to fix the issue as shown below. An UDF to remove the duplicate values in field 'Type' is used as a context formatter.&lt;/P&gt;&lt;P&gt;Please see the screen below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/236593-udf.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 18 Oct 2018 15:09:43 GMT</pubDate>
    <dc:creator>jayaraj2018</dc:creator>
    <dc:date>2018-10-18T15:09:43Z</dc:date>
    <item>
      <title>Context Handling - Message Mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/context-handling-message-mapping/qaq-p/683475</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;I am working on a Flat -&amp;gt; IDoc conversion mapping. I have scenario where i need to aggregate on a field called 'Type' in 'InvoiceLines' segment. That is, for each unique value in the 'Type' field, i would need to generate a E1BPACTX09 segment in the target idoc.&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;Please see the screen below.&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/234517-mapping.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Here there are 2 'Record' segments in my input file, hence 2 iDoc segments on the output. In the first record there are 3 'InvoiceLines' segment with values in 'Type' field as 'C1', C2' and 'C2' respectively. Now as there are only 2 unique Type field values (C1 &amp;amp; C2), i need to generate only 2 E1BPACTX09 segment. This works fine for the first record set as shown in the screenshot above.&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;But the 'InvoiceLines' segment in the 2nd 'Record' is not generating any E1BPACTX09 segment when it is supposed to. &lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;Below is the mapping on this segment for your reference.&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/234518-taxsegment-logic.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;When i did a Display queue on this 'Type' field, it only shows the C1, C2, C2 values in the 'InvoiceLines' from the 1st 'Record' but also the 'C2' value from the InvocieLines in the 2nd record. &lt;/P&gt;
  &lt;P&gt;'Sales_Invoice_Request' is mapped to 'ACC_DOCUMENT04'&lt;/P&gt;
  &lt;P&gt;'Record' is mapped to 'IDOC'&lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;If there is someway where i can map the InvoiceLines segment with E1BPACTX09 segment and then again apply the above shown mapping logic, then i believe i can achive the solution. Some kind of Segment Encapsulation.&lt;/P&gt;
  &lt;P&gt;Please let me know if there is a better approach than this.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Oct 2018 16:59:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/context-handling-message-mapping/qaq-p/683475</guid>
      <dc:creator>jayaraj2018</dc:creator>
      <dc:date>2018-10-17T16:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: Context Handling - Message Mapping</title>
      <link>https://community.sap.com/t5/technology-q-a/context-handling-message-mapping/qaa-p/683476#M181840</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;We managed to fix the issue as shown below. An UDF to remove the duplicate values in field 'Type' is used as a context formatter.&lt;/P&gt;&lt;P&gt;Please see the screen below.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/236593-udf.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Oct 2018 15:09:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/context-handling-message-mapping/qaa-p/683476#M181840</guid>
      <dc:creator>jayaraj2018</dc:creator>
      <dc:date>2018-10-18T15:09:43Z</dc:date>
    </item>
  </channel>
</rss>

