DATA - BEGIN OF
DATA BEGIN OF struc [READ-ONLY].
INCLUDE TYPE|STRUCTURE ...
DATA END OF struc.
The declaration of a new
structure. It is initiated using a
statement with the
BEGIN OF addition and must be ended using a
DATA statement with the
END OF addition.
DATA statements can include any
DATAstatements, particularly further closed structures,
and the statements
The meaning of these statements is the same as in the definition of structured data types in section
TYPES - BEGIN
OF. Here, however, it is used to generate a bound structured data type. A structure cannot be created without at least one component.
A component of type
struc cannot itself be declared by means of reference
struc. If the name
struc is specified after
LIKE when a component is declared, the system searches for the next object of this name in a higher
visibility section and uses it if found. If no more global objects exist with this name, then a syntax error occurs.
READ-ONLYaddition is only possible for the whole structure and not for individual structure components (
A structure cannot have the name
textsince this is reserved for addressing text symbols.
BOXEDaddition cannot be specified between
DATA BEGIN OFand
DATA END OFwhen components are declared. Static boxes in structures can only be defined with
In an obsolete variant, you can also specify
text field literals or the
spaceconstant as anonymous components between
The use of the
OCCURSaddition to define standard tables with structured row types is obsolete.
In this example, a structure (
spfli_struc) is declared with an elementary component
index) and a substructure
SELECT loop shows a possible use of the nested structure.
DATA: BEGIN OF spfli_struc,
index TYPE i,
spfli_wa TYPE spfli,
END OF spfli_struc.
spfli_struc-index = spfli_struc-index + 1.
WRITE: / spfli_struc-index,