Using combination of “AND” and “OR” in SELECT in ABAP


You can use the following query:

SELECT * FROM my_table
WHERE condition 1
AND condition 2
AND ( id EQ '2' or id EQ ‘3’ ).

Note: There should be space after and before bracket.

Alternatively you can use IN statement as below:

SELECT * FROM my_table
WHERE condition 1
AND condition 2
AND EQ IN ('2', ‘3’ ).




Updated on: 09-Dec-2019

7K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements