cancel
Showing results for 
Search instead for 
Did you mean: 

UDF not working in runtime

AntonioSanz
Active Participant
0 Kudos

Hi all I have this UDF function. It creates 4 segments for the idoc MATMAS based on values. I have tested on ES and works fine. But if I test my integration scenario in runtime workbench it doesnt work. In fact, if I dont add the try - cacth block I get a indexoutofboundexception. I have test with the same message. I am getting crazy, how can be possible to be working on ES and not in RWB????

AbstractTrace at = container.getTrace();

at.addInfo("createE1MARMM");

String psl_stand = "";

String largo_psl = "";

String ancho_psl = "";

String alt_psl = "";

String psl_pal_st = "";

String psl_man_st ="";

String alt_man = "";

String un_fajado = "";

try

{

    psl_stand = PSL_STAND[0];

    largo_psl = LARGO_PSL[0];

    ancho_psl = ANCHO_PSL[0];

    alt_psl = ALT_PSL[0];

    psl_pal_st = PSL_PAL_ST[0];

    psl_man_st =PSL_MAN_ST[0];

    alt_man = ALT_MAN[0];

    un_fajado = UN_FAJADO[0];

}

catch (Exception e){}

at.addInfo("psl_stand="+psl_stand);

at.addInfo("largo_psl="+largo_psl);

at.addInfo("ancho_psl="+ancho_psl);

at.addInfo("alt_psl="+alt_psl);

at.addInfo("psl_pal_st="+psl_pal_st);

at.addInfo("psl_man_st="+psl_man_st);

at.addInfo("alt_man="+alt_man);

at.addInfo("un_fajado="+un_fajado);

if (!"".equals(psl_stand) ||

     !"".equals(largo_psl) ||

     !"".equals(ancho_psl) ||

     !"".equals(alt_psl))

{

    result.addValue("");

}

if (!"".equals(psl_pal_st))

{

    result.addValue("");

}

if (!"".equals(psl_man_st) ||

     !"".equals(alt_man))

{

    result.addValue("");

}

if (!"".equals(un_fajado))

{

    result.addValue("");

}

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>I am getting crazy, how can be possible to be working on ES and not in RWB???

take the message from RWB and put in the test tab

then you will know why it's not working

Regards,

Michal Krawczyk

AntonioSanz
Active Participant
0 Kudos

Thanks to all.

I have found my problem. I am picking the file with file adapter using content conversion. I get at xml with this format:

<RECORD>

   <SUBRECORD1></SUBRECORD1>

   <SUBRECORD2></SUBRECORD2>

....

But in my mapping I am expecting

<ns0:RECORD>

   <ns0:SUBRECORD1><ns0:/SUBRECORD1>

   <ns0:SUBRECORD2><ns0:/SUBRECORD2>

....

That is why the mapping in runtime is not getting any value for the xml tags.

I have changed to parameter for file content conversion to add ns0: to my xml tags.

Now all works fine.

Thanks to all for your post!!!

Answers (2)

Answers (2)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Just few cents....  Testing at runtime is different from design time.  You see arrayindexoutofbound exception. That means check the occurences of input values vs string index like PSL_STAND[] array etc. If you try to access string index more than specified, you have this message.

Former Member
0 Kudos

What are the input arguments passed to the UDF and what are the output arguments used in the UDF.?

Your are expecting to create four segments, so try to use four output arguments in the UDF.