SAP NetWeaver AS ABAP Release 752, ©Copyright 2017 SAP AG. All rights reserved.
ABAP - Keyword Documentation → ABAP - Reference → Declarations → Declaration Statements → Classes and Interfaces → CLASS →
CLASS - DEFINITION
Syntax
CLASS class DEFINITION [class_options].
[PUBLIC SECTION.
[components]]
[PROTECTED SECTION.
[components]]
[PRIVATE SECTION.
[components]]
ENDCLASS.
Effect
The statement block CLASS class DEFINITION - ENDCLASS declares a class named class. Naming conventions apply to the name class. components of the class are declared between CLASS and ENDCLASS. Each component must be included in a visibility section after one of the statements PUBLIC SECTION, PROTECTED SECTION, or PRIVATE SECTION. These statements must be specified in the order above. The class does not need to include all the SECTION statements.
The class options additions
of the statement CLASS can be used to publish a class globally in the class library, define an inheritance relationship, make the class abstract or final, control where the class can be instantiated, and offer
friendship to other classes or interfaces.
Notes
Example
Declaration part of a class with statements for declaring static components and instance components.