Ansicht
Dokumentation

ABAPCALL_METHOD_METH_SUPER - CALL METHOD METH SUPER

ABAPCALL_METHOD_METH_SUPER - CALL METHOD METH SUPER

Addresses (Business Address Services)   PERFORM Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

super->meth( ... )

Short Reference



... super->meth
  $| super->constructor ...

Alternatives:

1. ... super->meth ...

2. ... super->constructor ...

Effect

This special form of a static method specification can be used in methods of subclasses to call the implementation of an identically named method in the direct superclass. The superclass is addressed using the pseudo reference super.

Alternative 1

... super->meth ...


Effect

Can be specified in the redefinition of the method meth in the implementation in 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, and the same rules apply to the parameter passing.

Call of the implementation of the method meth in superclass cls1 in the redefinition of the method in the subclass cls2.

Alternative 2

... super->constructor ...


Effect

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, but not with me->..
  • Before the superclass constructor is called, an instance constructor cannot be exited using statements such as RETURN or CHECK.

After the superclass constructor is called, the self-reference me-> can be used and instance components can be accessed.

The superclass constructor can only be called using super->constructor as a standalone statement.

Notes

  • During the execution of a superclass constructor called using super->constructor, meth and me->meth do not address the method implementations of the subclass, but those of the superclass instead.
  • The instance constructor of the superclass must be called, even if it is not declared explicitly.

Call of the superclass constructor in instance constructor of a subclass. Without this call, a syntax error occurs.






CL_GUI_FRONTEND_SERVICES - Frontend Services   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.

Length: 3838 Date: 20240328 Time: 130914     sap01-206 ( 60 ms )