SELECT is an Open-SQL-statement for reading data from one or several database tables into data objects.
Selecting All Records
* This returns all records into internal table lt_mara.
SELECT * FROM mara
INTO lt_mara.
Selecting Single Record
* This returns single record if table consists multiple records with same key.
SELECT SINGLE * INTO TABLE lt_mara
FROM mara
WHERE matnr EQ '400-500'.
Selecting Distinct Records
* This returns records with distinct values.
SELECT DISTINCT * FROM mara
INTO TABLE lt_mara
ORDER BY matnr.
Aggregate Functions
* This puts the number of records present in table MARA into the variable lv_var
SELECT COUNT( * ) FROM mara
INTO lv_var.