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

file processing

Former Member
0 Likes
328

A program reading file using

OPEN DATASET dsn FOR INPUT IN TEXT MODE.

takes long tiome for opening the file ,

can anyone suggest how to reduce the time ?

1 ACCEPTED SOLUTION
Read only

former_member386202
Active Contributor
0 Likes
309

Hi,

Do like this

OPEN DATASET l_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc NE 0.

*--Error in opening file

MESSAGE i368(00) WITH text-005.

ENDIF.

*--Get all the records from the specified location.

DO.

READ DATASET l_file INTO l_line.

IF sy-subrc NE 0.

EXIT.

ELSE.

SPLIT l_line AT cl_abap_char_utilities=>horizontal_tab

INTO st_ipfile-vbeln

st_ipfile-posnr

st_ipfile-edatu

st_ipfile-wmeng.

APPEND st_ipfile TO it_ipfile.

ENDIF.

ENDDO.

Regards,

Prashant

1 REPLY 1
Read only

former_member386202
Active Contributor
0 Likes
310

Hi,

Do like this

OPEN DATASET l_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF sy-subrc NE 0.

*--Error in opening file

MESSAGE i368(00) WITH text-005.

ENDIF.

*--Get all the records from the specified location.

DO.

READ DATASET l_file INTO l_line.

IF sy-subrc NE 0.

EXIT.

ELSE.

SPLIT l_line AT cl_abap_char_utilities=>horizontal_tab

INTO st_ipfile-vbeln

st_ipfile-posnr

st_ipfile-edatu

st_ipfile-wmeng.

APPEND st_ipfile TO it_ipfile.

ENDIF.

ENDDO.

Regards,

Prashant