ABAP Keyword Documentation → ABAP − Reference → Calling and leaving program units → Calling Processing Blocks → Calling Procedures → Method Calls → Static Method Calls → meth( ... ) - Standalone Method Call
super->meth( ... )
| super->constructor ...
This special form of specifying methods statically
can be used in methods of subclasses to call the implementation of a method with the same name in the direct superclass. The superclass is addressed using the
... super->meth ...
Can be specified in the redefinition
of the method
meth in the implementation of a subclass and calls the implementation of the method
meth in the direct superclass.
A method call
super->meth can be used in the same operand positions and in
the same syntax forms as
oref->meth. The same rules apply to the parameter passing.
Implementation call of method
meth in superclass
cls1 in the redefinition of the method in subclass
CLASS cls1 DEFINITION ABSTRACT. PUBLIC SECTION. METHODS meth. ENDCLASS. CLASS cls1 IMPLEMENTATION. METHOD meth. ... ENDMETHOD. ENDCLASS. CLASS cls2 DEFINITION INHERITING FROM cls1. PUBLIC SECTION. METHODS meth REDEFINITION. ENDCLASS. CLASS cls2 IMPLEMENTATION. METHOD meth. super->meth( ). ... ENDMETHOD. ENDCLASS.
... super->constructor ...
Must be specified in an instance constructor implemented in a subclass to call the instance constructor of the direct superclasses. The following restrictions apply before the superclass constructor is called:
The instance constructor does not have access to the instance components of its class. The self-reference
me->cannot be used. The static components of its class can be accessed only directly.
Before the superclass constructor is called, an instance constructor cannot be exited using statements such as
After the superclass constructor has been called, the self-reference
me-> can be used and instance components can be accessed.
The superclass constructor can be called using
super->constructor only as a standalone statement.
When a superclass constructor called using
me->methdo not address the method implementations of the subclass (as may be expected), and address the method implementations of the superclass instead.
- The instance constructor of the superclass must be called, even if not declared explicitly.
See also Inheritance and Constructors.
Call of superclass constructor in instance constructor of a subclass. Without this call a syntax error will occur.
CLASS cls1 DEFINITION. ... ENDCLASS. CLASS cls2 DEFINITION INHERITING FROM cls1. PUBLIC SECTION. METHODS constructor. ENDCLASS. CLASS cls2 IMPLEMENTATION. METHOD constructor. super->constructor( ). ... ENDMETHOD. ENDCLASS.