Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Calling and leaving program units →  Calling Processing Blocks →  Calling Procedures 

Method Calls

There are two types of method call: static and dynamic. In static method calls, the name of the method must be specified in full in the program. In dynamic method calls, the full name of the method or part of the name is determined 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; instead, the method is specified directly and the parameters are passed in parentheses. Dynamic method calls are introduced using CALL METHOD.

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

Other versions: 7.31 | 7.40 | 7.54

System Fields

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

Continue

Static Method Calls

Dynamic Method Call