Ansicht
Dokumentation

ABENDDIC_INCLUDE_STRUCTURE - DDIC INCLUDE STRUCTURE

ABENDDIC_INCLUDE_STRUCTURE - DDIC INCLUDE STRUCTURE

CL_GUI_FRONTEND_SERVICES - Frontend Services   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

- Include Structures

Components of a structure can be defined by including the components of other DDIC structures, including DDIC database tables or DDIC views. These included structures are referred to as include structures or includes for short. From a technical perspective, the structure in which an include structure is included refers to the included structure and is modified accordingly whenever changes are made to this structure. An include structure can itself contain include structures, with the maximum nesting depth being nine includes.

When an include structure is included, all components of an existing structure are added to the including structure instead of a component. No substructure is created, which means that the components are inserted as if they were specified individually at this position and they are handled like directly defined components. Regular components and include structures can be combined as required.

When a structure is included as an include structure, it can be assigned a name of a group and a three-character suffix.

  • In ABAP programs, the name of a group is an additional addressing option for data objects declared with reference to the structure. All components of the included structure form a component group and can be addressed together using this name or individual components can be addressed using the structure component selector (-) after the name.
  • A suffix is appended to the component name to rename each component and avoid naming conflicts between identically named components. The original name of a component of an include structure that is included in a structure with a suffix cannot have more than 27 characters.

Group names and suffixes are assigned in the same way as with the additions AS name $[RENAMING WITH SUFFIX suffix$] of the statement INCLUDE TYPE in ABAP programs. Unlike in the statement INCLUDE TYPE, an include structure in the ABAP Dictionary can have a suffix without a specified name.

The fields of an included include structure still belong to the included structure. They can only be edited by modifying the structure and any changes made to the structure affect all including structures. The fields of an included include structure can, however, also be transformed to direct fields of the including structure. These fields are then no longer linked with the originally included structure.

The components of an include structure can be assigned check tables and search helps in the context of the including structure. These assignments enhance the components of the included structure or replace existing assignments.

Notes

  • Including structures is highly error-prone due to possible naming conflicts between components, particularly in the case of subsequent enhancements to the included structure. If possible, substructures should be used instead. If this is not possible, for example, in DDIC database tables, suffixes should be used to avoid naming conflicts.
  • Including structures should not be confused with the inheritance of components as provided by the ABAP Dictionary tool. Here, the definition of the components is simply copied to a different structure and no binding is persisted. Similarly, an existing include can be resolved to individual component definitions.
  • The name of a group is just an additional addressing option and does not resolve any naming conflicts. In particular, group names in statements like MOVE-CORRESPONDING or SELECT INTO CORRESPONDING are ignored. Components renamed with a suffix, on the other hand, really do have this name and are respected accordingly.

Example

The structure DEMO_WEEK includes the structure DEMO_DAY five times as an include structure with group names and suffixes. The program DEMO_INCLUDE_STRUCTURE shows how its components can be accessed in ABAP.






RFUMSV00 - Advance Return for Tax on Sales/Purchases   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 5862 Date: 20240426 Time: 222137     sap01-206 ( 110 ms )