Copyright 2022 - BV TallVision IT

Execute a SELECT statement as part of your SELECT statement - the subquery through IN.

Behold this example I stumbled across this morning:

data: lt_t5ni5 type standard table of t5ni5.
  SELECT * FROM t5ni5 INTO TABLE lt_t5ni5
    WHERE molga = '05' and
          begda <= sy-datum and
          endda >= sy-datum and
          actco IN ( SELECT actco FROM t5ni3 WHERE molga = '05' ).

This will execute the selection on T5NI3 first, and continue with the main selection afterwards.