Using SubQueries in ABAP

1
ABAP Structure

Sometimes you just want to know whether some records in a secondary table exist or not. You don‘t need their actual content.
This is where Subqueries come in handy:

Are there any rows in the SFLIGHT table without a corresponding entry in table SPFLI?

SELECT carrid connid
INTO (xcarrid, xconnid)
FROM sflight AS f
WHERE NOT EXISTS ( SELECT * FROM spfli
WHERE carrid = f~carrid
AND connid = f~connid ).

1 thought on “Using SubQueries in ABAP

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: