ABAPCALL_METHOD_STATIC_SHORT - CALL METHOD STATIC SHORT

CPI1466 during Backup   CPI1466 during Backup  
This documentation is copyright by SAP AG.

CALL METHOD meth( ... )

Short Reference



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 three variants are short forms for parameter lists in parentheses in static method calls.

Notes

  • We recommend that you do not use the optional CALL METHOD when using short forms.
  • When calling functional methods inoperand positionsfor functions and expressions, the parameters are passed with the same syntax as for these short forms for CALL METHOD. If the functional method has the same name as apredefined function, the expression meth( a ) always calls the functional method.

  • A methodchaining (possible for functional methods in operand positions since Release 7.1) cannot be specified as a single statement at present.


Alternative 1

[CALL METHOD] static_meth( ).


Effect

This is the short form of:

CALL METHOD static_meth.

The method termed static_methcan either have no input parameters or input/output parameters or only optional input parameters orinput/output parameters. No values are passed. An actual parameter is not assigned to any output parameters or return codes.

Alternative 2

[CALL METHOD] static_meth( a ).


Effect

This is the short form of:

CALL METHOD static_meth EXPORTING p = a.

The method termed static_methcan have either only one non-optional input parameter p or only optional input parameters, ofwhich p is defined as the preferred parameter using PREFERRED PARAMETER. The value in a is passed to this input parameter.

The method can have optional input/output parameters, output parameters, or a return code, and no actual parameters are assigned to them.

From Release 7.1, you can specify a calculation expression for a.

Alternative 3

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


Effect

This is the short form of:

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

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

From Release 7.1, you can specify calculation expressions for a1, a2, ....

Example

Call of three methods of an object of class c1 in short form.

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 ).




ROGBILLS - Synchronize billing plans   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.


Length: 6683 Date: 20120518 Time: 201554     triton ( 168 ms )