In addition to listing the individual fields, you can also include the fields of another structure in tables and structures . Individual fields and includes can be mixed as required. The following figure shows a structure with fields F3and F4that is included in a table.
The usage of includes can lead to naming conflicts when the included structures or tables are changed later on. Therefore, you should use substructures, i.e. components of a structured type whenever possible. For database tables, where components must be elementary, named Includes with a suffix should be used to avoid naming conflicts.
When an include is changed, all the tables and structures that include it are automatically adjusted.
Structure A is included in table B. If you insert new field in structure A and then activate the structure, the system adjusts table B to this change. That is, the system inserts the new field also in table B.
You can assign the include a group name with which the group of fields in the include can be addressed as a whole in ABAP programs.
Includes can also be nested, that is, structure A includes structure B, which in turn includes another structure C and so on. The maximum nesting depth is limited to nine. The maximum length of a path of nested includes in a table or structure is therefore nine (the table/structure itself not included).This is explained in the figure below.
Only flat structures can be included. In a flat structure, every field either refers to a data element or is directly assigned a data type, length and decimal places (optional).
Only structures can be included in a table. Tables, structures and views can be included in a structure.
The length of the field names is more restricted in tables than in structures. In a table, a field name must not have more than 16 places, but in a structure up to 30 places are allowed for the field name. A structure can only be included in a table if none of the field names of the structure are longer than 16 places.
The path of nested includes can only contain one table.
Table TAB1 includes structure STRUCT1, which in turn includes structure STRUCT2. The path of the nested includes here contains only table TAB1. It is also possible to include TAB1 in a further structure, STRUCT0, but no other table TAB2 can be included in TAB1 since in this case a path of nested includes would contain two tables (TAB1 and TAB2).