cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping Exception.

vijay_b4
Active Contributor
0 Kudos

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!

Accepted Solutions (0)

Answers (4)

Answers (4)

juan_vasquez2
Active Participant
0 Kudos

Hello Vijay

Remember java String starts in position 0.

Maybe you need

substring(7,1) insted substring(8,1)

former_member186851
Active Contributor
0 Kudos

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.

former_member183249
Active Participant
0 Kudos

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

apu_das2
Active Contributor
0 Kudos

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