cancel
Showing results for 
Search instead for 
Did you mean: 

Sort Segments data before Mapping?

Former Member
0 Kudos

Hey all,

I'm working on an 856 EDI with this structure:

- E1EDL37 [Pack Level]

- - E1EDL44 [Item Level (many details for every pack)

In this structure i have a code that determinates a message split for every unique code, everything looks ok, but, when i get an order like this:

E1EDL37-EXIDV2: "1132"

E1EDL37-EXIDV2: "2138"

E1EDL37-EXIDV2: "3319"

E1EDL37-EXIDV2: "1132" <-- repeated and not in order

- I can't sort the item levels correctly [EDL44]

- I only sort correctly the EDL37 order (since i'm mapping within "VHILM_KU" which is a customer material code, i sort the structure like this:

EXIDV2 ===>

VHILM_KU ===> SortByKey ===>SplitByV [Each] => "HP"

But when i need to map the item level i don't know how to sort it (I need to map E1EDL44-MATNR, POSNR, CHARG, etc), since i can't use the E1EDL37-EXIDV2 as key since this belong to other other queue

Example:

E1EDL37 [EXIDV2 => 1132]

E1EDL44-POSNR = 1

E1EDL37 [EXIDV2 => 2138]

E1EDL44-POSNR = 2

E1EDL44-POSNR = 3

E1EDL37 [EXIDV2 => 1132]

E1EDL44-POSNR = 4

I would need to sort it and then map like this:

E1EDL37 [EXIDV2 => 1132]

E1EDL44-POSNR = 1

E1EDL37 [EXIDV2 => 1132]

E1EDL44-POSNR = 4

E1EDL37 [EXIDV2 => 2138]

E1EDL44-POSNR = 2

E1EDL44-POSNR = 3

My map is like this:

E1EDL37 ---> . "G_HI" [0.unbounded]

. "HP" [0.unbounded

[ with the sort i mentioned, and pack data]

E1EDL44 -


> . "HI" [0.unbounded] [Item level data within]

Any ideas?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

I have worked specifically for this map in my previous project. It would be very complex to achive this with Graphical mapping. So go for UDF, The type would be "queue".

Inside UDF , you will get the array of the input, Sort them and than start adding in the result array.

Let me know if you find any difficulties.

Thanks & Regards,

Dijesh Tanna.

Former Member
0 Kudos

Hi Dijesh, many thanks for your reply

We've been discussing to use that procedure in our team, but the problem is that i'm not familiar to that kind of process (i don't know much about arrays in java), could you provide any example?

I guess i'd need to use that like it or not

Regards,

Former Member
0 Kudos

Refer following link to have some idea on Advance UDF.

When you create new UDF with type "Queue", all the input would be available as array inside UDF.

Than you can loop around that element.

f.e.

for (int i = 0 ; i < Input.length;i++)

{

// Write your sort logic here , search on google and you would find many sorting algo in Java.

// Add sorted element in result.

result.addValue (SortedElement);

}

Thanks & Regards,

Dijesh Tanna.

Former Member
0 Kudos

Thanks!

Answers (0)