Prefer Symbol Comparison Operators (=, <>, <, >)
WarningClean ABAP & Modern SyntaxQuickFix Ready#EC SYMBOL_OPRemote Enabled
Overview
Prefer symbolic operators over textual EQ, NE, LT, GT.
ATC Finding Message:
Prefer modern comparison operators (=, <>, <, >, <=, >=) over legacy keywords
Rationale
Text comparison operators such as EQ, NE, GT, LT, GE, and LE are legacy synonyms for the symbolic operators. Symbols are shorter, match mathematical notation, and are the Clean ABAP standard. Consistent symbols also make boolean expressions easier to scan in conditions and constructor expressions.
Non-Compliant
abap
IF lv_total GT 100 AND lv_status NE 'X'.
process( ).
ENDIF.Compliant
abap
IF lv_total > 100 AND lv_status <> 'X'.
process( ).
ENDIF.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 SYMBOL_OP
" SAP CI_ prefix format:
... "#EC CI_SYMBOL_OPTechnical Details
- Native ATC Class:
ZCL_SKYLINT_PREF_SYMBOL_OP - Implementation File: zcl_skylint_pref_symbol_op.clas.abap