Skip to Content
avatar image
-1
Former Member

Abap - CONCATENATE long string into variable

Dear Support,

I have a loop which Concatenates two strings, the problem is Concatenate is limited only for 255 char.

how do I Concatenate string which is larger than 255 ?

Thanks

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Dec 17, 2017 at 02:47 PM

    I guess your target field is limited to 255 characters. That would be trivial.

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 17, 2017 at 01:39 PM

    Sorry but the concatenation is not limited to 255 characters at all, where did you read that?

    Run this code which does nothing except it doesn't short dump which proves that the resulting string3 is 400 characters long :

    DATA: string1 TYPE string, string2 TYPE string, string3 TYPE string.
    SHIFT string1 RIGHT BY 200 PLACES. TRANSLATE string1 USING ' X'. " or string1 = repeat( val = 'X' occ = 200 ).
    string2 = string1.
    CONCATENATE string1 string2 INTO string3.
    ASSERT strlen( string3 ) = 400.
    
    Add comment
    10|10000 characters needed characters exceeded