ABAP for Cloud Development
AS ABAP Release 914, ©Copyright 2024 SAP SE. All rights reserved.
ABAP - Keyword Documentation → ABAP Core Data Services (ABAP CDS) → ABAP CDS - Data Definitions → ABAP CDS - DDL for Data Definitions → ABAP CDS - CDS Entities → ABAP CDS - Projection Views → CDS DDL - CDS Projection View, Transactional Queries →
CDS DDL - WHERE, Transactional Query
Syntax
... WHERE cds_cond ...
Description
Defines a WHERE
condition for the result set of a CDS projection view. When the CDS projection view is accessed, the result set contains only the data from the projected entity cds_entity
that meets the condition cds_cond
specified after WHERE
.
The condition is either a single relational expression rel_expr
or an expression constructed from the Boolean operators NOT
, AND
, and OR
.
In CDS projection views, the following rules apply to the operands and syntax of the WHERE
condition:
- Comparison operators,
BETWEEN
,LIKE
, andIS [NOT] INITIAL
are allowed as operators. - The Boolean operators
NOT
,AND
, andOR
are supported. lhs
expects a field of the projected entity. The field does not necessarily have to be included in the projection list.rhs
can be a field of the projected entity, a CDS literal, or a session variable. When using the operatorLIKE
,rhs
must be a character literal.