Avoid Database Hints (%_HINTS) in ABAP SQL
WarningPerformance & Database#EC NO_SQL_HINTSRemote Enabled
Overview
Avoid database hints (%_HINTS) in ABAP SQL queries.
ATC Finding Message:
Avoid %_HINTS; hints bypass query optimizer and break DB portability
Rationale
Hardcoding %_HINTS overrides the database optimizer and tightly couples ABAP code to a specific database vendor (e.g. HDB, Oracle, DB6). Hints break portability during database upgrades, HANA migrations, or ABAP Cloud downports.
Standard: Optimize queries through proper secondary indexes, CDS views, and index-backed WHERE conditions rather than vendor-specific hints.
Non-Compliant
abap
" Vendor-specific database hint
SELECT * FROM t000 INTO TABLE lt_data %_HINTS HDB 'INDEX_SEARCH'.Compliant
abap
" Clean SQL without vendor hints
SELECT * FROM t000 INTO TABLE lt_data.Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC NO_SQL_HINTS
" SAP CI_ prefix format:
... "#EC CI_NO_SQL_HINTSRelated Rules
- Avoid Unfiltered SELECT on Database Tables (Full Table Scan Prevention) —
#EC NO_FULL_SCAN_SELECT - Prefer Strict SQL Host Variable Escaping —
#EC PREF_STRICT_SQL
Technical Details
- Native ATC Class:
ZCL_SKYLINT_NO_SQL_HINTS - Implementation File: zcl_skylint_no_sql_hints.clas.abap