Avoid Obsolete Declarations and Table Headers
WarningAnti-Patterns & Bad PracticesQuickFix Ready#EC NO_OBS_DECLRemote Enabled
Overview
Obsolete Data and Type Declarations.
ATC Finding Message:
Avoid obsolete declaration constructs (TABLES, RANGES, TYPE-POOLS, etc.)
Rationale
Legacy declaration statements like TABLES, RANGES, TYPE-POOLS, and internal tables defined WITH HEADER LINE, OCCURS, or INITIAL SIZE carry significant technical debt and implicit global state. In modern Clean ABAP and ABAP Cloud, use explicit TYPES, DATA statements with modern table types, standard RANGE OF types, and CLEAR instead of REFRESH.
Non-Compliant
abap
TABLES mara.
RANGES lr_matnr FOR mara-matnr.
DATA lt_items TYPE STANDARD TABLE OF i WITH HEADER LINE.Compliant
abap
DATA lt_items TYPE STANDARD TABLE OF i WITH EMPTY KEY.
DATA lr_matnr TYPE RANGE OF matnr.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.
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_TABLES | Boolean | true | Detect obsolete TABLES declaration statement |
CHECK_TYPE_POOLS | Boolean | true | Detect obsolete TYPE-POOLS declaration statement |
CHECK_RANGES | Boolean | true | Detect obsolete RANGES declaration statement |
CHECK_HEADER_LINE | Boolean | true | Detect internal tables with obsolete header lines (WITH HEADER LINE) |
CHECK_OCCURS | Boolean | true | Detect obsolete INITIAL SIZE / OCCURS syntax |
CHECK_INITIAL_SIZE | Boolean | true | Detect obsolete INITIAL SIZE additions |
CHECK_COMMON_PART | Boolean | true | Detect obsolete DATA COMMON PART statements |
CHECK_STATICS | Boolean | true | Detect STATICS declarations inside instance methods |
CHECK_FS_STRUCTURE | Boolean | true | Detect FIELD-SYMBOLS with obsolete structure typing |
CHECK_LOAD | Boolean | true | Detect obsolete LOAD-OF-PROGRAM statements |
CHECK_PARAMETER | Boolean | true | Detect obsolete PARAMETER additions in selection screens |
CHECK_REFRESH | Boolean | true | Detect obsolete REFRESH statement (prefer CLEAR) |
Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC NO_OBS_DECL
" SAP CI_ prefix format:
... "#EC CI_NO_OBS_DECLRelated Rules
- Avoid Obsolete Arithmetic and Assignment Statements —
#EC NO_OBS_ARITH - Avoid Obsolete Control Flow and Procedural Forms —
#EC NO_OBS_CONTROL - Avoid Obsolete ABAP Memory and Context Statements —
#EC NO_OBS_MEMORY
Technical Details
- Native ATC Class:
ZCL_SKYLINT_NO_OBS_DECL - Implementation File: zcl_skylint_no_obs_decl.clas.abap