SAP ABAP Internal Tables

SAP ABAP Internal Tables are the collection of records and dynamic memory collection i.e. need to allocate the size internal table for temporarily. So Internal tables are temporary tables, where the data in the tables are maintained in temporary memory (RAM) of application server and will be not saved in SAP system for permanently.

Scenario : The same SAP database is accessed by all departments in an organization and each other department uses the same information for different purposes and utilize according their requirements and change of data is not required by the other departments. So the copy of the database table should be fetched into the program and to maintain copy of database table.

Types of Internal Tables

The different types of internal tables in SAP ABAP are

  1. Standard Internal Tables
  2. Sorted Internal Tables
  3. Hashed Internal tables

Standard Internal Tables:

  • It is a default type of internal table.
  • When the records are searching in standard internal tables, the searching time varies based on position of the record in the Internal Tables.
  • It uses “Linear Search” algorithm for searching records in SAP system.

Sorted Internal Tables :

  • Sorted internal tables enables in arrangement the records automatically in a sorted order by using key field.
  • It uses “Binary Search” algorithm for searching records in SAP system.

Hashed Internal Tables

  • Hashed internal tables are special type of internal table and search the record by specifying the key.
  • Hashed internal tables users “Hashing Algorithm” to search the records
  • Hashed tables wont allow Append, Insert Command while adding records. The table should be filled with database directly.

Features of SAP ABAP Internal Tables

  • The data is stored record by record in memory and each line has the same structure.
  • Internal tables are used for storing and formation the data from a database table within a program.

Syntax used for declaring the Internal table

DATA <ITAB> TYPE <DATATYPE>