cancel
Showing results for 
Search instead for 
Did you mean: 

Need a UDF to compare 2 different segment level fields and need get the respective value

8885676259
Explorer
0 Kudos
145

Need a UDF to compare 2 different segment level fields(E1EDL24-MATNR) and (E1EDL37-E1EDL44-MATNR) and need get the value of (E1EDL37-E1EDL44-E1EDL46-SERNR) value when both MATNR's matched.

<?xml version="1.0" encoding="UTF-8"?>

<DELVRY05>

<IDOC BEGIN="1">

<E1EDL20 SEGMENT="1">

<E1EDL24 SEGMENT="1">

<POSNR>000010</POSNR>

<MATNR>XX1005</MATNR>

</E1EDL24>

<E1EDL24 SEGMENT="1">

<POSNR>000020</POSNR>

<MATNR>XX1006</MATNR>

</E1EDL24>

<E1EDL37 SEGMENT="1">

<E1EDL44 SEGMENT="1">

<POSNR>000010</POSNR>

<MATNR>XX1005</MATNR>

<E1EDL46 SEGMENT="1">

<SERNR>000000000000000010</SERNR>

</E1EDL46>

<E1EDL46 SEGMENT="1">

<SERNR>000000000000000011</SERNR>

</E1EDL46>

</E1EDL44>

<E1EDL44 SEGMENT="1">

<POSNR>000010</POSNR>

<MATNR>XX1005</MATNR>

<E1EDL46 SEGMENT="1">

<SERNR>000000000000000012</SERNR>

</E1EDL46>

</E1EDL44>

</E1EDL37>

<E1EDL37 SEGMENT="1">

<E1EDL44 SEGMENT="1">

<POSNR>000010</POSNR>

<MATNR>XX1007</MATNR>

<E1EDL46 SEGMENT="1">

<SERNR>000000000000000013</SERNR>

</E1EDL46>

</E1EDL44>

<E1EDL44 SEGMENT="1">

<POSNR>000010</POSNR>

<MATNR>XX1005</MATNR>

<E1EDL46 SEGMENT="1">

<SERNR>000000000000000014</SERNR>

</E1EDL46>

</E1EDL44>

</E1EDL37>

<E1EDL37 SEGMENT="1">

<E1EDL44 SEGMENT="1">

<POSNR>000010</POSNR>

</E1EDL44>

</E1EDL37>

</E1EDL20>

</IDOC>

</DELVRY05>

All E1EDL24, E1EDL37, E1EDL44 and E1EDL46 can repeated separately. Means, (0,99999) occurrences.

From above payload, (E1EDL24-MATNR) = XX1005 is equals to (E1EDL37-E1EDL44-MATNR) 3 occurances and their respective (E1EDL37-E1EDL44-E1EDL46-SERNR) = 000000000000000010, 000000000000000011, 000000000000000012 and 000000000000000014 values needs to be sent to Target in different contexts

Please help me with the above requirement. How we can achieve this

Accepted Solutions (0)

Answers (0)