SAP NetWeaver AS ABAP Release 751, ©Copyright 2017 SAP AG. All rights reserved.ABAP - Keyword Documentation → ABAP - Reference → Declarations → Declaration Statements → Classes and Interfaces → CLASS →
CLASS - IMPLEMENTATION
CLASS class IMPLEMENTATION.
In the statement block CLASS class IMPLEMENTATION - ENDCLASS, the following methods of a class class must be implemented, in any order:
The implementation of each method corresponds to a processing block METHOD - ENDMETHOD. No statements are allowed in the implementation part outside of method implementations. All components of the class can be accessed in an instance method implementation. All static components of the class can be accessed in a static method implementation. A component selector is not required for addressing components in the same class. Within the implementation of each instance method, there is an implicitly created, local reference variable named me available at runtime. It points to the current instance of the method.
When implementing methods declared in an interface bound by the class
INTERFACES intf, the name of the method in METHOD
must have either intf~ in front of it or use an alias name declared using
ALIASES. The interface method
must be declared in the interface. Otherwise, a syntax error will occur when local interfaces are used.
If a global interface is specified using intf~, only a syntax warning is
issued. In this way, the classes remain usable even after subsequent removal of the methods from the global interface, provided they have not used the methods themselves.
In this example, three methods of the class c2 must be implemented. The method m1 in c1 is abstract and must not be implemented there.
CLASS c1 DEFINITION ABSTRACT.
METHODS m1 ABSTRACT.
CLASS c2 DEFINITION INHERITING FROM c1.
METHODS m1 REDEFINITION.
CLASS c2 IMPLEMENTATION.