0% found this document useful (0 votes)
13 views2 pages

ABAP DELETE Statement Syntax Guide

The document discusses how to use the DELETE statement in SQL to remove entries from a database table. It explains that you first populate a work area with the key of the entry to delete. You then use the DELETE statement along with the table and work area to remove the matching entry. It provides an example of deleting a single entry using the primary key and an example of deleting multiple entries using a WHERE clause to specify the condition.

Uploaded by

Vikram Bigamudre
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

ABAP DELETE Statement Syntax Guide

The document discusses how to use the DELETE statement in SQL to remove entries from a database table. It explains that you first populate a work area with the key of the entry to delete. You then use the DELETE statement along with the table and work area to remove the matching entry. It provides an example of deleting a single entry using the primary key and an example of deleting multiple entries using a WHERE clause to specify the condition.

Uploaded by

Vikram Bigamudre
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

DELETE is the open SQL statement to delete entries from database table.

First declare a work area as the line structure of database table and populate the work area with the specific key that we want to delete from the database table. Then delete the entries from the database table using DELETE statement. The syntax for the DELETE statement is as follows. DELETE <database table> FROM <work area> If the database table contains a line with the same primary key as specified in the work area, the operation is completed successfully and SY-SUBRC is set to 0. Otherwise, the line is not deleted, and SY-SUBRC is set to 4.
DATA: gwa_employee TYPE zemployee. gwa_employee-id gwa_employee-name gwa_employee-place gwa_employee-phone gwa_employee-dept_id = = = = = 6. 'JOSEPH'. 'FRANKFURT'. '7897897890'. 5.

DELETE zemployee FROM gwa_employee.

EMPLOYEE table entries before DELETE

EMPLOYEE table entries after DELETE

We can also multiple lines from the table using the WHERE clause in the DELETE statement.

DELETE FROM <database table> WHERE <condition>

DELETE FROM zemployee WHERE dept_id = 2.

EMPLOYEE table entries after DELETE

You might also like