ABAP Keyword Documentation →  ABAP − Reference →  Processing External Data →  ABAP File Interface →  Statements for the ABAP File Interface → 

DELETE DATASET  Syntax Diagram

Short Reference

Syntax

DELETE DATASET dset.

Effect

The statement deletes the file specified in dset. dset expects a character-like data object containing the physical name of the file. The file can be opened or closed.

Note

When a file is deleted, automatic authorization checks are performed; self-programmed checks may also be necessary.

Security Note

When specified dynamically, dset is a dynamic programming technique and can present a serious security risk if not used correctly. If the content of dset is used in a program from an external source, it must first be checked thoroughly. See Directory Traversal.

Return Value

sy-subrc Meaning
0 File has been deleted.
4 File could not be deleted.

Exceptions

Catchable Exceptions

CX_SY_FILE_AUTHORITY

CX_SY_FILE_OPEN