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

datasets

Former Member
0 Likes
475

Please go through the code.Make corrections

I am not able to open the file.

my txt file '20070203.txt' is present in this directory /USR/SAP/TMP/

i am not able to read the dataset .

help required.

TYPES: BEGIN OF ty_string,

str(300),

END OF ty_string.

DATA : i_string TYPE STANDARD TABLE OF ty_string WITH HEADER LINE,

wa_string TYPE ty_string .

DATA : p_FILE LIKE RLGRAP-FILENAME. "VALUE 'YINTERFACE'. " P_FILE1.

P_FILE = '/USR/SAP/TMP/20070203.txt'.

OPEN DATASET P_FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF SY-SUBRC = 0.

READ DATASET P_FILE INTO I_STRING-STR.

IF SY-SUBRC = 0.

ENDIF.

CLOSE DATASET P_FILE.

ENDIF.

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
442

Hi,

Please make the file name lower case.


...

DATA : P_FILE LIKE RLGRAP-FILENAME LOWER CASE. "Change here

P_FILE = '/usr/sap/tmp/20070203.txt'.
...

Regards,

Ferry Lianto

2 REPLIES 2
Read only

ferry_lianto
Active Contributor
0 Likes
443

Hi,

Please make the file name lower case.


...

DATA : P_FILE LIKE RLGRAP-FILENAME LOWER CASE. "Change here

P_FILE = '/usr/sap/tmp/20070203.txt'.
...

Regards,

Ferry Lianto

Read only

Former Member
0 Likes
442

oh thank you so much ..............