cancel
Showing results for 
Search instead for 
Did you mean: 

udf for Inbound idoc -TDID field

former_member452321
Participant
0 Kudos

Hi gurus ,

I need some help for the following logic. I am getting errors in the following code.This is PO response from xml to Inbound IDOC for TDID filed .I have attached current application code logic which I was trying to convert to udf in PI.Thanks in advance for help

i am sending two arguments suppnotes and hnote and execution type as allcontexts

hnote is a variable  which concatatination datetime plus suppliernote;suppnote is sourcefield

String notes="";

int hnoteLoop =0;

          if (suppnote.length>0)  {

                    for(int strgLgth = 0;strgLgth >= suppnote.length;strgLgth=strgLgth+70)

   

                    {

                    if (hnote.length>=70 )

                    {

                    notes= hnote[].substring(0,70) ;

                              hnote=hnote[].substring(70,hnote.length());

                              }

                              else {

                              hnoteLoop = hnoteLoop +1;

                              notes= hnote ;

                              }

                                                                                                                        }

                    }

reesult.addValue(hnote);

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Mahesh

Change the for loop as

for(int strgLgth = 0;strgLgth <= suppnote.length;strgLgth=strgLgth+70)

Also if ppssible provide us the input strcuture and the expected output structure so that we can provide you the desired code.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Mahesh,

Please send to us a sample source and target structure along with a sample input and a desired output.

Regards,

Mark

former_member452321
Participant
0 Kudos

Thank you Mark. The issue is resolved