Start of Content Area

Procedure documentation  Inserting an Include  Locate the document in its SAP Library structure

Prerequisites

Only flat structures may be included in a table. No field refers to another structure in a flat structure. All the fields of a flat structure therefore refer either to a data element or were directly assigned a data type, field length and decimal places.

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

Procedure

  1. Place the cursor under the line in which you want to insert the include and choose Edit ® Include ® Insert.
  2. A dialog box appears.

  3. Enter the structure name. You can optionally enter a group name (see Named Includes) or a three-place suffix.
  4. 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 already in the table. The suffix is added to all the fields of the include, whereby the field name is first truncated if necessary.

  5. Choose This graphic is explained in the accompanying text.
  6. A line with .INCLUDE in the Fields field and the name of the include in the Field type field is inserted in the field maintenance screen for the table.

  7. Select column Key if all the fields in the include should be key fields of the table.
  8. 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.

  9. Choose This graphic is explained in the accompanying text.

Result

The fields of the include are added to the table in the database. If you inserted the fields of the include as key fields, the primary index of the table is built again.

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

Other Options

You can display the fields contained in an include by placing the cursor on the line of the include and choosing This graphic is explained in the accompanying text . The fields of the include are now shown below this line. You can cancel this action with This graphic is explained in the accompanying text .

You can expand all the includes contained in a table with This graphic is explained in the accompanying text . Cancel this action with This graphic is explained in the accompanying text .

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

See also:

Includes