Avoid Obsolete Control Flow and Procedural Forms
WarningAnti-Patterns & Bad Practices#EC NO_OBS_CONTROLRemote Enabled
Overview
Obsolete Control Flow and Procedural Statements.
ATC Finding Message:
Avoid obsolete control flow (FORM, AT NEW, BREAK, DEFINE, etc.)
Rationale
Subroutines (FORM / PERFORM), macro definitions (DEFINE), hardcoded break points (BREAK-POINT / BREAK), control break statements (AT NEW, AT END, ON CHANGE OF, SUM), and SET EXTENDED CHECK belong to legacy procedural programming. They lack proper scope isolation, cause unpredictable side effects, and are completely prohibited in modern ABAP Cloud. Encapsulate all logic within methods, modern LOOP GROUP BY syntax, and unit tests.
Non-Compliant
abap
PERFORM calculate_total USING lv_subtotal.
AT NEW order_id.
SUM.
ENDAT.Compliant
abap
calculate_total( iv_subtotal = lv_subtotal ).
LOOP AT lt_orders INTO DATA(ls_order) GROUP BY ls_order-order_id ...Configuration & Thresholds
This check can be fine-tuned directly in the ATC Check Variant Editor (CHKV) in Eclipse ADT:
| Parameter Name | Data Type | Default Value | Description & Guidance |
|---|---|---|---|
CHECK_FORM | Boolean | true | Detect obsolete PERFORM / FORM subroutine routines |
CHECK_LOOP_CTL | Boolean | true | Detect obsolete control break statements (ON CHANGE OF, EXIT FROM STEP-LOOP) |
CHECK_BREAK | Boolean | true | Detect unconditioned BREAK-POINT statements in non-test code |
CHECK_DEFINE | Boolean | true | Detect DEFINE macro declarations |
CHECK_TEST_SEAMS | Boolean | true | Detect TEST-SEAM injection blocks in production logic |
CHECK_CATCH_SYSTEM | Boolean | true | Detect obsolete CATCH SYSTEM-EXCEPTIONS syntax |
CHECK_SET_EXT_CHECK | Boolean | true | Detect obsolete SET EXTENDED CHECK statements |
CHECK_SELECT_NO_INTO | Boolean | true | Detect obsolete SELECT without INTO statements |
CHECK_EXIT_SQL | Boolean | true | Detect obsolete EXIT FROM SQL statements |
CHECK_SORT_BY_FS | Boolean | true | Detect obsolete dynamic SORT BY field symbol syntax |
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC NO_OBS_CONTROL
" SAP CI_ prefix format:
... "#EC CI_NO_OBS_CONTROLRelated Rules
- Avoid Obsolete Arithmetic and Assignment Statements —
#EC NO_OBS_ARITH - Avoid Obsolete Declarations and Table Headers —
#EC NO_OBS_DECL - Avoid Obsolete ABAP Memory and Context Statements —
#EC NO_OBS_MEMORY
Technical Details
- Native ATC Class:
ZCL_SKYLINT_NO_OBS_CONTROL - Implementation File: zcl_skylint_no_obs_control.clas.abap