Cleaner rules reference
This is the full catalog of the 45 rules the ABAP cleaner can apply. Each rule is listed with its default (On or Off) and what it does. The tables are grouped by category, matching the Rules list in the ABAP cleaner tab.
Every rule is behaviour-preserving — it changes the form of the code, never what it does. The cleaner works in a fixed pipeline: Lex → run the enabled rules in a fixed order → re-emit. Each rule is individually toggleable and configurable through the project's profile; with no profile, the default below applies.
Five rules are Off by default: chain_split, concatenate_to_template, describe_lines, identifier_case, align_assignments. Everything else is on by default.
Some Modernize rules require a minimum ABAP release and will not fire below it — set the Target ABAP release in the cleaner tab. See How the cleaner works.
Casing#
| Rule |
Default |
What it does |
keyword_case |
On |
Normalize ABAP keywords to lower (or upper) case. |
identifier_case |
Off |
Normalize non-keyword identifiers to lower (or upper) case. |
Layout#
| Rule |
Default |
What it does |
pragma_position |
On |
Move pragmas to the line end before the . / ,; fix misplaced ones. |
indent |
On |
Re-indent statements by block depth (leading whitespace only). |
Spacing#
| Rule |
Default |
What it does |
spacing_operators |
On |
Exactly one space around already-spaced binary operators. |
space_before_period |
On |
Remove blanks before a closing . on the same line. |
spacing_commas_parens |
On |
One space after separator commas, none before; tidy spaced parentheses. |
space_around_text_literal |
On |
Add missing blanks around '…' / `…` literals. |
closing_brackets_position |
On |
Move a line holding only ) or ] up to the previous line's end. |
Alignment#
| Rule |
Default |
What it does |
align_declarations |
On |
Align TYPE / LIKE and VALUE columns in declaration chains and runs. |
align_assignments |
Off |
Align the = of consecutive simple assignments. |
align_perform |
On |
Align TABLES / USING / CHANGING blocks of multi-line PERFORM calls. |
align_clear_free |
On |
Align operands after CLEAR: / FREE:, SORT…BY components, and CATCH exception classes. |
align_aliases |
On |
Align the FOR column of consecutive ALIASES declarations. |
align_parameters |
On |
Align the = of one-per-line parameters inside multi-line call / constructor brackets. |
| Rule |
Default |
What it does |
comment_type |
On |
Convert full-line * comments to " comments; commented-out code and frames are kept. |
comment_normalize |
On |
Exactly one space after " and * comment markers. |
Whitespace#
| Rule |
Default |
What it does |
condense_blank_lines |
On |
Collapse runs of blank lines (default max 1) and strip trailing whitespace. |
final_newline |
On |
Ensure the file ends with exactly one newline. |
Modernize#
Rules that rewrite older ABAP to modern equivalents. Where a rule needs a minimum ABAP release, it is noted; the rewrite fires only when your Target ABAP release is high enough.
| Rule |
Default |
What it does |
equals_sign_chain |
On |
a = b = c = 1. → one assignment per line. |
comparison_operators |
On |
EQ / NE / LT / LE / GT / GE → = <> < <= > >= in logical expressions. |
not_is |
On |
NOT x IS INITIAL → x IS NOT INITIAL. |
calculation_assignment |
On |
x = x + n. → x += n. (also - * /; needs ≥ 7.54). |
move_to_assignment |
On |
MOVE src TO tgt. → tgt = src. (plain MOVE only). |
create_data_to_new |
On |
CREATE DATA dref TYPE t. → dref = NEW t( ). (≥ 7.40). |
create_object_to_new |
On |
CREATE OBJECT ref TYPE cls. → ref = NEW cls( … ). (≥ 7.40). |
call_method_functional |
On |
CALL METHOD obj->m. → obj->m( … ). (≥ 7.40). |
raise_type_to_new |
On |
RAISE EXCEPTION TYPE cls. → RAISE EXCEPTION NEW cls( … ). (≥ 7.52). |
receiving_keyword |
On |
meth( … RECEIVING r = tgt ). → tgt = meth( … ). |
omit_exporting |
On |
Drop EXPORTING in functional calls that have no IMPORTING / CHANGING / RECEIVING / EXCEPTIONS. |
concatenate_to_template |
Off |
CONCATENATE a b INTO t RESPECTING BLANKS. → t = |{ a }{ b }|. (≥ 7.40). |
assert_equals_subrc |
On |
assert_equals( act = sy-subrc exp = n ) → assert_subrc( … ). |
assert_equals_boolean |
On |
assert_equals( … exp = abap_true/false ) → assert_true / assert_false( … ). |
arithmetic_compound |
On |
ADD n TO x. → x += n. (≥ 7.54). |
assert_parameter_order |
On |
Reorder cl_abap_unit_assert args: expectation first, then actual. |
condense_to_function |
On |
CONDENSE x. → x = condense( … ). (≥ 7.02). |
translate_to_case |
On |
TRANSLATE x TO UPPER/LOWER CASE. → x = to_upper/to_lower( x ). (≥ 7.40). |
describe_lines |
Off |
DESCRIBE TABLE itab LINES n. → n = lines( itab ). (≥ 7.02). |
pseudo_comment_to_pragma |
On |
Obsolete "#EC pseudo comments → ##PRAGMA (≥ 7.02). |
Readability#
| Rule |
Default |
What it does |
empty_commands |
On |
Remove statements that are only punctuation (a lone . : ,); comments are kept. |
chain_split |
Off |
Split a DATA: / chain into one statement per member; BEGIN OF / INCLUDE chains untouched. |
chain_of_one |
On |
DATA: x TYPE i. → DATA x TYPE i. (drop the colon when a chain has one member). |
one_command_per_line |
On |
Put statements that share a line onto their own lines. |
Declarations#
| Rule |
Default |
What it does |
implicit_type |
On |
DATA lv_x(10). → DATA lv_x(10) TYPE c LENGTH 10. (spell out the implicit type / length). |
escape_char_parameters |
On |
Add or remove the ! escape char on METHODS parameter names. |
Related pages#
- How the cleaner works — the tab, the master switch, and target release.
- Chat — where Clean this task runs the cleaner for a single task.