cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Mapping issue: Function 'Substring error'

Former Member
0 Likes
2,282

Hi All,

I have an incoming field of length upto 30 which needs to be split into 3 diff fields of length 10 each.

I used the function 'substring' in Mapping using the following range 0-10 and 10-20 and 20-30. It works fine if the string has all 30 characters.

If the string has only 10 characters, then the first field is poulated but for the remiaing 2 fields I get the error

Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 10] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[185120, com.sap.aii.mappingtool.tf3.rt.Context@3d1048df]

I guess the issue is because string is only 20 caharcters long.

Is there any other way I can split the string without getting this error.

Many thanks

Shirin

View Entire Topic
Former Member
0 Likes

Hi Shrin,

best way is to write UDF (Java) . get the length of the String and based upon the length u can write u r code to get the string first three or watever u requirment is demanding

rgds

srini