Skip to Content
0
Former Member
Feb 27, 2012 at 07:14 AM

UDF for splitting a string

1667 Views

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