Avoid Abstract Final Classes
WarningAnti-Patterns & Bad Practices#EC NO_ABSTRACT_FINALRemote Enabled
Overview
A class cannot be defined as both ABSTRACT and FINAL.
ATC Finding Message:
Class cannot be both ABSTRACT and FINAL
Rationale
A class cannot be both ABSTRACT and FINAL simultaneously. Abstract classes must be inherited from, while final classes prohibit inheritance.
Non-Compliant
abap
CLASS lcl_demo DEFINITION ABSTRACT FINAL.
ENDCLASS.Compliant
abap
CLASS lcl_demo DEFINITION FINAL.
ENDCLASS.Suppression
To suppress findings for this rule, append the pseudo-comment to the statement:
abap
" Standard pseudo-comment:
... "#EC NO_ABSTRACT_FINAL
" SAP CI_ prefix format:
... "#EC CI_NO_ABSTRACT_FINALRelated Rules
- Avoid Empty Procedures —
#EC NO_EMPTY_PROC - Avoid Dead Code with Constant Conditions —
#EC NO_DEAD_CODE
Technical Details
- Native ATC Class:
ZCL_SKYLINT_NO_ABSTRACT_FINAL - Implementation File: zcl_skylint_no_abstract_final.clas.abap