Ansicht
Dokumentation

ABAPCALL_FUNCTION_GENERAL - CALL FUNCTION GENERAL

ABAPCALL_FUNCTION_GENERAL - CALL FUNCTION GENERAL

CL_GUI_FRONTEND_SERVICES - Frontend Services   ABAP Short Reference  
This documentation is copyright by SAP AG.
SAP E-Book

CALL FUNCTION func

Short Reference



CALL FUNCTION func ${ parameter_list
                   $| parameter_tables $}.

Effect

This statement calls the function module specified in func. The name func must be a character-like data object that contains the name of a function module allowed by the package check in uppercase letters when the statement is executed. Since each function module in AS ABAP has a unique name, the function pool does not need to be specified. The following can be specified for func:

  • Literal or constant
If the data object func is specified as a character literal or as a constant, it is evaluated as a statically specified object by tools such as the extended program check or the where-used list.
  • Variable
If the data object func is specified as a variable, it is specified only dynamically, and the content is not evaluated statically.

When the statement is executed, func is not evaluated until runtime in both cases. In particular, the types of the parameters are not known until runtime. In both cases, incorrectly specified function modules or parameters produce runtime errors and not syntax errors

The additions parameter_list or parameter_tables are used to statically or dynamically assign actual parameters to the formal parameters of the function module and return values to the non-class-based exceptions. See Dynamic Calls.

Note

Since func is not evaluated until runtime when function modules are called, no writable expressions and no inline declarations can be specified as actual parameters, unlike in static method calls.

Example

Call of function modules READ_SPFLI_INTO_TABLE and READ_SPFLI_INTO_TABLE_NEW with parameter passing and handling of non-classified and class-based exceptions.

Calling Function Modules

Exceptions

Catchable Exceptions

CX_SY_NO_HANDLER

CX_SY_DYN_CALL_ILLEGAL_FUNC

  • Cause: The called function is known but not active.
    Runtime Error: CALL_FUNCTION_NOT_ACTIVE
  • Cause: The called function is unknown.
    Runtime Error: CALL_FUNCTION_NOT_FOUND

CX_SY_DYN_CALL_ILLEGAL_TYPE

  • Cause: The type of the actual parameter does not meet the requirements of the function interface.
    Runtime Error: CALL_FUNCTION_CONFLICT_GEN_TYP
  • Cause: The actual parameter does not have the length expected by the function.
    Runtime Error: CALL_FUNCTION_CONFLICT_LENG
  • Cause: The actual parameter does not have the type expected by the function.
    Runtime Error: CALL_FUNCTION_CONFLICT_TYPE
  • Cause: Only valid functions can be called in the update.
    Runtime Error: CALL_FUNCTION_NO_VB
  • Cause: An actual parameter does not meet the alignment requirements of the corresponding formal parameter.
    Runtime Error: CALL_FUNCTION_WRONG_ALIGNMENT

CX_SY_DYN_CALL_PARAM_MISSING

  • Cause: The function expects a parameter that was not passed by the caller.
    Runtime Error: CALL_FUNCTION_PARM_MISSING

CX_SY_DYN_CALL_PARAM_NOT_FOUND

  • Cause: The caller passed a parameter that is not recognized by the function.
    Runtime Error: CALL_FUNCTION_PARM_UNKNOWN






PERFORM Short Reference   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 6629 Date: 20240418 Time: 060736     sap01-206 ( 64 ms )