2008 Apr 17 10:57 PM
hi, i need help,i have a file in server: file.txt, i rename this to file.ols,but file.txt yet exist,
how i delete the file file.txt....
2008 Apr 18 4:11 AM
Hi,
See the example.
DATA FNAME(60) VALUE 'myfile'.
OPEN DATASET FNAME FOR OUTPUT.
OPEN DATASET FNAME FOR INPUT.
IF SY-SUBRC = 0.
WRITE / 'File found'.
ELSE.
WRITE / 'File not found'.
ENDIF.
DELETE DATASET FNAME.
OPEN DATASET FNAME FOR INPUT.
IF SY-SUBRC = 0.
WRITE / 'File found'.
ELSE.
WRITE / 'File not found'.
ENDIF.
The output appears as follows:
File found
File not found
In this example, the file "myfile" is opened for write access as long as it does not already exist. The system finds the file when it is opened for read access. After the DELETE DATASET statement, the system can no longer find the file
Don't forget to reward i8f useful...
hi, i need help,i have a file in server: file.txt, i rename this to file.ols,but file.txt yet exist,
how i delete the file file.txt....
2008 Apr 17 11:00 PM
where is the file?
is it in application server or presentation server?
if its in appltn server use "Delete dataset"
bye
2008 Apr 17 11:29 PM
2008 Apr 17 11:37 PM
You can use the function module - ISH_N2_DELETE_FILE_APP_SERVER,
Pass the file path and file name to it, it deletes the file.
Thanks,
Srinivas
2008 Apr 18 4:11 AM
Hi,
See the example.
DATA FNAME(60) VALUE 'myfile'.
OPEN DATASET FNAME FOR OUTPUT.
OPEN DATASET FNAME FOR INPUT.
IF SY-SUBRC = 0.
WRITE / 'File found'.
ELSE.
WRITE / 'File not found'.
ENDIF.
DELETE DATASET FNAME.
OPEN DATASET FNAME FOR INPUT.
IF SY-SUBRC = 0.
WRITE / 'File found'.
ELSE.
WRITE / 'File not found'.
ENDIF.
The output appears as follows:
File found
File not found
In this example, the file "myfile" is opened for write access as long as it does not already exist. The system finds the file when it is opened for read access. After the DELETE DATASET statement, the system can no longer find the file
Don't forget to reward i8f useful...
2008 Apr 18 5:52 AM
1) If the file in presentation server
use FM: GUI_DELETE_FILE
or
use static method: CL_GUI_FRONTEND_SERVICES=>FILE_DELETE.
2)If the file is in application server
use the syntax : DELETE DATASET <filename>.
Reward if it useful.
Dara.
2020 Jun 02 8:03 PM
I suggest you try Long path tool is the very good program for easily delete, copy & rename long path files, error, unlock solution. Try it and solve your problem.