Skip to Content
-1

Abap - CONCATENATE long string into variable

Dec 17, 2017 at 01:14 PM

108

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded

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.

2
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Horst Keller
Dec 17, 2017 at 02:47 PM
1

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

Share
10 |10000 characters needed characters left characters exceeded
Sandra Rossi Dec 17, 2017 at 01:39 PM
0

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.
Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

1

Even c fields can be much larger.

1