ABAP Keyword Documentation → ABAP - Reference → Declarative statemnts → Data Types and Data Objects → Types and Objects - Overview → Details of Special Data Types or Data Objects
Boxed components are structures that are not saved in the higher-level context itself. Instead, an internal reference that points to the actual structure is stored in place of the structure. A boxed component is always a deep component of its context.
It is currently to possible to declare substructures of data types and structured attributes of classes as
that support initial value sharing.
Other versions: 7.31 | 7.40 | 7.54
- Boxed components are a halfway house between static and dynamic data objects. Their memory requirement has not already been defined when the program is started in internal mode, but they can be treated like static data objects with a fixed length.
- A nested structure that contains a boxed component as a component is always a deep stucture.
- Structures of ABAP Dictionary can also contain boxed components. ABAP Dictionary database tables cannot contain any boxed components as their structures have to be flat.
- In the classes and objects of the RTTS, boxed components are handled as follows:
- The class CL_ABAP_TYPEDESCR contains the constant TYPEKIND_BREF for static boxes. The value of these constants is listed as the type of a static box in the component table COMPONENTS of class CL_ABAP_STRUCTDESCR or attribute table ATTRIBUTES of classes CL_ABAP_CLASSDESCR or CL_ABAP_INTFDESCR.
- In the return value of the method GET_COMPONENTS of class CL_ABAP_STRUCTDESCR
or GET_ATTRIBUTE_TYPE of classes CL_ABAP_CLASSDESCR or CL_ABAP_INTFDESCR,
boxed components such as reference variables are listed as type objects of class CL_ABAP_REFDESCR.
The method GET_REFERENCED_TYPE of this class gets a type object for the substructure. A type object
of the class CL_ABAP_REFDESCR, which describes a boxed component, cannot be used in the statements