Skip to Content
0
Former Member
Apr 01, 2008 at 06:33 AM

FILENAME

14 Views

Hi

am using the simple program below.But am getting the output as FILE NOT READ.I hav a file with the same name in the 'C' drive.Please help.

REPORT ZBDC_3A.

DATA : FNAME(30) VALUE 'C:\ZFCHR1.TXT'.

DATA : STR(255).

OPEN DATASET FNAME FOR INPUT IN TEXT MODE ENCODING DEFAULT.

IF SY-SUBRC = 0.

DO.

READ DATASET FNAME INTO STR.

IF SY-SUBRC = 0.

WRITE : / STR.

ELSE.

EXIT.

ENDIF.

ENDDO.

ELSE.

WRITE : 'FILE NOT FOUND TO READ'.

ENDIF.

CLOSE DATASET FNAME.

With Regards

Vijay