INTERNAL TABLES
Internal Tables:
The same SAP Database is Accessed by all the departments in the organization and each department wanted to use same information in a different way and is manipulated according to their requirements and the changes to that data is not required by the other departments so that the copy of the database table should be fetched into the program and to maintain copy of table database table, In program also we need some table temporarily, which can accommodate multiple records and which is nothing but internal table.
Technically, internal table is an un-limited Array (Collection of Homogeneous Data types). I.e. it is a variable to maintain any no of entries (records).
Features of internal tables:
Memory allocation is Dynamic
The data is stored line (record) by line (record) in memory, and each line has the same structure. So that Accessing Data from the Internal Tables also record by record.
A particularly important use for internal tables is for storing and formatting data from a database table within a program and Manipulate according to the user requirements.
Syntax to the Declare Internal Table:
DATA <> TYPE <>.
ITAB is internal table name.
DATATYPE should be multilane data type.
Note:
There is no predefined multilane data type in abap but which can be defined by our own.
Steps to Declare Internal Table:
1) Define the single line (structured) data type if not available.
Declare the structured Data type, I.e. a user defined data type with the required fields, According to the fields required from the corresponding database table(s).
TYPES : BEGIN OF
Field1 type
Field 2 type,
Field3 type,
………………….,
END OF
Note: TYPE is to define user defined data type.