Skip to content

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_FINAL

Technical Details ​

Released under the MIT License.