Source Code: Working with database tables and internal tables
REPORT ZSOURCE0103.
* Declaration of a work area for a Dictionary table
TABLES CUSTOMERS.
* Internal table used as snapshot of the database table
DATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100
WITH HEADER LINE.
* Reading the entries of the database table into an internal table
SELECT * FROM CUSTOMERS INTO TABLE ALL_CUSTOMERS.
* Displaying each line of an internal table
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: Using internal tables as snapshots of database tables REPORT ZSOURCE1103.* Work area for a database tableTABLES CUSTOMERS.* Internal tableDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Filling the internal table with all entries of the database tableSELECT...
- SAP Tips: Change Database tables directly SAP being a very robust system has some flaws.. maybe they kept it intentionally so that we can play with it. Anyways, As far as i know there are two...
- 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 [...]...
- 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...
















Leave a Reply