Ansicht
Dokumentation

ABENMETHOD_CALLS - METHOD CALLS

ABENMETHOD_CALLS - METHOD CALLS

SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

Method Calls

There are two types of method call, static method calls and dynamic method calls. In static method calls, the name of the method must be completely known in the program. In dynamic method calls, the name of the method is determined partially or completely at runtime.

When an instance method is called using a reference variable and the static type of the reference variable is a superclass of the dynamic type, the dynamic method call can be used to call all visible methods of the dynamic type. In static method calls, however, only the visible methods of the static type can be called.

Static method calls have the pattern meth( ). They do not need a keyword, but the method is specified directly and the parameters passing is in parentheses instead. Dynamic method calls are introduced using CALL METHOD.

An obsolete syntax variant also exists where static method calls are still introduced using CALL METHOD.

System Fields

The system field sy-subrc is set to 0 when a method is called. If a non-class-based exception is raised and is handled by the assignment of a value, sy-subrc is set to this value.






Addresses (Business Address Services)   General Data in Customer Master  
This documentation is copyright by SAP AG.

Length: 1674 Date: 20240420 Time: 082125     sap01-206 ( 33 ms )