Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Declarations →  Declaration Statements →  Data Types and Data Objects →  Declaring Data Objects →  DATA →  DATA - BEGIN OF struc 

Declaration of a Nested Structure

This example demonstrates the declaration of a nested structure with substructures.

Other versions: 7.31 | 7.40 | 7.54

Source Code

      BEGIN OF address,
        BEGIN OF name,
          title   TYPE string VALUE `Mr.`,
          prename TYPE string VALUE `Duncan`,
          surname TYPE string VALUE `Pea`,
        END OF name,
        BEGIN OF street,
          name   TYPE string VALUE `Vegetable Lane`,
          number TYPE string VALUE `11`,
        END OF street,
        BEGIN OF city,
          zipcode TYPE string VALUE `349875`,
          name    TYPE string VALUE `Botanica`,
        END OF city,
      END OF address.
      )->write( address-name
      )->write( address-street
      )->write( address-city
      )->display( ).


Declaration of a nested local structure address with three structured components. When the method DISPLAY of class CL_DEMO_OUTPUT is called, each substructure is addressed using the structure component selector (-).