Skip to content

Latest commit

 

History

History
43 lines (26 loc) · 1.21 KB

call-method-usage.md

File metadata and controls

43 lines (26 loc) · 1.21 KB

code pal for ABAP > CALL METHOD Usage Check

CALL METHOD Usage Check

What is the Intent of the Check?

This check verifies the usage of the CALL METHOD ABAP statement. It is preferable to call a method dynamically instead of via this statement: CALL METHOD. In other words, prefer a functional instead of a procedural call.

How does the check work?

It checks the usage of CALL METHOD statement in the code.

How to solve the issue?

Change the long method calls using CALL METHOD statement to short method calls using parenthesis notation (dynamic call).

What to do in case of exception?

In exceptional cases, you can suppress this finding by using the pseudo comment "#EC CALL_METH_USAGE which has to be placed after the CALL METHOD statement:

CALL METHOD method_name. "#EC CALL_METH_USAGE

Example

Before the check:

DATA(class) = NEW object( ).
CALL METHOD class->method.

After the check:

DATA(class) = NEW object( ).
class->method( ).

Further Readings & Knowledge