cancel
Showing results for 
Search instead for 
Did you mean: 

Segment creation based on a condition

Former Member
0 Kudos

Hello All ,

I need a udf for the below scenario. Tghis a SHPMENT to VDA4913 scenario. In this case some times Handling packagin unit has both returnable and non returnable data. SO business want both in their ASN.

Here , if the value of field VELIN=2 and SMGKN =S , both exist in E1EDL37 then target node need to get created. VELIN filed is under E1EDL44 and SMGKN is under E1EDL37.

Please help me out with this solution .

Accepted Solutions (1)

Accepted Solutions (1)

former_member184789
Active Contributor
0 Kudos

Hi,

Did you try with standard mapping functions such that

Velin = 2

                       AND-> CreateIf->Target Node

SMGKN = S

Answers (4)

Answers (4)

manigram
Active Participant
0 Kudos

Hi,

Am not getting your exact requirement , as per my understanding i have created one Mapping based on that you try or else share me the exact condition.

Former Member
0 Kudos

Hello All ,

I have tried this Graphical mapping previously . But if I use this graphical mapping target segment is not generating.

target segment is 715 . and in mapping I have craeted four 715 on based on condition. First I  mapped four 715 induvidual segemnt to constant and what ever mapping required mapping for all the segment under them.

It's work prefectly in case of single material.

When multiple material is there in ASN and some of the is having sub HU under master HU and some of them wont . Then this is not working.

1 . 715 condition : Segment will create if Master HU exist.

2. 715 condition : Segment will create if SMGKN =1 and VELIN =2.

1 and 2 715 sgemen working fine .

3rd 715 segment : sub HU exist under master HU.

4th 715 segment : If SMGKN = S and VELIN = 2 exist together.

This two segment is not generating in case of multiple material.

ambrish_mishra
Active Contributor
0 Kudos

Hi Rituparna,

I assume you are looking for a UDF since E1EDL44 can occur more than once and is a child of E1EDL37(can occur more than once itself).

Here it is:

Parameters SMGKN, VELIN

Context for both fields should be E1EDL37

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

    if(SMGKN[i].equals("S"))

        for (int j = 0; j < VELIN.length; j++)

            if(VELIN[j].equals("2"))

                result.addValue("");       

Hope it helps!

Ambrish

       

Ambrish

Former Member
0 Kudos

Hello Ambrish ,

Sorry this Udf is not generating the expected Output. In target not sgeemnt is created , bu in queed it's showing that segment is getting created if SMGKN not equal to S also.

thanks

ambrish_mishra
Active Contributor
0 Kudos

Rituparna,

Give a screenshot of mapping and your test case. It will work. some tuning might be required.

Ambrish

former_member190624
Active Contributor
0 Kudos

Hello Rituparna,

You can achieve this requirement through graphical mapping itself (as Adarsh said) . Why you are looking for  UDF, any specific reason for UDF ? If yes let me know know i will provide you UDF code.

Regards

Hari.