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

Long character

Former Member
0 Likes
644

Hi,

what is the data type to define long character where has more than 500 characters.

Type of char will only output 255 characters.

thanks

Alia

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
588

Alia,

If you are working with WAS 6.4 you can use STRING data type.

Regards,

Ravi

Note : Please reward if you find the answers useful.

Hi,

what is the data type to define long character where has more than 500 characters.

Type of char will only output 255 characters.

thanks

Alia

3 REPLIES 3
Read only

Former Member
0 Likes
589

Alia,

If you are working with WAS 6.4 you can use STRING data type.

Regards,

Ravi

Note : Please reward if you find the answers useful.

Read only

Former Member
0 Likes
588

Hi Alia

Depend on what you should to do.

You could use:

DATA STRING(LEN) TYPE C.

and LEN is the length which you need, for exalmple:

DATA STRING(1000) TYPE C.

But remember when you print the string on screen, you can see only 255 chars.

Or you can use the type STRING:

DATA STRING TYPE STRING.

now the length is automatically calculated by system

Max

Message was edited by: max bianchi

Read only

guillaume-hrc
Active Contributor
0 Likes
588

Hi.

I did the test with character and string. It is true that only the 255 first characters of the char is displayed, but the string is complete !

Do not forget to change the line-siez of the report.

Here is the code for the example :

REPORT  ZTEST LINE-SIZE 1023.

DATA : w_char(1001) TYPE c.
DATA : w_string     TYPE string.

DO 1000 TIMES.
  w_char+sy-index = 'A'.
ENDDO.

w_string = w_char.


WRITE : 'Test'.

SKIP.

WRITE : / 'CHAR  ', w_char.
WRITE : / 'STRING', w_string.

Let me know if I'm wrong.

Cheers