Start of Content Area

Background documentation Adjusting Database Structures  Locate the document in its SAP Library structure

To enable ABAP programs to access database tables correctly, the runtime object of a table must correspond to the structure of the table in the database. If the table is changed in the ABAP Dictionary, you must ensure that the database structure of the table is adjusted to the change in the ABAP Dictionary during activation (when the runtime object is rewritten).

This graphic is explained in the accompanying text

The database structure does not need to be changed for certain changes in the ABAP Dictionary. For example, the database table does not need to be adjusted to a change in the field sequence (except for key fields) in the ABAP Dictionary, since the field sequence in the ABAP Dictionary does not have to correspond to the field sequence in the database. In this case, the changed structure is simply activated in the ABAP Dictionary and the database structure remains unchanged.

The database structure of a table can be adjusted to its changed ABAP Dictionary definition in three ways:

The procedure actually used by the system in a particular case depends on the following:

If the table does not contain any data, the existing table is deleted in the database and recreated. If there is data in the table, the system tries to change the structure using ALTER TABLE. If the database system used cannot execute the structural change with ALTER TABLE, the table is converted.

Conversion is usually the most resource-intensive method of adjusting structures. But structural changes involving changes to the database catalog can also result in costly internal data reorganizations in some database systems. For details on the processes occurring in the database for structural changes with ALTER TABLE, refer to the documentation of your database system.

Caution

Normally you should not adjust the database structure during production. At least all the applications that access the table should be deactivated during the structural adjustment. Since the table data is not consistent during the structural adjustment (in particular during conversion), programs could behave incorrectly when they access this data.

See also:

Conversion Problems