DELETE - Delete a file

Basic form

DELETE DATASET dsn.

Effect

Deletes the file specified in the field dsn.

The Return Code is set as follows:

SY-SUBRC = 0:
File deleted.
SY-SUBRC = 4:
File does not exist or could not be deleted.
Possible reasons:
1) The file does not exist.
2) The file is a directory.
3) The R/3 System has no search authorization
for a component of the file name.
4) The R/3 System has no search authorization
for the directory which contains the file.
5) A component of the search path is not a
directory.
6) The file is a symbolic link which cannot be
resolved (endless loop ?).
7) The file is a program which is currently
running.

Notes

The system automatically performs an authorization check. If the user does not have the appropriate authorization, a runtime error occurs. You can check the existence of an authorization with the function module AUTHORITY_CHECK_DATASET.

Exceptions

Catchable Exceptions

CX_SY_FILE_AUTHORITY

CX_SY_FILE_OPEN

Related

OPEN DATASET, READ DATASET, CLOSE DATASET.

Additional help

Deletion of a File