SAP SXPG_COMMAND_CHECK Function Module for









SXPG_COMMAND_CHECK is a standard sxpg command check SAP function module available within SAP R/3 or S/4 Hana systems, depending on your version and release level. It is used to perform a specific ABAP function and below is the pattern details, showing its interface including any import and export parameters, exceptions etc. there is also a full "cut and paste" ABAP pattern code example, along with implementation ABAP coding, documentation and contribution comments specific to this or related objects.


See here to view full function module documentation and code listing for sxpg command check FM, simply by entering the name SXPG_COMMAND_CHECK into the relevant SAP transaction such as SE37 or SE38.

Function Group: SSXP
Program Name: SAPLSSXP
Main Program: SAPLSSXP
Appliation area: S
Release date: N/A
Mode(Normal, Remote etc): Remote-Enabled
Update:



Function SXPG_COMMAND_CHECK pattern details

In-order to call this FM within your sap programs, simply using the below ABAP pattern details to trigger the function call...or see the full ABAP code listing at the end of this article. You can simply cut and paste this code into your ABAP progrom as it is, including variable declarations.
CALL FUNCTION 'SXPG_COMMAND_CHECK'"
EXPORTING
COMMANDNAME = "Name of External Command
* OPERATINGSYSTEM = SY-OPSYS "Executing Host System
* TARGETSYSTEM = "Target System
* ADDITIONAL_PARAMETERS = "Arguments for the External Command
* DESTINATION = "
* LONG_PARAMS = "
* EXT_USER = SY-UNAME "

IMPORTING
PROGRAMNAME = "
DEFINED_PARAMETERS = "
ALL_PARAMETERS = "

EXCEPTIONS
NO_PERMISSION = 1 COMMUNICATION_FAILURE = 10 SYSTEM_FAILURE = 11 COMMAND_NOT_FOUND = 2 PARAMETERS_TOO_LONG = 3 SECURITY_RISK = 4 WRONG_CHECK_CALL_INTERFACE = 5 X_ERROR = 6 TOO_MANY_PARAMETERS = 7 PARAMETER_EXPECTED = 8 ILLEGAL_COMMAND = 9
.



IMPORTING Parameters details for SXPG_COMMAND_CHECK

COMMANDNAME - Name of External Command

Data type: SXPGCOLIST-NAME
Optional: No
Call by Reference: No ( called with pass by value option)

OPERATINGSYSTEM - Executing Host System

Data type: SXPGCOLIST-OPSYSTEM
Default: SY-OPSYS
Optional: Yes
Call by Reference: No ( called with pass by value option)

TARGETSYSTEM - Target System

Data type: RFCDISPLAY-RFCHOST
Optional: Yes
Call by Reference: No ( called with pass by value option)

ADDITIONAL_PARAMETERS - Arguments for the External Command

Data type: SXPGCOLIST-PARAMETERS
Optional: Yes
Call by Reference: No ( called with pass by value option)

DESTINATION -

Data type: RFCDES-RFCDEST
Optional: Yes
Call by Reference: No ( called with pass by value option)

LONG_PARAMS -

Data type: CHAR1024
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXT_USER -

Data type: SY-UNAME
Default: SY-UNAME
Optional: Yes
Call by Reference: No ( called with pass by value option)

EXPORTING Parameters details for SXPG_COMMAND_CHECK

PROGRAMNAME -

Data type: SXPGCOLIST-OPCOMMAND
Optional: No
Call by Reference: No ( called with pass by value option)

DEFINED_PARAMETERS -

Data type: SXPGCOLIST-PARAMETERS
Optional: No
Call by Reference: No ( called with pass by value option)

ALL_PARAMETERS -

Data type: SXPGCOLIST-PARAMETERS
Optional: No
Call by Reference: No ( called with pass by value option)

EXCEPTIONS details

NO_PERMISSION - User Does Not Have Authorization

Data type:
Optional: No
Call by Reference: Yes

COMMUNICATION_FAILURE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

SYSTEM_FAILURE -

Data type:
Optional: No
Call by Reference: No ( called with pass by value option)

COMMAND_NOT_FOUND -

Data type:
Optional: No
Call by Reference: Yes

PARAMETERS_TOO_LONG - Parameters Too Long

Data type:
Optional: No
Call by Reference: Yes

SECURITY_RISK - Command Rejected for Security Reasons

Data type:
Optional: No
Call by Reference: Yes

WRONG_CHECK_CALL_INTERFACE - Incorrect Call of a Function Module

Data type:
Optional: No
Call by Reference: Yes

X_ERROR - Reserved

Data type:
Optional: No
Call by Reference: Yes

TOO_MANY_PARAMETERS -

Data type:
Optional: No
Call by Reference: Yes

PARAMETER_EXPECTED -

Data type:
Optional: No
Call by Reference: Yes

ILLEGAL_COMMAND - External Command Not Defined Properly

