For JOIN
clauses:
SELECT s~carrid s~carrname p~connid
INTO CORRESPONDING FIELDS OF TABLE itab
FROM scarr AS s
LEFT OUTER JOIN spfli AS p ON s~carrid = p~carrid
AND p~cityfrom = p_cityfr.
For subqueries
SELECT carrname
INTO TABLE name_tab
FROM scarr
WHERE EXISTS ( select *
FROM spfli
WHERE carrid = scarr~carrid AND
cityfrom = 'NEW YORK' ).