SAP ABAP SYSTEM COMMANDS APPL SXPG



Get Example source ABAP code based on a different SAP table
  



SXPG Framework for Operating System Statements
The only recommended way of executing operating system statements from ABAP on the operating system of the host computer of the current ABAP_ASINSTANCE or another server is to use the SXPG framework. This framework is based on a list of allowed operating system statements that can be called using function modules in the function pool SXPG.
The list of allowed operating system statements is defined by the system administrator in transaction SM69. Here, the platform-dependent physical operating system statements are assigned to a logical command name used to address them in ABAP. When one of these logical command names is passed to one of the function modules listed below, the operating system statement appropriate for the current platform is executed. Logical command names assigned to an operating system command used by all platforms can be flagged with the operating system ANYOS. Static parameters can be assigned to any operating system statement and further parameters can be specified for when the statement is called. When an operating system statement is called using a logical command name, implicit authorization checks are performed, which can be enhanced by user-defined checks. SAP provides a range of predefined logical command names with the type SAP. Logical command names created by customers have the type KUNDE.
If they have the right authorizations, developers can view the list of operating system statements in transaction SM49 and execute them from here. The following function modules can be called from ABAP programs:
SXPG_CALL_SYSTEM for execution on the host computer of the current ABAP_ASINSTANCE
SXPG_COMMAND_EXECUTE for execution on other servers; the result can be waited for, but this is not mandatory
SXPG_COMMAND_EXECUTE_LONG, like SXPG_COMMAND_EXECUTE but with a longer parameter list
These function modules can also be called remotely.



Latest notes:

For more information, see the documentation Programming with External Commands in SAP Help Portal.
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 logical command name PING predefined by SAP. The result of the call is passed to the internal table result. The function module SXPG_CALL_SYSTEM can raise more specific exceptions than those handled explicitly here.
ABEXA 00810
ABAP_EXAMPLE_END