You are on page 1of 2

Assignment-2

Difference between standard, sorted and hashed internal tables.


Standard internal tables:
Standard tables have an internal linear index. From a particular size upwards, the indexes of
internal tables are administered as trees. In this case, the index administration overhead increases in
logarithmic and not linear relation to the number of lines. The system can access records either by
using the table index or the key. The response time for key access is proportional to the number of
entries in the table. The key of a standard table is always non-unique. You cannot specify a unique key.
This means that standard tables can always be filled very quickly, since the system does not have to
check whether there are already existing entries.
To fill a standard table, append lines using the (APPEND) statement. You should read,
modify and delete lines by referring to the index (INDEX option with the relevant ABAP command).
The response time for accessing a standard table is in linear relation to the number of table entries. If
you need to use key access, standard tables are appropriate if you can fill and process the table in
separate steps. For example, you can fill a standard table by appending records and then sort it. If you
then use key access with the binary search option (BINARY), the response time is in logarithmic
relation to the number of table entries.
Sorted internal tables:
Sorted tables are always saved sorted by the key. They also have an internal index. The
system can access records either by using the table index or the key. The response time for key access
is logarithmically proportional to the number of table entries, since the system uses a binary search.
The key of a sorted table can be either unique or non-unique. When you define the table, you must
specify whether the key is to be UNIQUE or NON-UNIQUE. Standard tables and sorted tables are
known generically as index tables.
Sorted tables are appropriate for partially sequential processing in a LOOP, as long as the
WHERE condition contains the beginning of the table key.
Hashed Internal Tables:
Hashed tables have no linear index. You can only access a hashed table using its key. The
response time is independent of the number of table entries, and is constant, since the system access the
table entries using a hash algorithm. The key of a hashed table must be unique. When you define the
table, you must specify the key as UNIQUE.
This table type is particularly suitable if you want mainly to use key access for table entries.
You cannot access hashed tables using the index. When you use key access, the response time remains
constant, regardless of the number of table entries.

You might also like