Ansicht
Dokumentation

ABAPDELETE_DATASET - DELETE DATASET

ABAPDELETE_DATASET - DELETE DATASET

Vendor Master (General Section)   BAL Application Log Documentation  
This documentation is copyright by SAP AG.
SAP E-Book

DELETE DATASET

Short Reference



DELETE DATASET dset.

Effect

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

Note

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

Access to a file whose name dset is passed to a program from outside is a serious security risk. Any names passed to a program from outside must be checked thoroughly before being used. 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

  • Cause: No authorization for access to file
    Runtime Error: OPEN_DATASET_NO_AUTHORITY (can be handled)

CX_SY_FILE_OPEN

  • Cause: File cannot be opened
    Runtime Error: DATASET_CANT_OPEN (can be handled)

Example

Opening of a file for writing and reading and then deleting the file.






ABAP Short Reference   TXBHW - Original Tax Base Amount in Local Currency  
This documentation is copyright by SAP AG.

Length: 2530 Date: 20240419 Time: 112430     sap01-206 ( 27 ms )