Skip to Content

StringIndexOutOfBoundsException: String index out of range XML - Idoc issue

Hi Experts

I'm having an issue in passing data from XML to an idoc. I get the error:

Runtime exception when processing target-field mapping /Z371INVOICE01/IDOC[4]/Z0371_INCINV_CREATE_ITEM[4]/MAKTX; root message: Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 30] in class com.sap.aii.mappingtool.flib7.TextFunctions method substring[Lemon Floor Jell 5L (EA) B006, 0, 30,

Maktx field in source wsdl (idoc dest) has a max char length of 40 and I know in ecc it has a max length of 60. So this shouldn't be an issue.

I've checked in Notepad++ for odd characters - as you can see in attachment there are non.

Ive restricted the fields characters to 39 using substring in mapping and yet it still falls over.

Can you please provide some insight of what else I can check?

maktx-wsdl.pngmapping-string-restriction.pngmapping-stringindexoutofboundsexception.pngxml-excerpt.png

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 17, 2017 at 08:33 PM

    Hi George!

    I guess that you use Substring function in your mapping and one of the indexes you set goes out of the actual string length.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 18, 2017 at 09:04 AM

    I've used substring to limit the no of chars for that field to maktx's limit of 40 -it failed on this so reduced it to 30 - but still sometimes fails..

    Add comment
    10|10000 characters needed characters exceeded

    • Hi George!

      You should check your source element's queue in message mapping. It's quite possible that some of your source values has length less than 30 symbols.

      Regards, Evgeniy.