ABAP - Keyword Documentation →  ABAP - Reference →  Calling and leaving program units →  Calling Processing Blocks →  Calling Procedures →  CALL FUNCTION → 

CALL FUNCTION func

Quick Reference

Syntax

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 containing the name of a function module permitted by the package check in uppercase letters when the statement is executed. Each function module in AS ABAP has a unique name, which is why do not need to specify the function group. The following can be specified for func:

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.
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). More specifically, the types of the parameters are not known until runtime.

The additions parameter_list or parameter_tables are used to assign (statically or dynamically) actual parameters to the formal parameters of the function module and return codes to the non-class-based exceptions.

Security Note

If the name of a program unit is specified dynamically when it is called, and this name is passed to a program from outside, the result is a serious security risk. Any names passed to a program from outside must be checked thoroughly before being used in calls. The system class CL_ABAP_DYN_PRG, for example, can be used to do this. See Dynamic Calls.

Exceptions

Handleable Exceptions

CX_SY_NO_HANDLER

CX_SY_DYN_CALL_ILLEGAL_FUNC

CX_SY_DYN_CALL_ILLEGAL_TYPE

CX_SY_DYN_CALL_PARAM_MISSING

CX_SY_DYN_CALL_PARAM_NOT_FOUND



Continue
Calling Function Modules