ABAP Types of Internal tables


Example

DATA: <TABLE NAME> TYPE <SORTED|STANDARD|HASHED> TABLE OF <TYPE NAME> 
      WITH <UNIQUE|NON-UNIQUE> KEY <FIELDS FOR KEY>.

Standard Table

This table has all of the entries stored in a linear fashion and records are accessed in a linear way. For large table sizes, table access can be slow.

Sorted Table

Requires the addition WITH UNIQUE|NON-UNIQUE KEY. Searching is quick due to performing a binary search. Entries cannot be appended to this table as it might break the sort order, so they are always inserted using the INSERT keyword.

Hashed Table

Requires the addition WITH UNIQUE|NON-UNIQUE KEY. Uses a proprietary hashing algorithm to maintain key-value pairs. Theoretically searches can be as slow as STANDARD table but practically they are faster than a SORTED table taking a constant amount of time irrespective of the size of the table.