F Internal Table in SAP | CodeTheta

Internal Table in SAP

June 11, 2024

Internal Table is basically a temporary table in SAP, it contains line items or data records in program runtime. It doesn't store any actual data.

In SAP there are 3 internal concepts:
1. Standard Table
2. Sorted Table
3. Hashed Table

1. Standard Table: This table can contain unique and duplicate records. This table can be accessed using INDEX. Standard table should fill the records
using APPEND and read, modify, delete entries using the INDEX option. Access time of data records in standard table increases with linear relationship with
the number of records in a table.
Syntax: DATA: it TYPE STANDARD TABLE OF ty_str.

2. Sorted Table: Sorted table can contain unique and duplicate both records. Using INSERT we can fill the data to the table.
Syntax for non-unique: DATA: it TYPE SORTED TABLE OF ty_str WITH NON-UNIQUE KEY id.
Syntax for unique: DATA: it TYPE SORTED TABLE OF ty_str WITH UNIQUE KEY id.

3. Hashed Table: Hashed tables always contain unique records. We can not do INDEX access in the Hashed table. Only KEY access is allowed.
Syntax: DATA: it TYPE SORTED TABLE OF ty_str WITH NON-UNIQUE KEY id.

If you have any Question you can contact us or mail us. We will reply you as soon as possible.

Post a Comment