Prefer an Explicit JOIN Type
WarningClean ABAP & Modern SyntaxQuickFix Ready#EC PREF_JOIN_TYPERemote Enabled
Overview
Prefer an explicit JOIN type such as INNER JOIN.
ATC Finding Message:
Specify the JOIN type explicitly, for example INNER JOIN
Rationale
A bare JOIN defaults to INNER JOIN, but the default is invisible at the call site and easy to misread as an outer join. Explicit join types document cardinality and make reviews safer. Always write INNER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN, or CROSS JOIN.
Non-Compliant
abap
SELECT mara~matnr, makt~maktx
FROM mara JOIN makt ON mara~matnr = makt~matnr
INTO TABLE @lt_result.Compliant
abap
SELECT mara~matnr, makt~maktx
FROM mara INNER JOIN makt ON mara~matnr = makt~matnr
INTO TABLE @lt_result.Automated QuickFix
This rule provides an automated QuickFix directly in Eclipse ABAP Development Tools (ADT):
- Position the cursor on the flagged statement.
- Press Ctrl + 1 (Quick Assist).
- Select the automated refactoring to apply the clean syntax immediately.
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC PREF_JOIN_TYPE
" SAP CI_ prefix format:
... "#EC CI_PREF_JOIN_TYPERelated Rules
- Require Explicit ORDER BY for Deterministic SELECT Queries —
#EC PREF_ORDER_BY - Avoid Database Access Inside Loops (N+1 Query Antipattern) —
#EC NO_DB_IN_LOOP - Prevent Empty Driver Tables in FOR ALL ENTRIES (Full Table Scan Bug) —
#EC NO_EMPTY_FAE
Technical Details
- Native ATC Class:
ZCL_SKYLINT_PREF_JOIN_TYPE - Implementation File: zcl_skylint_pref_join_type.clas.abap