on 02-27-2012 7:14 AM
Hi,
I am relatively new to SAP PI. I have a requirement to write a UDF in the mapping program which i find it difficult to do using the mapping functions itself.
I will get an input in a field as "SampleItem-RequestB"
This string has to be splitted into two different fields based on the string "-"
The first field should hold the letters before the "-" and the next 35 characters after "-" should be put in the second field.
So, the output should be
first field ==> SampleItem
second field ==> RequestID (Upto 35 characters only)
Could you please help me in writing an UDF for this requirement since i am not good at writing Java scripts.
Thanks,
Aslam
Hello,
At most, this needs two UDF (depending on the PI version).
SampleItem mapping
input -> UDF -> SampleItem
UDF type is single values (simple)
Arguments: input
return input.substring(0,input.indexOf("-"));
RequestID mapping
input -> UDF -> RequestID
UDF type is single values (simple)
Arguments: input
String temp = input.substring(input.indexOf("-")+1);
if(temp.length()>35)
return temp.substring(0,35);
else
return temp;
Hope this helps,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.