Hello All,
I am stuck in a recursive problem and would need your suggestions in getting it fixed.
I am mapping an ido to another. PFB the sample XML payload of a segment which occurs at least 5 times in sender payload.
Now, the problem is as follows.
If E1EDL24->POSNR starts with 0, create a new segment in target Idoc. Map the POSNR, VGPOS values.
If E1EDL24->POSNR doesnt start with 0, then check for existing segments created in target Idoc where the
VGPOS in target Idoc matches current segment HIPOS value. Add all such values and assign to the target segment.
In the below example, For the first 24 segment, a new segment will be created in Target Idoc.
However for second 24 segment, the value of LFIMG should be added to target Idoc value.
The case is same for third 24 segment.
SEt 1: One target segmet should be created with ID as 00001 and quantity as 20 + 28 = 48
<E1EDL24>
<POSNR>00001<POSNR>
<VGPOS>00001<VGPOS>
<HIPOS>00001<HIPOS>
<LFIMG>0.00<LFIMG>
</E1EDL24>
<E1EDL24>
<POSNR>900001<POSNR>
<HIPOS>00001<HIPOS>
<VGPOS>00001<VGPOS>
<LFIMG>20.0<LFIMG>
</E1EDL24>
<E1EDL24>
<POSNR>900010<POSNR>
<HIPOS>00001<HIPOS>
<VGPOS>00001<VGPOS>
<LFIMG>28.0<LFIMG>
</E1EDL24>
##-- SEt 2. One target segment should be created with ID as 00002 and quantity as 25 + 20 = 45
<E1EDL24>
<POSNR>00002<POSNR>
<HIPOS>00002<HIPOS>
<VGPOS><VGPOS>
<LFIMG>0.00<LFIMG>
</E1EDL24>
<E1EDL24>
<POSNR>900002<POSNR>
<HIPOS>00002<HIPOS>
<VGPOS><VGPOS>
<LFIMG>20.0<LFIMG>
</E1EDL24>
<E1EDL24>
<POSNR>900002<POSNR>
<HIPOS>00002<HIPOS>
<VGPOS>00002<VGPOS>
<LFIMG>25.0<LFIMG>
</E1EDL24>
Any suggestions are highly appreciated.