on 12-19-2011 7:05 PM
Hi ,
I have a mapping problem where i need to split the source field by comma into 2 seperate target fields.
For eg. Source = 123 main Street , 455 , app1
I need this to be split by comma to target1 = 455 and target2 = app1.
Please advice.
Thanks,
Teresa
Hi Teresa
You need to use an UDF. With two parameters one for input and the other for position.
String valSplit[] = input.split(",");
int position = Integer.parseInt(Pos);
return valSplit[position].toString();
source----
>
...................................UDF----
>Target
constant(position)------>
Regards.
Luis Ortiz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Luis,
Thanks. I created the UDF but i do not have any input node. The output of the UDF is mapped to target.
I have created two parameters one for input and one for position.
so if source is 123 main street , 555 , 222
How will i be able to put 555 in target1 and 222 in target2 ?
Thanks,
Teresa
Yes i am using like that but getting the following error below during activation.
Message Mapping: MM_Ecc6 | http://test.com:
Starting compilation
Source text of object Message Mapping: MM_Ecc6 | http://test.com has syntax errors:
Function Split, Line 1:
cannot find symbol symbol : method split(java.lang.String) location: class com.sap.aii.mapping.api.TransformationInput String valSplit[] = input.split(","); ^
Function Split, Line 2:
cannot find symbol symbol : variable Pos location: class com.sap.xi.tf._MM_Ecc6 int position = Integer.parseInt(Pos);
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.