SAP METHOD CALL - Guide
Get Example source ABAP code based on a different SAP table
Method Calls
ABAP_BACKGROUND
Static calls of methods can be formulated in two different ways. The
is based on the notation of the function module call. Alternatively, a
ABAP_RULE
Use the long form of the method call using
ABAP_DETAILS
The short form of the static method call is clearer. The redundant ABAP words
ABAP_EXAMPLE_BAD
The following source code shows the long form of a static method call using
CALL METHOD cl_class=>do_something
EXPORTING
some_input = value1
IMPORTING
some_output = value2
CHANGING
some_change = value3.
...>
The following source code shows the same static method call as above, but with parentheses inserted. In this form, which also has correct syntax, either
CALL METHOD cl_class=>do_something(
EXPORTING
some_input = value1
IMPORTING
some_output = value2
CHANGING
some_change = value3 ).
...>
ABAP_EXAMPLE_END
ABAP_EXAMPLE_GOOD
The following source code shows the same method call as above, but as recommended, without
cl_class=>do_something(
EXPORTING
some_input = value1
IMPORTING
some_output = value2
CHANGING
some_change = value3 ).
...>
ABAP_EXAMPLE_END