We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!
OPEN DATASET dset FOR access IN
mode $[position$]
$[
os_additions$]
$[error_handling$].
This statement opens the file specified in dset on the host computer of the current for the access specified in access in a storage mode specified in mode. dset expects a character-like data object containing the physical name of the file. The file must not yet be open in the current program; otherwise a catchable exception is raised.
The additions positions,
os_addition, and error_handling
can be used to determine the position at which file is opened, specify platform-dependent additions, and can be used for error handling.
Access to a file whose name dset is injected into 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 | The file was opened. |
8 | The operating system could not open the file. |
In order to find the reason, why the operating system could not open a file, the addition MESSAGE
should always be used for the statement OPEN DATASET. In case of an error, a message is also written to the
developer trace, but only if the trace level is 2 at least.
The example demonstrates the following:
The XML data is created by transforming an internal table to the asXML format.
Catchable Exceptions
Non-Catchable Exceptions
Leave us your contact details and we will call you back. Fields marked with * are mandatory.
We offer holistic SAP solutions from a single source to shape digital change and develop new business areas.
Switzerland
Schaffhausen
Germany
Mannheim, Düsseldorf, Munich
USA
Haverhill
Greece
Thessaloniki