SAP Database

ABAP Programs: Ordering query results

Print This Post Email This Post Written by admin on Nov 30th, 2007 | Filed under: ABAP Programs
1
2
3
4
5
6
7
8
9
REPORT ZSOURCE1108.
* Work area
TABLES CUSTOMERS.
* Reading table entries in a specified order
SELECT * FROM CUSTOMERS
ORDER BY CITY NAME.
WRITE: / CUSTOMERS-CITY,
CUSTOMERS-NAME.
ENDSELECT.

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

  1. ABAP Programs: A simple query REPORT ZSOURCE1101. * Work area for a database table TABLES CUSTOMERS. * Reading all entries of the database table SELECT * FROM CUSTOMERS. WRITE: / CUSTOMERS-NAME. ENDSELECT. ...
  2. 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: /...
  3. 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: /...
  4. ABAP Programs: Using Select-Options REPORT CHAP1109.* Work areaTABLES CUSTOMERS.* Specifiying a Select-OptionSELECT-OPTIONS SNAME FOR CUSTOMERS-NAME.* Internal table for later useDATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Reading table entries according to...
  5. ABAP Programs: Using an alternative work area REPORT ZSOURCE1102.* Work area for a database tableTABLES CUSTOMERS.* alternative work areaDATA MY_CUSTOMER LIKE CUSTOMERS.* Reading all entries of the database tableSELECT * FROM CUSTOMERS INTO MY_CUSTOMER. WRITE: /...



Leave a Reply

  • Help Support CRY