on ‎2008 Jul 28 12:22 PM
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
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 7 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.