Skip to Content
avatar image
Former Member

How to append source segments

Hi All,

I am doing mapping between Idoc and target structure.There is one Idoc segment that has 1 to Unbound occurance with only 2 fields, 1st field is 2 char length and 2nd field is 86 characters. We want to append the 2nd field (Lets say segment occurs 3 times, append 3 values that are in 2nd field) and need to split it based on delimiter "|". Then first value after delimitation goes to one segment in target and rest of the values goes to other target segment.

Can anyone please provide me the sample code to write UDF??

Thx

Navin

Message was edited by:

navin kumar

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 16, 2007 at 04:54 PM

    Hi,

    you can achive that using user defined functions

    (type queue of such a function stores all values of one tag)

    Regards,

    michal

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 18, 2007 at 04:32 AM

    Hi,

    You can achieve this with UDF, select type of UDF as queue

    first field -


    removecontext\--


    UDF -- Splitbyvalue-----targetfield

    secondfield---removecontext/

    in UDF

    String a = ""; /*give required length for this string

    String() b ; /* to store the split values in this array

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

    a = a.concat(secondfield(i));

    }

    b = Split(a,"|");

    /* here all split values are stored in arra b

    for(j=0;j<b.length;j++){

    result.addValue(b(j);

    }

    Regards

    Chilla

    Regards

    Chilla

    Add comment
    10|10000 characters needed characters exceeded