ABAP Keyword Documentation → ABAP − Release-Specific Changes → Changes in Release 4.6A
ABAP Objects - Dynamic Method Calls in Release 4.6A
With Release 4.6A, the kernel functionality of ABAP Objects is enhanced by the addition of dynamic method calls (dynamic invoke).
Dynamic Invoke
In addition to the old static access, methods can now also be addressed dynamically with the usual ABAP bracketing semantics.
-
Call an instance method
meth
:CALL METHOD ref->(f)
-
Call a static method
meth
:CALL METHOD class=>(f)
CALL METHOD (c)=>meth
CALL METHOD (c)=>(f)
-
Call your own method
meth
:CALL METHOD (f)
CALL METHOD ME->(f)
Here f
and c
are fields containing the name of method meth
or class class
.
In contrast to subroutines and function modules, with the dynamic method call you can also transfer the actual parameters dynamically.