on 05-16-2016 2:21 PM
Hi, I have the following error in Message Mapping:
Runtime exception when processing target-field mapping XYZ; root message: Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 9] in class com.sap.aii.mappingtool.flib7.TextFunctions method substring[, 8, 1, com.sap.aii.mappingtool.tf7.rt.Context@7ef50bf6]
See error logs for details
Any suggestions.
Thank you!
Hello Vijay
Remember java String starts in position 0.
Maybe you need
substring(7,1) insted substring(8,1)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello vijay,
simple substring error,
Ensure your input values are good enough to pass throrugh the substring.
For example:
Input-------->substring(0,2)-------->Output
If the input is A then you will get error as it has only one character and substring is expecting 2 characters.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijay,
As Apu mentioned, your mapping is using substring under Text.
If you are using this function then it will expect exact/larger length in its input payload.
If lesser length comes in input payload it will throw array out of bound index.
Check whether your logic is correct else return some default value if length is lesser than expected as per your mapping logic.
Regards,
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vijay,
The error tells all -
you are putting values in such a parameter whereas its expecting less values. Looks like you are using a sub string and there you are not giving enough length in the input data so that your sub string can cut it from input value and give it to your target parameter.
Thanks,
Apu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.