SAP CALL FUNCTION DYNAMIC ABAP Statements



Get Example source ABAP code based on a different SAP table
  


• EXCEPTION-TABLE CALL FUNCTION
• PARAMETER-TABLE CALL FUNCTION

CALL FUNCTION, parameter_tables
Short Reference

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

ABAP Addition
1 ... PARAMETER-TABLE ptab ...
2 ... EXCEPTION-TABLE etab ...

What does it do?
These additions use the special internal tables ptab and etab to assign actual parameters to the formal parameters of the function module and return values to the non-class-based exceptions dynamically.

ABAP Addition

What does it do?
PARAMETER-TABLE can be used to assign actual parameters to all formal parameters of the called function module. ptab expects a sorted table of table type abap_func_parmbind_tab or line type abap_func_parmbind from the type pool ABAP. When the statement CALL FUNCTION is executed, the table must contain exactly one line for each non-optional formal parameter. This line 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 catchable exception is raised.
kind of type i for the type of the formal parameter. kind must contain the value of one of the following constants of the type pool ABAP:
abap_func_exporting for input parameters
abap_func_importing for output parameters
abap_func_tables for table parameters
abap_func_changing for input/output parameters
If the type specified from the caller perspective does not match the actual type of the formal parameter, a catchable exception is raised.
value of the 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.
BEGIN_SECTION VERSION 5 OUT
tables_wa of type REF TO data as a pointer to a suitable work area if the column kind contains the value abap_func_tables. If tables_wa is not initial, the data object to which the reference variable points in tables_wa is passed to the header line of the table parameter specified in name.
END_SECTION VERSION 5 OUT
The columns name and kind form the unique key of the table ptab. A line with a parameter name that is not defined in the function module's parameter interface is ignored.

ABAP Addition

What does it do?
EXCEPTION-TABLE can be used to assign return values to exceptions of the called function module that are not marked as exception classes
BEGIN_SECTION VERSION 5 OUT in the Function Builder
END_SECTION VERSION 5 OUT . etab expects a hashed table of table type abap_func_excpbind_tab or of line type abap_func_excpbind from the type pool ABAP. The table can contain exactly one line for each non-class-based exception of the function module when the statement CALL FUNCTION is executed. The table columns are:
name of type c and length 30 For the name of the respective exception, or error_message, or specifies 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 handled
message of type REF TO data (not used for general function call but for remote function call)
The column name is the unique key of table etab. A line with an exception name that is not in the function module's parameter interface is ignored.

ABAP_EXAMPLE_VX5
Call of the function module GUI_DOWNLOAD with dynamic pass by parameter The name of the function module is specified in the string func and the interface is supplied with data using the internal tables ptab and etab.
ABEXA 00055
ABAP_EXAMPLE_END

Return to menu