cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping Logic for matching the qualifier from different segments

Former Member
0 Kudos

Hi all,

I have the following input file and i would like to have the output in mentioned way.

I have to look for the STOP from delivery segment, if that matches to the STOP in the E1ADRM4 segment means i have to take that date.

For the first STOP in the delivery segment is getting the correct date from the E1ADRM4 segment but for the second onwards it is not giving in the uotput.

Please suggest me how to achieve this

Input file

<E1EDT20>

<E1ADRM4>

<STOP>01</PARTNER_Q>

<PARTNER_ID>1108</PARTNER_ID>

<APNTD>20101115</APNTD>

</E1ADRM4>

<E1ADRM4>

<STOP>10</PARTNER_Q>

<PARTNER_ID>1115</PARTNER_ID>

<APNTD>20101130</APNTD>

</E1ADRM4>

</E1EDT20>

<E1EDL20>

<VBELN>0085001387</VBELN>

<ZATEDLVINFO>

<STOP>10</STOP>

<PRO>do not update</PRO>

<CONTAINER>do not update</CONTAINER>

<VESSEL>do not update</VESSEL>

</ZATEDLVINFO>

</E1EDL20>

<E1EDL20>

<VBELN>0085009999</VBELN>

<ZATEDLVINFO>

<STOP>01</STOP>

<PRO>do not update</PRO>

<CONTAINER>do not update</CONTAINER>

<VESSEL>do not update</VESSEL>

</ZATEDLVINFO>

</E1EDL20>

Output

<E1EDL20 SEGMENT="1">

<VBELN>0085001387</VBELN>

<ZATEDLVINFO SEGMENT="1">

<STOP>10</STOP>

<PRO>do not update</PRO>

<CONTAINER>do not update</CONTAINER>

<VESSEL>do not update</VESSEL>

<APNTD>20101130</APNTD>

</ZATEDLVINFO>

</E1EDL20>

<E1EDL20 SEGMENT="1">

<VBELN>0085009999</VBELN>

<ZATEDLVINFO SEGMENT="1">

<STOP>01</STOP>

<PRO>do not update</PRO>

<CONTAINER>do not update</CONTAINER>

<VESSEL>do not update</VESSEL>

<APNTD>20101115</APNTD>

</ZATEDLVINFO>

</E1EDL20>

Regards

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

try removecontext and splitbyvalue functions.

Former Member
0 Kudos

Hi,

Try this UDF:

Execution type: All values of a context.

Input : var1, avr2, var3.

int a=var1.length;

int b= var2.length;

for(int i=0;i<a;i++)

{

for(int j=0;j<b;j++)

{

if(var2[j].equals(var1<i>))

{

result.addValue(var3[j]);

}

}

}

Mapping:

STOP(ZATEDLVINFO)

STOP(E1ADRM4)--


UDF-SplitByvalue---APNTD

APNTD(E1ADRM4)

NOTE: Change the context of all the 3 input fields(set the context to its message type name).

Thanks

Amit