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: 

long text with concatenate

Former Member
0 Kudos

Hi,

I have read a long text into a internal table and now I want to combine all these lines in one. I have done this with the following code.

REPORT zz_sylvie2 LINE-SIZE 1023.

DATA:

text_ges(999) TYPE c,

...

CALL FUNCTION 'READ_TEXT'

...

TABLES

lines = it_line.

LOOP AT it_line INTO wa_line.

CONCATENATE text_ges wa_line-tdline INTO text_ges SEPARATED BY space.

ENDLOOP.

The concatenated text (text_ges) ends at 256 signs, but the text ist longer. Why is this so? What can I do to see this text?

Can anybody help me?

Thanks

sylvie

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi sylvia,

Instead of DATA delaration, declare it asstring.

DATA: text_ges TYPE string. " Change

Please check.

Award points if found useful.

4 REPLIES 4

Former Member
0 Kudos

Hi,

variables of type C are limited to 256 characters. You better use STRING for the data declaration.

<b>data text_ges TYPE string.</b>

<b><REMOVED BY MODERATOR></b>

Message was edited by:

Alvaro Tejada Galindo

Former Member
0 Kudos

try declaring text_ges as string.

The length of a string is not static but variable and adjusts itself to the current field content at runtime. Dynamic memory management is used internally. Strings can have any length unlike chareceter filed.

You can store data upto 2 GB inside a string variable.

Former Member
0 Kudos

Hi sylvia,

Instead of DATA delaration, declare it asstring.

DATA: text_ges TYPE string. " Change

Please check.

Award points if found useful.

Former Member
0 Kudos

Hello,

The longest data type existing in SAP ABAP is EDI_SDATA which is 1000 charactes long. If this solves your problem then use this otherwise use the type STRING.

Thanks.

Abhijit.