AnsweredAssumed Answered

SAP IDOC mapping - single comment

Question asked by GuiManders421 on Jul 25, 2014
Latest reply on Aug 22, 2014 by GuiManders421

I am creating a Sales Order IDOC for SAP. The source XML data structure looks like this:

 

<order>
   <header>
   </header>
   <lineitem>
        <comment></comment>
   </lineitem>
</order>

 

In the example I am testing, there are 3 line items in the source (1 header segment, 3 lineitem segments).

 

The issue I'm having is that each line item generated in the SAP IDOC has all 3 comment lines (from each item). This is one of the line item segments on the IDOC:

 

    <E1EDP01 SEGMENT="1">
      <POSEX>10</POSEX>
      <MENGE>10.00</MENGE>
      <PSTYV>TAN</PSTYV>
      <WERKS>1200</WERKS>
      <E1EDP05 SEGMENT="1">
        <KSCHL>PR00</KSCHL>
        <KRATE>5.00</KRATE>
      </E1EDP05>
      <E1EDP05 SEGMENT="1">
        <KSCHL>RA00</KSCHL>
        <KRATE>0.00</KRATE>
      </E1EDP05>
      <E1EDPT1 SEGMENT="1">
        <TDID>0001</TDID>
        <TSSPRAS>E</TSSPRAS>
        <E1EDPT2 SEGMENT="1">
          <TDLINE>first comment</TDLINE>
          <TDFORMAT>/</TDFORMAT>
        </E1EDPT2>
        <E1EDPT2 SEGMENT="1">
          <TDLINE>second comment</TDLINE>
          <TDFORMAT>/</TDFORMAT>
        </E1EDPT2>
        <E1EDPT2 SEGMENT="1">
          <TDLINE>third comment</TDLINE>
          <TDFORMAT>/</TDFORMAT>
        </E1EDPT2>
      </E1EDPT1>
      <E1EDP19 SEGMENT="1">
        <QUALF>002</QUALF>
        <IDTNR>000000000000500020</IDTNR>
      </E1EDP19>
    </E1EDP01>

 

Since this is the first item, only "first" comment segment should be generated. The subsequent 2 line items on the IDOC also have all 3 comments from each item. How do I make sure each line only receives their respective comment?

Outcomes