cOPEN DATASET - access
Short Reference
ABAP Syntax ... INPUT
| OUTPUT
| APPENDING
| UPDATE ... .
ABAP_ALTERNATIVES:
1 ... INPUT
2 ... OUTPUT
3 ... APPENDING
4 ... UPDATE
What does it do? :These additions are used to open the file for reading,
writing, appending, or changing. In
Unicode programs , specification of the access type is obligatory.
ABAP_ALTERNATIVE_1 ... INPUT
What does it do? :The addition FOR INPUT opens the file for
reading. By default, the file pointer is set at the start of the file.
If the file specified does not exist, sy-subrc is set to 8.
In a Unicode program , it is not
possible to obtain write access to a file that is open for reading. In a
non-Unicode program write access
is also permitted.
ABAP_ALTERNATIVE_2 ... OUTPUT
What does it do? :The addition FOR OUTPUT opens the file for
writing. If the specified file already exists, its content is deleted.
If the file specified does not exist, it is created. Read access is also
permitted.
ABAP_ALTERNATIVE_3 ... APPENDING
What does it do? :The addition FOR APPENDING opens the file for
appending. If the file specified already exists, it is opened and the
file pointer is set at the end of the file. If the file specified does
not exist, it is created. Attempted read access to a file opened with
FOR APPENDING with the statement READ
DATASET fails, and returns the value 4 for sy-subrc .
ABAP_ALTERNATIVE_4 ... UPDATE
What does it do? :The addition FOR UPDATE opens the file for
changes to the existing content. By default, the file pointer is set to
the start of the file. If the specified file does not exist, no file is
opened and sy-subrc is set to 8.
Documentation extract taken from SAP system, � Copyright SAP AG. All rights reserved