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

string length to short

joerg_arndt
Participant
0 Likes
1,174

Hi Friends,

I read with open dataset a line into a string.

Data text_line type string.

READ DATASET dir INTO text_line.

The record in the text file is about 350 characters.

But when I watch the debugger, text_line shows only 255 characters.

Has anyone an explanation for it?

Thanks in advance.

Jimbob

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
994

Hi,

check this link

Regards

5 REPLIES 5
Read only

Former Member
0 Likes
995

Hi,

check this link

Regards

Read only

Former Member
0 Likes
994

Hi,

CHeck the length of text_line.

Read only

0 Likes
994

Thanks for the reply.

The length of text line is variable, means it fits normally allways and it is not possible to assign a length.

But even when I change the declaration to

DATA text_line(1024) type c.

it shows only 255 characters.

DATA text_line(1024) type c. ( only 255 possible)

OPEN DATASET dir FOR INPUT IN TEXT MODE encoding DEFAULT.

DO.

READ DATASET dir INTO text_line.

IF SY-SUBRC <> 0.

EXIT.

ENDIF.

DO SOMTHING..............

ENDDO

thanks for your answers.

Jimbob

Edited by: jimbob on Mar 23, 2008 4:52 PM

Read only

joerg_arndt
Participant
0 Likes
994

I can not believe it is not possible to open a file and read a record longer than 255 characters.

In report " /SAPDMC/SAP_LSMW_IMPORT_TEXTS"

there is a variable "DATA: line(1000)" for this purpose.

So I assume it works there, but why not here.

And if not, how is it possible to to read files like what, per Hand?

It is crazy.

Read only

joerg_arndt
Participant
0 Likes
994

Problem solved.

Reason:

during the filetransfer from frontend to server in ASC mode the format of the file was changed.

Now the transfer takes place in BIN mode and everything is fine.

It was defenetly a matter of the file format.

Rg. Jimbob

Edited by: jimbob on Mar 24, 2008 12:03 PM