ABAP Programs: Appending multiple lines
REPORT ZSOURCE1205.
* Work area for a database table
TABLES CUSTOMERS.
* Defining internal tables
DATA: ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100
WITH HEADER LINE,
OLD_CUSTOMERS LIKE CUSTOMERS OCCURS 10
WITH HEADER LINE.
* Filling both internal tables
SELECT * FROM CUSTOMERS INTO TABLE ALL_CUSTOMERS.
SELECT * FROM CUSTOMERS INTO TABLE OLD_CUSTOMERS.
* Appending one internal table to the other
APPEND LINES OF OLD_CUSTOMERS TO ALL_CUSTOMERS.
* Displaying the result
LOOP AT ALL_CUSTOMERS.
WRITE / ALL_CUSTOMERS-NAME.
ENDLOOP.
———————
ABAPer, mail: abap.community@gmail.com http://abaplearner.blogspot.com
If you like this post, you may as well like these too:
- ABAP Programs: Appending single lines REPORT ZSOURCE1204.* Work area for a database tableTABLES CUSTOMERS.* Types for later useTYPES: BEGIN OF T_CUSTOMER_CITY, ID LIKE CUSTOMERS-ID, CITY LIKE CUSTOMERS-CITY, END OF T_CUSTOMER_CITY.* Internal table with two...
- ABAP Programs: Internal tables with header lines REPORT ZSOURCE1202.* Work area for a database tableTABLES CUSTOMERS.* Defining an internal table with header lineDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Reading all entries of the...
- ABAP Programs: Modifying multiple entries in a database table REPORT ZSOURCE1306.* Work areaTABLES CUSTOMERS.* Internal table for changed entriesDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 50 WITH HEADER LINE.* Filling the internal tableSELECT * FROM CUSTOMERS INTO TABLE ALL_CUSTOMERS WHERE...
- ABAP Programs : Inserting multiple entries in a database table REPORT ZSOURCE1302.* Work areaTABLES CUSTOMERS.* Internal table for new entriesDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Filling the internal tableALL_CUSTOMERS-ID = ‘12345678′.ALL_CUSTOMERS-NAME = ‘Brown’.APPEND ALL_CUSTOMERS.ALL_CUSTOMERS-ID = ‘11111111′.ALL_CUSTOMERS-NAME...
- ABAP Programs: Deleting multiple entries from a database table REPORT ZSOURCE1308.* Work areaTABLES CUSTOMERS.* Internal table for deleted entriesDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 50 WITH HEADER LINE.* Filling the internal tableSELECT * FROM CUSTOMERS INTO TABLE ALL_CUSTOMERS WHERE...

















Leave a Reply