ABAP Keyword Documentation → ABAP - Short Reference
CALL METHOD - Short Reference
Other versions: 7.31 | 7.40 | 7.54
Syntax Forms
Static form
[CALL METHOD] {meth
|oref->meth
|super->meth
|class=>meth}( { }
| { a }
| p1 = a1 p2 = a2 ...
| { [EXPORTING p1 = a1 p2 = a2 ...]
{{[IMPORTING p1 = a1 p2 = a2 ...]
[CHANGING p1 = a1 p2 = a2 ...]}
| [RECEIVING r = a ]}
[EXCEPTIONS [exc1 = n1 exc2 = n2 ...]
[OTHERS = n_others]] } ).
Dynamische Form
CALL METHOD {(meth_name)
|oref->(meth_name)
|(class_name)=>(meth_name)
|class=>(meth_name)
|(class_name)=>meth}
[PARAMETER-TABLE ptab]
[EXCEPTION-TABLE etab].
Effect
Calls a method. In the static form, all forms of the parameter list can be placed in brackets; in bracketed
parameter lists, you can omit CALL METHOD
. In the dynamic form, certain static specifications are possible.
Additions
Specify the Method
-
meth
- Methodmeth
of the same class. -
oref->meth
- Instance methodmeth
of the object referenced byoref
. -
super->meth
- Method of same namemeth
in the direct superclass. -
class=>meth
- Static methodmeth
of classclass
. -
(meth_name)
- Method contained inmeth_name
. -
(class_name)
- Class contained inclass_name
.
Specify the Parameters
-
( )
Short form for the call of a method without passing a parameter. -
( a )
Short form for the call of a method, thereby passing a single parametera
. -
( p1 = a1 p2 = a2 ... )
Short form for the call of a method, thereby passing several parametersa1
,a2
, ... -
EXPORTING p1 = a1 p2 = a2 ...
Passes actual parametersa1
,a2
, ... to input parametersp1
,p2
, ... -
IMPORTING p1 = a1 p2 = a2 ...
Copies output parametersp1
,p2
, ... into actual parametersa1
,a2
, ... -
CHANGING p1 = a1 p2 = a2 ...
Assigns actual parametersa1
,a2
, ... to input/output parametersp1
,p2
, ... -
RECEIVING r = a
Copies the return valuer
into the actual parametera
.
Specify the Exceptions
-
EXCEPTIONS
Allows handling of non-class-based exceptions:
exc1 = n1 exc2 = n2 ...
- Assigns to the classic exceptions
exc1,exc2
, ... numbersn1
,n2
, ... for the return valuesy-subrc
.
OTHERS = n_others
- Assigns to all not explicitly named exceptions a numbern_others
for the return valuesy-subrc
.
Specify Parameters and Exceptions in Tables
-
PARAMETER-TABLE ptab
Assigns dynamic actual parameters to formal parameters using an internal tableptab
of type ABAP_ PARMBIND_TAB. -
EXCEPTION-TABLE etab
Assigns dynamic return values to non-class-based exceptions using an internal tableetab
of type ABAP_EXCPBIND_TAB.