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

problem with unicode file

Former Member
0 Likes
394

Hi,

when I open a file (input mode) I can only read part of the file because the file is created without End of Line ('#'). I tried to read

into a string but it return sy-subrc = 4. It's impossible to read all the file and then get the information.

I read about this and I tried with cr_lf = cl_abap_char_utilities=>cr_lf but it doesn't work.

Anybody has a suggestion , please?

Thanks in advance.

DATA: REG(255) TYPE C.

OPEN DATASET FILE_IN FOR INPUT IN TEXT MODE ENCODING NON-UNICODE.

IF SY-SUBRC EQ 0.

DO. "Only 1 time because the file has one register.

READ DATASET FILE_INTO REG. "Here is the problem I only read 150 chars.

[..]

ENDO.

[..]

ENDIF.

2 REPLIES 2
Read only

Former Member
0 Likes
368

Are you sure the DO exits after one iteration? I dont see a exit statement there. Anyways try using encoding default with text mode or the file might have also been created in binary mode.

Vikranth

Read only

Former Member
0 Likes
368

The solution:

It's impossible work with a wrong file so you have to modify the report which makes the file.