cancel
Showing results for 
Search instead for 
Did you mean: 

How to append source segments

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

you can achive that using user defined functions

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

Regards,

michal

Former Member
0 Kudos

Hi Michal,

Can you please provide me the sample code for the same?

Thx

Navin