Internal Tables in SAP ABAP [ Part 1 ]

You can consider internal tables like a multi dimensional array in SAP ABAP. It’s a temporary table created and filled by program execution, ends with Program completion. Internal table contents are stored in RAM of application server.

There are 3 types of internal tables:

  1. Standard
  2. Sorted
  3. Hashed

Standard internal tables can be accessed via index or key. Index means row number(s). Non unique entries can be present in the Internal table. Linear search by default is applied when searching/accessing via key.
Standard table declaration:
DATA: it_ekpo type standard table of ty_ekpo.

Sorted internal table contents are sorted and contents can be accessed via index or key, Binary search is employed when searching via key. Non unique entries can be present.
Sorted Table Declaration
DATA: it_ekpo type sorted table of ty_ekpo with unique key ebeln.

Hashed internal table contents are always unique. Table can be accessed only via key. Hash algorithm is used to organize the contents .
Hashed Table Declaration
DATA: it_ekpo type hashed table of ty_ekpo with unique key ebeln.