Lets consider the following table as an example
Contact_Id | Contact_Name | Contact_Address |
101 | Mike | Strasse 11 |
102 | Thiru | Strasse 12 |
103 | Mani | Street 22 |
104 | Miru | Street 23 |
105 | Manoj | Street 25 |
- Insert records from a database table in to an Internal table in SAP ABAP
- Example: SELECT contact_id contact_name contact_address FROM ztt_table1 INTO TABLE lt_internal_table
- Append the contents of a structure(work area) to an Internal table in SAP ABAP
Example:
ls_structure-contact_id = 200.
ls_structure-contact_name = ‘Virat kohli’
ls_structure-contact_address = ‘Street 200’.
APPEND ls_structure TO lt_internal_table.
- APPEND the contents of an internal table1 to an another internal table 2
APPEND LINES OF lt_internal_table1 TO internal_table2
- Insert the work area contents in to an Internal table
INSERT ls_structure INTO TABLE lt_internal_table1.
- Insert the work area contents at a particular position in an internal table
INSERT ls_structure INTO lt_internal_table1 INDEX 4.
- Insert the lines of an internal table 1 in to an internal table 2
INSERT LINES OF lt_internal_table1 INTO TABLE lt_internal_table2.
- Insert the lines of an internal table 1 at a particular position of an internal table 2
INSERT LINES OF lt_internal_table1 INTO lt_internal_table2 INDEX 3.
- Inserting records in to an internal table directly using VALUE command
DATA lt_internal_table1 TYPE TABLE OF ztt_table2.
lt_internal_table1 = VALUE #( ( contact_id = 300 contact_name = ‘Rishi’ contact_address = ‘Street 33’ ) ).