Show TOC

 Inserting an IncludeLocate this document in the navigation structure


You can include only flat structures in a table. No field refers to another structure in a flat structure. All the fields of a flat structure refer either to a data element, or they are directly assigned a data type, field length and decimal places.

A field name cannot have more than 16 places in a table. A structure can only be included in a table if none of the field names of the structure are longer than 16 places.


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.

  1. Place the cursor under the line in which you want to insert the include and choose Edit Include Insert.

A dialog box appears.

  1. In the dialog box, enter the structure name. You can optionally enter a group name (for more information, see Named Includes ) or a three-place suffix.

    With the group name, you can access the fields in the include together in ABAP programs.

    The suffix can be used to avoid name collisions between fields of the include and fields of the table. The suffix is added to all the fields of the include, whereby the field name is first truncated if necessary.

  2. Choose  with the quick info text Continue.

    The system inserts a line with .INCLUDE in Fields and the name of the include in field typein the field maintenance screen of the table.

  3. Select column Key if all the fields in the include must be key fields of the table.

    The table key must be at the start of the field list. If you select column Key, you must insert the include after the last key field or between the existing key fields of the table.

    If you do not select column Key, none of the included fields is a key field of the table.

  4. Choose  with the quick info text Activate.

The fields of the include are added to the table in the database. If you insert the fields of the include as key fields, the system builds the primary index of the table again.

You can find information about the activation flow in the activation log, which you can display with Utilities Activation log. The system displays the activation log immediately if errors occur when the table is activated.

Additional Options

You can display the fields contained in an include by placing the cursor on the line of the include and choosing  with the quick info text Expand include. The fields of the include are now shown below this line. You can cancel this action by choosing  with the quick info text Compress include.

You can expand all the includes contained in a table by choosing  with the quick info text Expand all . Cancel this action by choosing  with the quick info text Compress all.

You can copy the fields contained in the include directly to the table by choosing Edit Include Copy components. The fields of the include become table fields. They are no longer adjusted to changes in the include.

See also: