ABAP Programs: Using internal tables as snapshots of database tables
REPORT ZSOURCE1103.
* Work area for a database table
TABLES CUSTOMERS.
* Internal table
DATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100
WITH HEADER LINE.
* Filling the internal table with all entries of the database table
SELECT * FROM CUSTOMERS INTO TABLE ALL_CUSTOMERS.
* Displaying the contents of the internal table
LOOP AT ALL_CUSTOMERS.
WRITE: / ALL_CUSTOMERS-NAME.
ENDLOOP.
~~~~~ end of post ~~~~~
———————
ABAPer, mail: abap.community@gmail.com http://www.erpdb.info
If you like this post, you may as well like these too:
- Source Code: Working with database tables and internal tables REPORT ZSOURCE0103. * Declaration of a work area for a Dictionary tableTABLES CUSTOMERS. * Internal table used as snapshot of the database tableDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER...
- ABAP Programs: Records and internal tables REPORT ZSOURCE0407. * Records (or structures) consist of a fixed number of componentsDATA: BEGIN OF CUSTOMER, ID(8) TYPE N, NAME(25), TELEPHONE(12), END OF CUSTOMER. * Working with the different components...
- ABAP Programs: Using Internal Tables for Selection Criteria REPORT ZSOURCE1112.* Work areasTABLES: CUSTOMERS, BOOKINGS.* Internal tablesDATA: ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE, ALL_BOOKINGS LIKE BOOKINGS OCCURS 500 WITH HEADER LINE.* Reading entries from both database tableSELECT...
- 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 database...
- ABAP Programs: Filling an internal table from a database table REPORT ZSOURCE1203.* Work area for a database tableTABLES CUSTOMERS.* Defining an internal table with header lineDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Filling the internal table (previous content...
- ABAP Tips on Data Dictionary and Internal tables Data Dictionary Maintenance Views Lock Objects Internal Tables Free text search in a field in a internal table Types of Internal Tables Working with Internal Tables...
- ABAP Programs: Using a Logical Database REPORT ZSOURCE1502. * Work areas TABLES: CUSTOMERS, BOOKINGS. * Reading data GET CUSTOMERS. WRITE / CUSTOMERS-NAME. GET BOOKINGS. WRITE: AT /3 BOOKINGS-FLDATE....
- 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: Inserting single entries in a database table REPORT ZSOURCE1301.* Work areaTABLES CUSTOMERS.* Record used as alternative work areaDATA MY_CUSTOMER LIKE CUSTOMERS.* Inserting one entry from the work areaCUSTOMERS-ID = ’12345678′.CUSTOMERS-NAME = ‘Brown’.INSERT CUSTOMERS.IF SY-SUBRC 0. WRITE: /...
- ABAP Programs: Updating multiple entries in a database table REPORT ZSOURCE1304.* Work areaTABLES CUSTOMERS.* Internal table for changed entriesDATA CHANGED_CUSTOMERS LIKE CUSTOMERS OCCURS 50 WITH HEADER LINE.* Filling the internal tableSELECT * FROM CUSTOMERS INTO TABLE CHANGED_CUSTOMERS WHERE CITY...
- ABAP Programs: Modifying single entries in a database table REPORT ZSOURCE1305.* Work areaTABLES CUSTOMERS.* Modifying an entryCUSTOMERS-ID = ’12345678′.CUSTOMERS-CITY = ‘Village’.MODIFY CUSTOMERS. ~ end of post ~ ———————ABAPer, mail: abap.community@gmail.com http://www.erpdb.info...
- 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 CITY...
- ABAP Programs: Deleting single entries from a database table REPORT ZSOURCE1307.* Work areaTABLES CUSTOMERS.* Deleting an entryCUSTOMERS-ID = ’12345678′.DELETE CUSTOMERS. ~ end of post ~ ———————ABAPer, mail: abap.community@gmail.com http://www.erpdb.info...
- 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 CITY...
- ABAP Programs: Updating single entries in a database table REPORT ZSOURCE1303.* Work areaTABLES CUSTOMERS.* Record used as alternative work areaDATA MY_CUSTOMER LIKE CUSTOMERS.* Updating one entry from the work areaCUSTOMERS-ID = ’12345678′.CUSTOMERS-CITY = ‘Village’.UPDATE CUSTOMERS.IF SY-SUBRC 0. WRITE: ‘Entry...



















The job you are doing is excellent. Lot of people getting benefited from this site.
Regards,
Imtiyaz