Skip to Content
0
A D
Jul 03, 2012 at 05:54 PM

Create segment based on Condition

49 Views

Hi I have a requirement such that I have on the source side ORDERS05 IDoc and in E1EDP01, I have multiple E1EDP19 with QUALF as 002,001 & 004 ( in that order). Now they say that E1EDP01 may repeat and in some or all, the E1EDP19 corresponding to QUALF=002 may not appear. In such cases I have to create an E1EDP19 with QUALF=002. For example:

< E1EDP01>

<E1EDP19>

QUALF = 002

<E1EDP19>

QUALF=001

<E1EDP19>

QUALF =004

<E1EDP01/>

< E1EDP01>

<E1EDP19>

QUALF=001

<E1EDP19>

QUALF =004

<E1EDP01/>

The above is a sample source where in the first E1EDP01, the E1EDP19 corresponding to QUALF=002 appears, whereas in the second E1EDP01, the E1EDP19 with QUALF=002 is not there. My target XML should look like:

< E1EDP01>

<E1EDP19>

QUALF = 002

<E1EDP19>

QUALF=001

<E1EDP19>

QUALF =004

<E1EDP01/>

< E1EDP01>

<E1EDP19>

QUALF = 002

<E1EDP19>

QUALF=001

<E1EDP19>

QUALF =004

<E1EDP01/>

And I need to populate IDTNR ( even though blank) from QUALF=002 if it does not appear. So in cases where QUALF=002 appears, IDTNR will take value from there, otherwise a blank IDTNR has to be created. Could anyone please guide me. I need detailed guidance.