Skip to Content
avatar image
Former Member

Max lenght of a string

I have to convert a catalog (5000 lines) into a XML...

I declare my XMLStream into a DATA: XMLStream type STRING.

With a test catalog it's ok but with the real catalog (5000 material) I have this message :

An exception with the type CX_SY_RANGE_OUT_OF_BOUNDS occurred, but was neither handled locally, nor declared in a RAISING clause

I define all counters into float type.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Jun 23, 2004 at 02:22 PM

    Hallo Jerome,

    Are you asking a question or just want us to listen? I am not sure. I have had run away programs generate strings that get close to gigabyte memory before they died.

    As we have no idea what you are doing exactly (and can you even explain it in less then 25 lines of code?), we are not sure what the problem is.

    Since you decided to visit us in the BSP forum, we have to think that you are using BSP? If yes, consider to write parts of your XML string directly into the HTTP response as you produce it.

    Alternatively, look at using XML dom. Or better XSLT to convert ABAP table into XML.

    The error you mention has nothing to do with a too long string. It has to do with the fact that you are indexing a string where there is no string. Let me give you an example:

    DATA: s TYPE STRING VALUE 'abc'.

    IF s(2) IS NOT INITIAL.

    " this still works

    ENDIF.

    IF s(4) IS NOT INITIAL.

    " and this causes such an out of bounds message

    ENDIF.

    Why have counters? And why are they float? Only if you can compress it below 25 lines of code!

    ++bcm

    Add comment
    10|10000 characters needed characters exceeded