INCLUDE STRUCTURE



Syntax

INCLUDE { {TYPE struc_type} | {STRUCTURE struc} }
        [AS name [RENAMING WITH SUFFIX suffix]].


Effect

This statement must be used only within a structure definition with the additions BEGIN OF and END OF in the statements TYPES, DATA, CLASS-DATA, and STATICS. It copies all the components of the structured type struc_type or the structure struc at the given position into the current structure definition. The components are created at the same level as the INCLUDE statement. The INCLUDE statement does not create any substructure.

struc_type can be a local (within program), structured type or a structure from the ABAP Dictionary. struc must be a structure of the same program.

Through the specification of a name name after the AS addition, either all the components of the bound structure struc_type or struc are addressed together through the name name or individual components can be addressed using the structure component selector (-).

Using the RENAMING WITH SUFFIX addition, each indivdual component is renamed by adding on the suffix suffix. Here, a structure can be copied several times. suffix must be specified directly.

Notes

Example

In this example, the structure week is defined by repeated copying of the components in the structured type t_day. The components for week are all on one level and can be addressed as follows: week-work_mon, week-free_mon, week-work_tue, and so on. Alternatively, however, the following address method is also possible: week-monday-work, week-monday-free, week-tuesday-work, and so on.

TYPES: BEGIN OF t_day,
         work TYPE c LENGTH 8,
         free TYPE c LENGTH 16,
       END OF t_day.

DATA BEGIN OF week.
  INCLUDE TYPE t_day AS monday    RENAMING WITH SUFFIX _mon.
  INCLUDE TYPE t_day AS tuesday   RENAMING WITH SUFFIX _tue.
  INCLUDE TYPE t_day AS wednesday RENAMING WITH SUFFIX _wed.
  ...
DATA END OF week.



Short Reference