CALL METHOD - static

Syntax

[CALL METHOD] static_meth(parameter_list ).

  CALL METHOD static_meth  parameter_list.

ABAP_EFFECT&

Both statements call the method that is statically specified by the identifier static_meth.

Use parameter_list to assign actual parameters to the formal parameters of the method and return values to the non-class-based exceptions. You can specify parameter_list with or without parentheses. If you use parentheses, short forms are possible. If you do not use parentheses, no short forms are allowed.

As of release 6.10, you can omit CALL METHOD when using parentheses. Up to release 6.10, parentheses were only allowed for short forms for parameter_list.

Example

In method m2, method m1 of the own class is called. The interface parameters are filled and the possible exceptions are treated in a CASE structure. The syntax shown here is possible as of release 6.10. Before release 6.10 you must enter the CALL METHOD statement explicitly and without parentheses.

CLASS c1 DEFINITION.
  PUBLIC SECTION.
    METHODS: m1 IMPORTING  p1 TYPE string
                           p2 TYPE I
                EXPORTING  p3 TYPE d
                           p4 TYPE f
                EXCEPTIONS ex1
                           ex2,
             m2.
ENDCLASS.

CLASS c1 IMPLEMENTATION.
  METHOD m1.
    ...
  ENDMETHOD.
  METHOD m2.
    DATA: text   TYPE string,
          number TYPE i,
          date   TYPE d,
          amount TYPE f.
    ...
    m1( EXPORTING p1 = text
                  p2 = number
        IMPORTING p3 = date
                  p4 = amount
        EXCEPTIONS ex1 = 10
                   ex2 = 20
                   OTHERS = 30 ).
    CASE sy-subrc.
      WHEN 10.
        ...
      WHEN 20.
        ...
      WHEN 30.
        ...
    ENDCASE.
  ENDMETHOD.
ENDCLASS.