ABAP Keyword Documentation → ABAP - Reference → Processing External Data → ABAP File Interface → Statements for the ABAP File Interface → OPEN DATASET → OPEN DATASET - mode
OPEN DATASET - CODE PAGE
Other versions:
7.31 | 7.40 | 7.54
Syntax
... CODE PAGE cp ...
Effect
This addition specifies that the representation of character-like data objects in the file is based
on the code page specified in cp
. When a character-like data object is written
or read, a conversion between this code page and the current character representation is performed,
if necessary. If the addition is not specified, the data is read or written in a non-Unicode system
without conversion. In a Unicode system, the characters of the file are treated in accordance with the
non-Unicode code page that would be assigned at the time of read/write in a non-Unicode system (in accordance with the entry specified in the database table TCP0C of the current
text environment).
The code page specification cp
expects a character-like data object that
must contain, when the statement is executed, the name of a non-Unicode page from the column CPCODEPAGE in the database table TCP00. You must not specify a Unicode code page.
Notes
- In Unicode systems, this addition enables the automatic conversion of file content to the current character format when reading and writing files. In this way, files saved in non-Unicode systems can be imported into Unicode systems.
-
The statement
SET DATASET
can be used to specify a different code page for an opened legacy file. -
The addition
CODE PAGE
replaces the use of the obsolete statementTRANSLATE CODE PAGE
in when accessing files.