SAP DELETE DATASET ABAP Statements



Get Example source ABAP code based on a different SAP table
  


ID DELETE-DATASET
• DELETE DATASET ABAP Statement

DELETE DATASET
Short Reference

ABAP_SYNTAX
DELETE DATASET dset.

What does it do?
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.



Latest notes:

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

ABAP_HINT_SEC
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.
ABAP_HINT_END
ABAP_SUBRC_GENERAL sy-subrcMeaning 0File has been deleted. 4File could not be deleted.



Runtime Exceptions



Catchable Exceptions
CX_SY_FILE_AUTHORITY
Reason for error:
No authorization for access to file
Runtime error:
OPEN_DATASET_NO_AUTHORITY (can be handled)
CX_SY_FILE_OPEN
Reason for error:
File cannot be opened
Runtime error:
DATASET_CANT_OPEN (can be handled)



Example ABAP Coding

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

Return to menu