cancel
Showing results for 
Search instead for 
Did you mean: 

Problem while handling context of IDOC.

Former Member
0 Kudos

Hi All,

I am working on IDOC to file scenario.

My mapping is as follows:

The code for UDF is

String a = "";

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

{

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

{

a = stext[i];

result.addValue(a);

}

else

{

result.addSuppress();

}

}

The requirement is that I need to check if OTYPE is S then map the corresponding stext to Postxt field of target structure otherwise just send blank.

But with the result.addSuppress() postxt is not getting generated at all. and if I am using result.addValue("") to populate blank, then the postxt is generated with at target node when S does not exist, but in case where S exist it takes first value of output queue in which output is blank for otype O it still populates blank even in the case wher S exists.

So when correct result come Postxt node at target does not generate at all with addSuppress, otherwise with addValue("") postxt with blank generates where S does not exist but then it populates blank even when S exists.

Please help to handle these context.

Regards,

Sachi

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hi Sachi,


The code for UDF is

String a = "";

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

     if(otype[i].equals("S")){

          a = stext[i];

          result.addValue(a);

     }

     else{

          result.addSuppress();

     }

}

Change it to


String a = "";

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

     if(otype[i].equals("S")){

          a = stext[i];

          result.addValue(a);

     }

}

There is no need for the else statement.

Regards,

Mark

Former Member
0 Kudos

Thanks Mark.

Answers (1)

Answers (1)

apu_das2
Active Contributor
0 Kudos

Hi Sachi,

Before mapping with Postxt add node function SplitByValue(EachValue)

Thanks,

Apu