ABAP Keyword Documentation → ABAP - Reference → Data Interfaces and Communication Interfaces → Internal Statement for System Function Call
CALL - System Function Call
Other versions: 7.31 | 7.40 | 7.54
This statement is for internal use only. It must not be used in application programs.
Syntax
CALL cfunc.
Addition
... ID id1 FIELD f1 ... ID idn FIELD fn
Effect
Calls the system function cfunc
. A flat character-like data object containing
the name of the function can be specified for cfunc
. The function must be
entered in the file sapactab.h. Modifying a function or creating a new function requires the ABAP kernel to be compiled again and linked. This requires the C source code files.
Notes
- If possible, use kernel methods instead of system functions.
-
External programs should be called using the RFC mechanism:
CALL FUNCTION... DESTINATION
. - With some critical C functions, the system performs an authorization check automatically. If the user does not have the appropriate authorization, a runtime error occurs. The authorization can be checked using the function module AUTHORITY_CHECK_C_FUNCTION.
-
The use of the system function SYSTEM, which can be used to execute operating system statements, is not recommended and can be deactivated using the
profile parameter
rdisp/call_system. If called, it then raises a non-handleable exception. If absolutely necessary, operating system statements can be called using the function modules in the
SXPG framework. This addresses specific
statements using logical command names created by the system administrator in the transaction SM68. See also
Unwanted Calls of Operating System Statements.
Security Note
Calls of system functions whose names or parameters are injected into the program from outside present a serious security risk. The values from outside must be checked thoroughly before being used. See System Command Injections.
Addition
... ID id1 FIELD f1 ... ID idn FIELD fn
Effect
Passes fields to the called program using pass by reference. ID id1
is used
to specify the name of a formal parameter and FIELD f1
is used to specify
the associated field from the ABAP program. If a formal parameter expects an internal table, the latter is passed in the form FIELD tab[]
.
Example
DATA RESULT(8).
CALL 'MULTIPLY' ID 'P1' FIELD '9999'
ID 'P2' FIELD '9999'
ID 'RES' FIELD RESULT.
Exceptions
Non-Catchable Exceptions
-
Cause: No authorization to call this C function.
Runtime Error:CALL_C_FUNCTION_NO_AUTHORITY
-
Cause: The system function specified is unknown.
Runtime Error:CALL_C_FUNCTION_NOT_FOUND
-
Cause: The system function SYSTEM is deactivated.
Runtime Error:CALL_SYSTEM_DISABLED