ABAPDATA_OPTIONS - DATA OPTIONS
SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3upThis documentation is copyright by SAP AG.
DATA - data_options
Syntax
... [ VALUE val|{IS INITIAL} ]
[ READ-ONLY ].
Additions
1. ... VALUE val|{IS INITIAL}
2. ... READ-ONLY
Effect
The additions VALUE and READ-ONLY are specifically for data objects. They differentiate the DATA from the TYPES syntax.
Note
As well as the VALUE and READ-ONLY additions, the syntax also allows the obsolete addition COMMON PART.
Addition 1
... VALUE val|{IS INITIAL}
Effect
You can use the VALUE addition to define (for all forms of the variable declaration) astartvalue val for the content of the variable. This is used to initialize the variable when createdbefore LOAD-OF-PROGRAM.The VALUE addition is not allowed in the declaration part of an interface for the DATA statement.
The start value val can either be specified as a literal or as a predefined constant. If thedata type of the specified start value does not match the data type of the declaration, it is convertedin accordance with the conversion rules for elementary data types. No start value can be specified for structures with numeric components.
Without the VALUE addition, or if IS INITIAL is specified, the content is set to an initial value. Theinitial values are dependent on the data type.
In the case of initial structures, the components are initial; initial reference variables contain thenull reference that does not point to an object, and initial internal tables do not contain any rows.
The VALUE addition is possible for all data types, in particular for thedeep types (strings, reference types, table types, or structured types with deep components, includingboxedcomponents). A start value val, however, can only be specified for the ABAP types string and xstring. Otherwise, only IS INITIAL is possible.
Notes
- A start value should be specified according to type. In particular, no longer values should be specified and, in the case of certain data types such as d and t, the length must match exactly.
- If you specify numbers with decimal places or if, in the scientific notation with mantissa, you have an exponent as a startvalue for data objects of the data types p or f, you must remember that there are no literalsfor these numbers. Instead, the character literals must be specified with the appropriate content. Theseare then converted into the numeric data type in accordance with the conversion rules for elementary data types. The same applies to byte-like data objects.
Addition 2
... READ-ONLY
Effect
This addition is always possible in the public visibility area of a class or in an interface. It is also possible in theprotected andpackage-visiblevisibilityareas of a class, if this is declared using the OPENFOR PACKAGE addition. This addition makes an attribute declared using DATA readable from outside of the class, but can only be changed using methods of the class or its subclasses.
A class attribute defined using READ-ONLY can be used outside of the class only at read positions in ABAP statements.
Notes
- The declaration of attributes using the addition READ-ONLY does not prevent methods of the class from passingreferences to these attributes externally asreference variables orfield symbols and therefore making the attributes modifiable outside of the class.
- The READ-ONLY addition is always recommended if you want attributes to be private, but do not want to execute a GET method for every read access.
PERFORM Short Reference General Data in Customer Master
This documentation is copyright by SAP AG.
Length: 6571 Date: 20120522 Time: 044036 triton ( 267 ms )






