Welcome Everyone…. Here we will talk about internal tables and some operations on it.
Firstly, internal tables are a dynamic dataset which are capable to hold records. Data in an internal table is stored in rows and columns and contains data only at runtime unlike DB tables. All the records have the same structure and the key. Individual records in the internal tables can be accessed either by index or by keys. Loop statement can be used to access every record in the internal table one by one.
There are 3 types of internal tables in SAP ABAP programming –
- Standard internal table.
- This type of internal table has internal linear index.
- Data can be accessed either using index or keys.
- The access time is proportional to the number of table entries.
- This type of table always has a non-unique key.
- Sorted internal table.
- Data is always saved in these internal table in a sorted manner.
- Data can be accessed either using index or keys.
- Since the system uses binary search, the access time is logarithmically proportional to the number of entries.
- It can have either unique or non-unique keys. While defining these internal tables we must specify the key as unique or non-unique.
- Hashed internal table.
- These types of internal tables don’t have any linear index.
- Data in these tables can be accessed only by using keys.
- Access time is independent of the number of entries in the table.
- Key in this kind of table must be unique.
- While defining these tables, we much specify key as unique.
Operations on standard internal tables –
- Insert data.
- Using Append.
- Using Insert.
- Change/Modify/Update data.
- Using Modify.
- Using Update.
- Access/Read data from the table.
- Using keys.
- Using index.
- Delete data.
Well enough of theory. Let’s get into some coding !!!