Ansicht
Dokumentation

ABAPCALL_METHOD_PARAMETER_TABLES - CALL METHOD PARAMETER TABLES

ABAPCALL_METHOD_PARAMETER_TABLES - CALL METHOD PARAMETER TABLES

Vendor Master (General Section)   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book

CALL METHOD, parameter_tables

Short Reference



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

Additions

1. ... PARAMETER-TABLE ptab

2. ... EXCEPTION-TABLE etab

Effect

In dynamic method calls, these additions assign actual parameters and exceptions to the formal parameters and non-class-based exceptions using the special internal tables ptab and etab.

Addition 1

... PARAMETER-TABLE ptab

Effect

PARAMETER-TABLE can be used 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 line type abap_parmbind from the type pool ABAP. When the statement CALL METHOD is executed, the table must contain exactly one line for each non-optional formal parameter. For each optional formal parameter, the table can contain one line. The table columns are:

  • NAME of type c and length 30
For the name of the relevant formal parameter in uppercase letters. If a nonexistent formal parameter is specified, a catchable exception is raised.
  • KIND of type c of length 1.
For the type of the formal parameter. This column is used to verify the interface. The type of the formal parameter is determined in the declaration of the called method. If KIND is initial, no check is performed. If KIND contains the value of a constant EXPORTING, IMPORTING, CHANGING, or RECEIVING of the class CL_ABAP_OBJECTDESCR, the system checks (from the perspective of the caller) whether the formal parameter specified in NAME is an input, output, input/output parameter, or a return value, and raises the catchable exception CX_SY_DYN_CALL_ILLEGAL_TYPE if an error occurs.
  • VALUE of the type REF TO data
For 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 the table ptab. The table must not contain a line with a parameter name that does not exist in the method's parameter interface.

Addition 2

... EXCEPTION-TABLE etab

Effect

EXCEPTION-TABLE can be used 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 line type abap_excpbind from the type pool ABAP. When the statement CALL METHOD is executed, this table can contain exactly one line 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 that is to be available in sy-subrc after the exception specified in NAME is raised.

The column NAME is the unique key of table etab. The table must not contain a line with a exception name that does not exist in the method's parameter interface.

Example

Dynamic method call with parameter and exception table.






ABAP Short Reference   PERFORM Short Reference  
This documentation is copyright by SAP AG.

Length: 4969 Date: 20240420 Time: 013701     sap01-206 ( 83 ms )