Application Development and Automation 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: 
Read only

Abap - CONCATENATE long string into variable

Former Member
0 Likes
2,760

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
Read only

Sandra_Rossi
Active Contributor
1,653

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.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,653

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.
Read only

1,653

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

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
1,653

Even c fields can be much larger.

Read only

retired_member
Product and Topic Expert
Product and Topic Expert
1,653

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