Creating Database Indexes

Use

To avoid long runtimes when archive information structures are accessed, we recommend that you create a database index for every infostructure. The index helps speed up accesses to the database table of the infostructure. If you are using an infostructure that does not have a database index, you can use this function to create an index.

Do not create your own database indexes for SAP infostructures, because this may create problems during the transport of the infostructures, due to naming conventions. Instead, copy the relevant SAP infostructure into your own namespace and then create an index for the new infostructure.

Integration

The data of the infostructure is saved in the database table, which is generated when the infostructure is activated, that is, directly in the production system. Because production systems generally have protections against changes to cross-client objects (settings in system change option), it is not possible to create database indexes for generated Archive Information System tables. Instead, you can use the function described below, provided by the Archive Information System, to do so.

Features

To create a database index for an infostructure simply define it. The index will then be generated when you activate its infostructure in the database. The index definition is stored in table AIND_STR8.

To use the function for the definition of a database index from the Archive Information System choose Customizing ® Goto ® Database Index.

You will see a table whose rows correspond to the fields of the index you want to define. The columns of the table have the following meaning:

Column

Meaning

Index Name

Name under which the index is saved in the ABAP dictionary

Position

Position of a field in the index

Field Name

Technical name of the filed in the infostructure

Incorporate the fields you want into the table. If you need the field MANDT (Client), then you must incorporate it manually.

Keep in mind the following considerations when you are working with database indexes for archive information structures:

·        Entries in table AIND_STR8 are transported automatically together with the infostructure. You only need to manually trigger the transport if the infostructure itself is not to be transported.

·        If you delete an infostructure, the corresponding entries in table AIND_STR8 are also deleted.

·        If you remove a field that is also part of an archive index from an infostructure, you must adapt table AIND_STR8 manually, otherwise you will encounter problems when you try to activate the infostructure.

·        The system only recognizes index definition entries if no database table exists yet for the infostructure. Therefore, you may have to delete the database table of the infostructure. You can find this function in the Archive Information System under Customizing ® Utilities ® Delete Table.

Creating or changing a database index for an already existing infostructure generally means long runtimes, because you must deactivate the infostructure, delete the corresponding tables, activate the infostructure and then refill it. You can use program ASCORRINDX to make changes to database indexes without having to delete the corresponding infostructures and fill them again. For more information about how to use this program see the corresponding program documentation.

Example

The index definition for the standard infostructure SAP_FI_DOC_002 contains the following rows:

Index Name

Position

Field Name

LIF

10

MANDT

LIF

20

LIFNR

LIF

30

BUKRS

REF

10

MANDT

REF

20

AWKEY

When you activate the infostructure a database table with two indexes is creates: The index LIF contains the fields MANDT, LIFNR, and BUKRS (in that order), and the index REF contains the fields MANDT and AWKEY.