SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP − Reference → Processing External Data → ABAP Database Accesses → Open SQL → Open SQL - Read Accesses → SELECT → SELECT - WHERE → WHERE - sql_cond →sql_cond - AND, OR, NOT
Syntax
... sql_cond1 AND sql_cond2 AND sql_cond3 ...
... sql_cond1 OR sql_cond2 OR sql_cond3 ...
... NOT sql_cond ...
Effect
Any number of logical expressions using AND or OR can be joined to make one logical expression using sql_cond and the result of a logical expression can be negated using NOT. The same rules apply as for general logical expressions. In particular an explicit use of parentheses is also possible.
The following additional rules apply to logical expressions whose result is unknown:
Notes
Example
Reads flights from Frankfurt to Los Angeles or San Francisco.
DATA spfli_tab TYPE TABLE OF spfli.
SELECT *
FROM spfli
INTO TABLE spfli_tab
WHERE cityfrom = 'FRANKFURT' AND
( cityto = 'LOS ANGELES' OR
cityto = 'SAN FRANCISCO' ).