SAP Database

ABAP Programs: Using an alternative work area

Print This Post Email This Post Written by admin on Nov 27th, 2007 | Filed under: ABAP Programs

REPORT ZSOURCE1102.
* Work area for a database table
TABLES CUSTOMERS.
* alternative work area
DATA MY_CUSTOMER LIKE CUSTOMERS.
* Reading all entries of the database table
SELECT * FROM CUSTOMERS INTO MY_CUSTOMER.
WRITE: / MY_CUSTOMER-NAME.
ENDSELECT.

~~~~~~ end of post ~~~~~

———————
ABAPer, mail: abap.community@gmail.com http://abaplearner.blogspot.com

If you like this post, you may as well like these too:

  1. 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:...
  2. 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:...
  3. ABAP Programs: Reading single entries REPORT ZSOURCE1105.* Work area for a database tableTABLES CUSTOMERS.* Reading a single entrySELECT SINGLE * FROM CUSTOMERS WHERE ID = ‘87654321′.IF SY-SUBRC = 0. WRITE CUSTOMERS-NAME.ELSE. WRITE ‘Customer not...
  4. ABAP Programs: Working with tables from the Dictionary REPORT ZSOURCE0501. * Declaration of a work area for a Dictionary tableTABLES CUSTOMERS.* Reading all entries of the database table and displaying each entrySELECT * FROM CUSTOMERS. WRITE: /...
  5. ABAP Programs: Obtaining data with nested select loops REPORT ZSOURCE1111.* Work areasTABLES: CUSTOMERS, BOOKINGS.* Reading entries from both database tableSELECT * FROM CUSTOMERS. SELECT * FROM BOOKINGS WHERE CUSTOMID = CUSTOMERS-ID AND ORDER_DATE = ‘19990101′. WRITE: /...



Leave a Reply

  • Help Support CRY