on 04-16-2007 5:13 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
you can achive that using user defined functions
(type queue of such a function stores all values of one tag)
Regards,
michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.