rspec/rules/S1494/abap/rule.adoc
Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
Inline adoc files when they are included exactly once.

Also fix language tags because this inlining gives us better information
on what language the code is written in.
2023-05-25 14:18:12 +02:00

49 lines
1.3 KiB
Plaintext

== Why is this an issue?
``++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:
[source,abap]
----
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
[source,abap]
----
SELECT carrname
INTO TABLE name_tab
FROM scarr
WHERE EXISTS ( select *
FROM spfli
WHERE carrid = scarr~carrid AND
cityfrom = 'NEW YORK' ).
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Make sure this use of a "JOIN" clause is strongly indicated.
Make sure this use of a subquery is strongly indicated.
endif::env-github,rspecator-view[]