AnsweredAssumed Answered

XML mapping (multiple segments to one row)

Question asked by marc.hamernik002881 on Jan 19, 2017
Latest reply on Jan 19, 2017 by Srinivas Chandrakanth Vangari

I am trying to map an XML with multiple nodes/segments into one row (SQL). I have two fields I have to map to in SQL (say item1 and item2). I want to populate item1 with IDTNR where QUALF = 001, and item 2 populated with IDTNR where QUALF = 002. If I do a straight mapping I end up with 2 rows where 1 row has item1 = NULL and item2 = TJO-2410, and another row where item1 = 067120-01 and item2 = NULL. I am trying to get just 1 row with both items populated. It is worth noting that there could be one segment of E1EDP01 or there could be 100, so it would have to work with multiple segments.

 

 

Thanks

 

<E1EDP01 SEGMENT="1">
<POSEX>00010</POSEX>
<ACTION>001</ACTION>
<PSTYP>0</PSTYP>
.

.

.
   <E1EDP19 SEGMENT="1">
      <QUALF>002</QUALF>
      <IDTNR>TJO-2410</IDTNR>
   </E1EDP19>
   <E1EDP19 SEGMENT="1">
      <QUALF>001</QUALF>
      <IDTNR>057120-01</IDTNR>
   </E1EDP19>
</E1EDP01>

Outcomes