SAP ABAP SYSTEM COMMANDS APPL DEPR



Get Example source ABAP code based on a different SAP table
  



Unwanted Calls of Operating System Statements
In addition to calls of function modules in the SXPG framework, operating system statements for the host computer of the current ABAP_ASINSTANCE can also be executed in ABAP programs as follows:
The addition FILTER of the statement OPEN DATASET can be used for executing operating system statements using pipes.
The internal statement CALL can be used to call a special system function (SYSTEM), which can be used to execute operating system statements.
Neither of these options should be used for common execution of operating system statements in ABAP programs.
The addition FILTER of OPEN DATASET should only be used, if at all, for operating system statements required for file handling.
Calls of the system function SYSTEM with the internal statement CALL should never be made in application programs and can be deactivated using the profile parameter rdisp/call_system. If called, it then raises an uncatchable exception.
Both statements cause the following problems:
There are no central authorization checks.
The platform dependency of the operating system statements must be handled in the ABAP program itself.
Errors and exceptions cannot be handled specifically.
If input from external sources is used, it must be checked thoroughly and filtered to prevent system command injections on any platform.
Therefore, the SXPG framework should be used instead of these two options.



Latest notes:

Before the statements CALL 'SYSTEM' is deactivated using the profile parameter rdisp/call_system, it must be ensured that it is no longer used in any programs. Any programs that still use CALL 'SYSTEM' must first be switched to using the SXPG frameworks before the unwanted statement can be deactivated. The options in the SXPG frameworks generally cover all requirements when calling operating system statements.
ABAP_HINT_END



Example ABAP Coding

Call of the operating system statement ping for the central database server of the system on the host computer of the current ABAP_ASINSTANCE using the addition FILTER of the statement OPEN DATASET. The output of the operating system statement is written to the opened file and can be read from there.
ABEXA 00808
ABAP_EXAMPLE_END



Example ABAP Coding

Call of the operating system statement ping for the central database server of the system on the host computer of the current ABAP_ASINSTANCE using the addition SYSTEM. The result of the call is placed in the internal table result. This example can only be executed if the profile parameter rdisp/call_system allows the call.
ABEXA 00809
ABAP_EXAMPLE_END