Data type:
Optional: No
Call by Reference: Yes

Copy and paste ABAP code example for SXPG_COMMAND_CHECK Function Module

The ABAP code below is a full code listing to execute function module POPUP_TO_CONFIRM including all data declarations. The code uses the original data declarations rather than the latest in-line data DECLARATION SYNTAX but I have included an ABAP code snippet at the end to show how declarations would look using the newer method of declaring data variables on the fly. This will allow you to compare and fully understand the new inline method. Please note some of the newer syntax such as the @DATA is not available until a later 4.70 service pack (SP8), which i why i have stuck to the origianl for this example.

DATA:
lv_commandname  TYPE SXPGCOLIST-NAME, "   
lv_programname  TYPE SXPGCOLIST-OPCOMMAND, "   
lv_no_permission  TYPE SXPGCOLIST, "   
lv_communication_failure  TYPE SXPGCOLIST, "   
lv_system_failure  TYPE SXPGCOLIST, "   
lv_operatingsystem  TYPE SXPGCOLIST-OPSYSTEM, "   SY-OPSYS
lv_command_not_found  TYPE SXPGCOLIST, "   
lv_defined_parameters  TYPE SXPGCOLIST-PARAMETERS, "   
lv_targetsystem  TYPE RFCDISPLAY-RFCHOST, "   
lv_all_parameters  TYPE SXPGCOLIST-PARAMETERS, "   
lv_parameters_too_long  TYPE SXPGCOLIST, "   
lv_security_risk  TYPE SXPGCOLIST, "   
lv_additional_parameters  TYPE SXPGCOLIST-PARAMETERS, "   
lv_destination  TYPE RFCDES-RFCDEST, "   
lv_wrong_check_call_interface  TYPE RFCDES, "   
lv_x_error  TYPE RFCDES, "   
lv_long_params  TYPE CHAR1024, "   
lv_ext_user  TYPE SY-UNAME, "   SY-UNAME
lv_too_many_parameters  TYPE SY, "   
lv_parameter_expected  TYPE SY, "   
lv_illegal_command  TYPE SY. "   

  CALL FUNCTION 'SXPG_COMMAND_CHECK'  "
    EXPORTING
         COMMANDNAME = lv_commandname
         OPERATINGSYSTEM = lv_operatingsystem
         TARGETSYSTEM = lv_targetsystem
         ADDITIONAL_PARAMETERS = lv_additional_parameters
         DESTINATION = lv_destination
         LONG_PARAMS = lv_long_params
         EXT_USER = lv_ext_user
    IMPORTING
         PROGRAMNAME = lv_programname
         DEFINED_PARAMETERS = lv_defined_parameters
         ALL_PARAMETERS = lv_all_parameters
    EXCEPTIONS
        NO_PERMISSION = 1
        COMMUNICATION_FAILURE = 10
        SYSTEM_FAILURE = 11
        COMMAND_NOT_FOUND = 2
        PARAMETERS_TOO_LONG = 3
        SECURITY_RISK = 4
        WRONG_CHECK_CALL_INTERFACE = 5
        X_ERROR = 6
        TOO_MANY_PARAMETERS = 7
        PARAMETER_EXPECTED = 8
        ILLEGAL_COMMAND = 9
. " SXPG_COMMAND_CHECK




ABAP code using 7.40 inline data declarations to call FM SXPG_COMMAND_CHECK

The below ABAP code uses the newer in-line data declarations. This allows you to see the coding differences/benefits of the later inline syntax. Please note some of the newer syntax below, such as the @DATA is not available until 4.70 EHP 8.

"SELECT single NAME FROM SXPGCOLIST INTO @DATA(ld_commandname).
 
"SELECT single OPCOMMAND FROM SXPGCOLIST INTO @DATA(ld_programname).
 
 
 
 
"SELECT single OPSYSTEM FROM SXPGCOLIST INTO @DATA(ld_operatingsystem).
DATA(ld_operatingsystem) = SY-OPSYS.
 
 
"SELECT single PARAMETERS FROM SXPGCOLIST INTO @DATA(ld_defined_parameters).
 
"SELECT single RFCHOST FROM RFCDISPLAY INTO @DATA(ld_targetsystem).
 
"SELECT single PARAMETERS FROM SXPGCOLIST INTO @DATA(ld_all_parameters).
 
 
 
"SELECT single PARAMETERS FROM SXPGCOLIST INTO @DATA(ld_additional_parameters).
 
"SELECT single RFCDEST FROM RFCDES INTO @DATA(ld_destination).
 
 
 
 
"SELECT single UNAME FROM SY INTO @DATA(ld_ext_user).
DATA(ld_ext_user) = SY-UNAME.
 
 
 
 


Search for further information about these or an SAP related objects



Comments on this SAP object

What made you want to lookup this SAP object? Please tell us what you were looking for and anything you would like to be included on this page!