CALL METHOD meth( ... )

Syntax

[CALL METHOD] { static_meth( )
              | static_meth( a )
              | static_meth( p1 = a1 p2 = a2 ... ) }.

Alternatives:

1. [CALL METHOD] static_meth( ).

2. [CALL METHOD] static_meth( a ).

3. [CALL METHOD] static_meth( p1 = a1 p2 = a2 ... ).

Effect

These abbreviated forms for Parameter lists in brackets when statistically calling methods have been possible since release 4.6. The term CALL METHOD can only be omitted from release 6.10 and later.

Note

When calling functional methods on operand positions, the parameters are transferred with the same syntax as for these abbreviated forms for CALL METHOD.

Alternative 1

[CALL METHOD] static_meth( ).


Effect

This is the abbreviated form for:

CALL METHOD static_meth.

The method termed static_meth can have no input parameters or input/output parameters or only optional ones. No values are transferred. An actual parameter is not assigned to any output parameters or return values.

Alternative 2

[CALL METHOD] static_meth( a ).


Effect

This is the abbreviated form of:

CALL METHOD static_meth EXPORTING p = a.

The method termed static_meth can have either only one non-optional input parameter p or only optional input parameters, of which p is defined as the preferred parameter with PREFERRED PARAMETER. The value in a is tranferred to this input parameter. Before release 6.4, the method cannot have any input/output parameters, output parameters, or return values. From release 6.40 and higher, optional input/output parameters, output parameters, or a return value are allowed, and no actual parameter is assigned to them.

Alternative 3

[CALL METHOD] static_meth( p1 = a1 p2 = a2 ... ).


Effect

This is the abbreviated form for:

CALL METHOD static_meth EXPORTING p1 = a1 p2 = a2 ... .

The method termed static_meth can have any input parameters p, which are supplied with the actual parameters a. However, it can only have optional input/output parameters. No current parameter is assigned to these input/output parameters, and any output parameters or return values.

Example

Call of three methods of an object of class c1 in abbreviated form. The syntax shown here is possible as of release 6.10. Before release 6.10, statement CALL METHOD had to be specified explicitly.

CLASS c1 DEFINITION.
  PUBLIC SECTION.
    METHODS: m0 IMPORTING p1 TYPE i OPTIONAL
                EXPORTING p2 TYPE i
                CHANGING  p3 TYPE i OPTIONAL,
             m1 IMPORTING p1 TYPE i,
             m2 IMPORTING p1 TYPE i
                          p2 TYPE i
                RETURNING value(p3) TYPE i.
ENDCLASS.

CLASS c1 IMPLEMENTATION.
  METHOD m0.
    ...
  ENDMETHOD.
  METHOD m1.
    ...
  ENDMETHOD.
  METHOD m2.
    ...
  ENDMETHOD.
ENDCLASS.

START-OF-SELECTION.

DATA: o1   TYPE REF TO c1,
      num1 TYPE i,
      num2 TYPE i.

CREATE OBJECT o1.
o1->m0( ).
o1->m1( num1 ).
o1->m2( p1 = num1 p2 = num2 ).