Skip to Content

UDF for concat

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Mar 02, 2016 at 03:47 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded