Warning: Undefined variable $saptab in /customers/9/5/e/s4hd.com/httpd.www/sap/abap-statements/index.php on line 47
Warning: file_get_contents(/customers/9/5/e/s4hd.com/httpd.www/global/php/adxcode.txt): Failed to open stream: No such file or directory in /customers/9/5/e/s4hd.com/httpd.www/global/php/helpers.php on line 89
Get Example source ABAP code based on a different SAP table
Warning: Undefined variable $prev in /customers/9/5/e/s4hd.com/httpd.www/sap/abap-statements/index.php on line 63
ID CLOSE-DATASET • CLOSE DATASET ABAP Statement
CLOSE DATASET> Short Reference >
ABAP_SYNTAX CLOSE DATASET dset.>
What does it do? This statement closes the file specified in dset> . dset> expects a character-like data object that contains the physical name> of the file. If the file is already closed or does not exist, the statement is ignored and the return code sy-subrc> is set to 0. If the operating system buffers data before it is written to a file and there is still data in the buffer, this data is written to the file before closing.
Latest notes: An opened file that was not explicitly closed using CLOSE DATASET> is automatically closed when the program is exited. ABAP_HINT_END ABAP_SUBRC_GENERAL
If a file was opened without the FILTER>> addition, sy-subrc> always contains the value 0 if no exception is raised.
If a file was opened using the FILTER> addition, sy-subrc> contains the return code of the filter program, which is returned by the operating system. This value is generally 0 if the statement was executed successfully.
Runtime Exceptions
Catchable Exceptions CX_SY_FILE_CLOSE>>
Reason for error:
The file could not be closed. Insufficient memory space is a possible reason for this.
Runtime error:
DATASET_CANT_CLOSE>
Example ABAP Coding
Closing of a file open for writing. ABEXA 00112 ABAP_EXAMPLE_END