Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Calling and leaving program units →  Calling Processing Blocks →  Calling Procedures →  Method Calls →  Dynamic Method Call 

CALL METHOD - parameter_tables

Short Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


... [PARAMETER-TABLE ptab] 
    [EXCEPTION-TABLE etab].

Extras

1. ... PARAMETER-TABLE ptab

2. ... EXCEPTION-TABLE etab

Effect

In the dynamic method call these additions assign actual parameters and exceptions to the formal parameters and non-class-based exceptions, respectively, with the help of the special internal tables ptab and etab.

Addition 1

... PARAMETER-TABLE ptab

Effect

Use PARAMETER-TABLE to assign actual parameters to all formal parameters of a dynamically called method. ptab expects a hashed table of table type ABAP_PARMBIND_TAB or of row type ABAP_PARMBIND from the type group ABAP. When the statement CALL METHOD is executed, the table must contain exactly one row for each non-optional formal parameter; this row is optional for each optional formal parameter. The table columns are:

  • NAME of type c and length 30
    for the name of the corresponding formal parameter in uppercase letters. If a nonexistent formal parameter is specified, a handleable exception is raised.
  • KIND of type c of length 1.
    for the category of the formal parameter. This column is used to check the interface. The kind of the formal parameter is determined in the declaration of the called method. If KIND is initial, no check is executed. If KIND contains the value of a constant EXPORTING, IMPORTING, CHANGING, RECEIVING of class CL_ABAP_OBJECTDESCR, a check is executed (from caller viewpoint), whether the formal parameter specified in NAME is an input parameter, output parameter, input/output parameter or a return value; in case of an error, the treatable exception CX_SY_DYN_CALL_ILLEGAL_TYPE is triggered.
  • VALUE of type REF TO data
    as a pointer to an appropriate actual parameter. The data object to which the reference variable in VALUE points is assigned to the formal parameter specified in NAME.

The column NAME is the unique key of table ptab.

Addition 2

... EXCEPTION-TABLE etab

Effect

Use EXCEPTION-TABLE to assign return values to all non-class-based exceptions of a dynamically called method. etab expects a hashed table of table type ABAP_EXCPBIND_TAB or of row type ABAP_EXCPBIND from the type group ABAP. During execution of the statement CALL METHOD, this table can contain exactly one row for every non-class-based exception of the method. The table columns are:

  • NAME of type c and length 30
    for the name of the respective exception or OTHERS in uppercase letters.
  • VALUE of type i
    for the numeric value to be available in sy-subrc after the exception specified in NAME occurred.

The column NAME is the unique key of table etab.