cancel
Showing results for 
Search instead for 
Did you mean: 

UDF-Queue handling for IDOC Segment

0 Kudos

HI PI guys,

I have an requirement in ORDERS IDOC,

The Segment E1EDK1 is repeating for 2 times from ECC and this Segment has 4 fields as shown below.

         <E1EDK17 SEGMENT="">

               <QUALF>001</QUALF>

               <LKOND>Text1</LKOND>

               <LKTEXT/>

            </E1EDK17>

            <E1EDK17 SEGMENT="">

               <QUALF>002</QUALF>

               <LKOND/>             

                <LKTEXT>Text2</LKTEXT>

            </E1EDK17>

Requirement : I need to check If QUALF = 001 for the first time and for

                      Second Time Qual = 002 then I need to Concatenate LKOND + LKTEXT to Target Field.

I tried with Graphical mapping doesnt worked. I thought of using UDF with Queue handling, Please help me out how to handle this.

Is there any other way for achieving the above requirement ?

Thanks in Advance

rgds,

Kumar

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Will this logic work or is it more dynamic?

Hope this helps,

Mark

0 Kudos

Hi Mark,

Thanks for your quick reply.

The logic mentioned above works fine even with error case too.

Thanks very much.

Rgds,

Kumar

Answers (1)

Answers (1)

former_member184720
Active Contributor
0 Kudos

Hi Kumar - It should be possible without UDF. I'm not sure if you have any special requirement but you can refer to attached image.

i just wrote some simple UDF and you can modify it as per your requirement.(i didnt tested it)

String output="";

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

{

if (QUALF[i].equals("001"))

{

output =output+LKOND[i];

break;

}

else if (QUALF[i].equals("002"))

{

output =output+LKOND[i];

break;

}

}

result.addValue(output);

Regards,

Hareesh

0 Kudos

Hi Hareesh,

Thank you for your qucik reply.

The logic using graphicalMapping works fine, however if QUAL = null then throws error.

No problem, but these are mandatory values.

Thanks once again.

Rgds,

Kumar