Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Abap - CONCATENATE long string into variable

Former Member
0 Kudos

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

5 REPLIES 5

Sandra_Rossi
Active Contributor

It's not the SAP support here, it's a community with people of good will (most of them are not related to the SAP company), trying to help other people.

Sandra_Rossi
Active Contributor
0 Kudos

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.

I think the issue is he didn't actual use a "string" data type or field.

horst_keller
Product and Topic Expert
Product and Topic Expert

Even c fields can be much larger.

horst_keller
Product and Topic Expert
Product and Topic Expert

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