ABAP Keyword Documentation → ABAP − Reference → Obsolete Language Elements → Obsolete Declarations → Data Types and Data Objects
Anonymous Components
Other versions: 7.31 | 7.40 | 7.54
Obsolete Syntax
DATA: BEGIN OF struc,
...
'...',
...
space(len) [TYPE c],
...
END OF struc.
Effect
If text field literals
or the constant space
(the latter also with a length specified in parentheses) are specified within the
definition of a structure using DATA
,
CONSTANTS
, or STATICS
, nameless text fields are
included at this position as anonymous components. For literals, the initial value and the length of
these components correspond to the content. If space
is specified, a text
field filled with blanks is created. These anonymous text fields cannot be addressed explicitly in programs.
In particular, structures never contain components with the name space
. Anonymous components can only be accessed using the structure name and by specifying appropriate offsets/lengths.
Notes
- Anonymous components must not be specified in classes or interfaces.
- These anonymous components can be replaced easily by named components. Named components increase the function of anonymous components by allowing them to be accessed explicitly, without limiting their role as, for example, filler fields.