ABAP Keyword Documentation →  ABAP Programming Guidelines →  Robust ABAP →  Internal Tables → 

Selecting the Table Category

Background

The table category specifies the internal administration for an internal table and the primary access type:

Standard tables and sorted tables can be summarized under the term index tables. An index access is always the fastest way to access table entries. The prerequisite for an index access is that the value for the index specification has been determined in advance. This usually requires a previous key access, for example, via READ TABLE, where the sy-tabix system field is set.

Rule

Use a suitable table category

Select the table category according to the primary requirements. As a rule of thumb, if the tables are large, the following selection criteria apply:

Details

Particularly for tables with a lot of rows, you have to select the appropriate table category carefully. The following recommendations are mainly derived from the processing speed requirements:

In addition to the processing speed, memory requirements can also play an important role. If this is supposed to be optimized according to Consider the Ratio of Administration and Application Data, you must also take into account the administration costs of the table categories.

Depending on the length of the key and the number of lines in an internal table, the access via a sorted key can be as fast as or even faster than using a hashed table. In such a case, and if the memory space is critical, you should work with a sorted table instead of a hashed table.

If you use secondary keys, the rules mentioned here may be qualified to a certain degree, as the overall costs need to be considered in this case.