cancel
Showing results for 
Search instead for 
Did you mean: 

How to loop for a particuler field in segment with multiple occurance

Former Member
0 Kudos

Hi All,

I have a source Idoc coming to XI. There one segment with occurance 1....Unbounded, and has qualifier field in it. I want to look for a particual value in that qualifier field and then map the next field to target. How do I write UDF for the above requirement??

Idoc-Segment (1---Unbounded)

-


qualifier

-


field-value

We have to loop through that segment and when ever the qualifier is AB, then we need to map the value in field-value.

Can anyone please provide sample code for the same??

Thx

Navin

Accepted Solutions (0)

Answers (2)

Answers (2)

prabhu_s2
Active Contributor
0 Kudos

why do you need udf....u ca use the if..else condition in grpahical maping.

Former Member
0 Kudos

Hi

Write a UDF , the type of UDF , select queue.

qualifier -removecontext---\ -


UDF - SplitByValue-target field

field-value-removecontext--/

in UDF

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

if (qualifier(i).equals("value"){

result.addValue(field-value(i));

}

}

try

Regards

Chilla