Documentation View

We are hiring and constantly growing! Have a look through our vacancies to find the right role for you!

ABAPTYPES_BOXED - TYPES BOXED

ABAPTYPES_BOXED - TYPES BOXED

ABAP Short Reference   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.
SAP E-Book

TYPES, BOXED

Short Reference



TYPES comp TYPE struc_type BOXED.

Effect

This statement defines a substructure comp of a structure as a static box. It can only be located within a structure definition with the additions BEGIN OF and END OF of the statement TYPES, and only on the highest component level and not within nested BEGIN OF ... END OF blocks.

A structured data type must be specified for struc_type. This can be a local program structured type, a visible structured type of a class or a global interface, or a structure from the ABAP Dictionary, and can contain static boxes.

Static boxes support initial value sharing. The structure is not saved in the higher-level context itself. Instead, an internal reference that points to the actual structure is stored in place of the component. A static box is therefore a deep component.

Notes

  • A structure with a static box is a deep structure and the corresponding restrictions apply.

  • The BOXED addition defines the static box with reference to its context (structure or class). A data type that is declared by a direct TYPE or LIKE reference to a static box is assigned its data type but is not a static box.

  • When a static box is copied from one structure to another structure using the INCLUDE TYPE|STRUCTURE statement, its static box attribute is also copied.
  • If a nested structure whose static boxes already contain static boxes is to be created, this is only possible if each substructure in question exists as a standalone type. It is not possible to specify BOXED for substructures created by nesting using TYPES BEGIN OF ... TYPES END OF.
  • The addition BOXED can also be used in the statement DATA to declare a structured attribute of a class or an interface.

The following section shows how the addition BOXED can be used with the statement TYPES. In a structured type t_struc2, a substructure t_struc2-comp2 of type t_struc1 is declared as a static box.






CL_GUI_FRONTEND_SERVICES - Frontend Services   ABAP Short Reference  
This documentation is copyright by SAP AG.

Length: 3141 Date: 20230207 Time: 081442     sap01-206 ( 62 ms )