cancel
Showing results for 
Search instead for 
Did you mean: 

UDF for concat

former_member183906
Active Contributor
0 Kudos

hi,

my requirement is-

Source side - INP field is present which will have different values coming like 123 or 456 or 789 etc.

In the target side, i have OUT field which needs to concatenate values of INP. OUT should give output as 123,456,789. OUT should concatenate all values of INP and any number of values can come.

Can anyone share the UDF for it.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member182412
Active Contributor
0 Kudos

Hi SAP,

Use below UDF:

Execution Type: All Values Of Context


public void joinList(String[] list, ResultList result, Container container) throws StreamTransformationException{

String join = "";

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

if (i!= 0)

     join = join +","+ list[i];

else

     join = join + list[i];

}

result.addValue(join);

}

Regards,

Praveen.