TYPES - BEGIN OF struct_type
TYPES BEGIN OF struc_type.
TYPES comp ...
TYPES comp TYPE struc_type BOXED.
INCLUDE TYPE|STRUCTURE ...
TYPES END OF struc_type.
Defines a structured type
struc_type. This is introduced using a
statement with the addition
BEGIN OF and must finish with a
TYPES statement with the addition
The following can be included between these
TYPESstatements, in particular further closed structure definitions.
The definition of static boxes using
INCLUDE STRUCTUREfor including components from other structures.
No structured types can be created that do not have at least one component.
TYPES statements within the statements
END OF define the components of the structured type
If a component is a structured type or if a new structured type is defined within a structure using
BEGIN OF and
END OF, substructures are created. A structure with substructures is known as a nested structure.
A component of
struc_type cannot be declared with reference to
itself . If the name
struc_type is specified after
TYPE in the declaration of a component, the next type of this name is searched for in a higher
visibility area, and used if found. If a more global type of this name does not exist, a syntax error occurs.
If a component is created as a table type, this type cannot be generic.
components of the structured type
struc_type by using the components of a differently structured type or an existing structure at the same level.
The components of a structured type are divided using the name
struc_type and the name of the component, and addressed using the structure component selector
This example defines two structured types,
address_type contains structured types as components. The definition of
zipcode_type shows the access to substructures.
TYPES: BEGIN OF street_type, name TYPE c LENGTH 40, no TYPE c LENGTH 4, END OF street_type. TYPES: BEGIN OF address_type, name TYPE c LENGTH 30, street TYPE street_type, BEGIN OF city, zipcode TYPE n LENGTH 5, name TYPE c LENGTH 40, END OF city, END OF address_type. TYPES zipcode_type TYPE address_type-city-zipcode.