Skip to content

Avoid UPDATE or DELETE Without a WHERE Condition (Catastrophic Data Wipe Prevention) ​

WarningSecurity & Robustness#EC NO_UNFILT_DMLRemote Enabled

Overview ​

Flag DML without WHERE on database tables.

ATC Finding Message: Filter database writes with a WHERE condition

Rationale ​

Executing an UPDATE or DELETE statement targeting a database table without an explicit WHERE clause modifies or truncates every single record in the entire table. In production environments, this causes catastrophic data loss, brings business operations to a halt, and requires emergency point-in-time database restoration.

Safety Standard: Always provide a restrictive WHERE condition on every database DML statement. If a full-table operation is genuinely required (e.g., in staging tables), enforce it through explicit administrative procedures.

Non-Compliant ​

abap
" Disaster: Wipes all customer purchase history in the entire system!
DELETE FROM zorder_items.

Compliant ​

abap
" Safe: Scoped deletion with mandatory WHERE condition
DELETE FROM zorder_items
  WHERE order_id = @iv_order_id.
IF sy-subrc <> 0.
  " Handle not found or log
ENDIF.

Suppression ​

To suppress findings for this rule, append the pseudo-comment to the statement:

abap
" Standard pseudo-comment:
... "#EC NO_UNFILT_DML

" SAP CI_ prefix format:
... "#EC CI_NO_UNFILT_DML

Technical Details ​

Released under the MIT License.