Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

datasets

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.

Tags:
Former Member
replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question