JOIN
bypasses the SAP table buffer. Buffered tables should be accessed with the simplest SELECT
statements possible so as
not to risk bypassing the buffer.
If one of the tables in a JOIN
is buffered, it would be an advantage to first import the required entries using a SELECT
into an internal table itab
, and then for example, using the statement SELECT ... FOR ALL ENTRIES IN itab
to access further
tables.
Noncompliant code example
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' ).