DELETE dbtab - cond
... WHERE sql_cond.
WHERE addition uses a logical expression
to specify which rows are deleted from the database table. The same rules apply to the logical expression
sql_cond as to the
condition of the
SELECT statement, with the exception that subqueries
cannot be evaluated in the database table to be changed. If there is no row in the database that fulfills
WHERE condition, a row is not deleted and
sy-subrc is set to 4. If a
WHERE condition is not specified, all rows are deleted.
All of an airline's flights that are scheduled for today and in which no seats are occupied are deleted
from database table SFLIGHT (also see the example for
PARAMETERS p_carrid TYPE sflight-carrid. DELETE FROM sflight WHERE carrid = p_carrid AND fldate = sy-datum AND seatsocc = 0.