Define a WAAE job to launch an SAP job that executes external system commands

Document ID : KB000009264
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

1. In WAAE or AutoSys, an SAP job can only be defined to run a ABAP program in SAP but not an external OS system command.  How can we schedule an SAP job to run external commands?

2. Run SAPJC job to lunch a job that executing an external command and observe the following error message in the job log:

16:47:11 2018-01-02 BT 611 Step 002 started 
16:47:11 2018-01-02 BT 612 External program: sapevt 
16:47:11 2018-01-02 BT 613 Related parameter: SPR-MM01P_SPR-MM02P 
pf=/sapmnt/SPR/profile/evtspr.pfl 
16:47:11 2018-01-02 00 1 SXPG_STEP_XPG_START: is_local_host: rc = 403 
16:47:11 2018-01-02 00 1 SXPG_STEP_XPG_START: host = sisiu860 
16:47:11 2018-01-02 00 1 SXPG_STEP_XPG_START: is_local_r3_host: rc = 802 
16:47:11 2018-01-02 00 1 SXPG_STEP_XPG_START: RFC_TCPIP_CONNECTION_OPEN: 
rc = 1003 
16:47:11 2018-01-02 BT 645 Exception PROGRAM_START_ERROR 
16:47:11 2018-01-02 BT 605 Failed to start external program 
16:47:11 2018-01-02 00 518 Job cancelled 

What's the cause of above error?

 

Cause:

1. This is limitation of the WAAE SAP R/3 Job Type at the moment.

2. This is a configuration issue within the SAP system.

Resolution:

1. As a work around, Use SAP GUI to create an SAP Job that contains one or more steps that execute external system commands.  Then define a SAPJC type of job to make a copy of the defined SAP job and launch the copied job.

2. This is an issue with the configuration within the SAP system where the SAP job runs.

Please see SAP KBA 1909104 for details or engage your SAP system administrator.

Additional Information:

The following information is from SAP KBA at the following URL: https://launchpad.support.sap.com/#/notes/1909104 

SAP KBA 1909104

Symptom 
When executing an external command as job step in a background job in windows cluster environments, the job canceled with following error: 

SXPG_STEP_XPG_START: is_local_host: rc = 403 
SXPG_STEP_XPG_START: host = xxxxx 
SXPG_STEP_XPG_START: is_local_r3_host: rc = 802 
SXPG_STEP_XPG_START: RFC_TCPIP_CONNECTION_OPEN: rc= 1003 
Exception PROGRAM_START_ERROR 
In SM21 log, you can see error like following: 

LC 2 Error1003 when executing external command XXXXXXX 
Cause 
The parameter gw/netstat_once is not set correctly in default profile. 

Resolution 
Ensure that the parameter gw/netstat_once is set to 0, so that you can identify the dynamic changes of logical host names. Also refer to Note 112266. 

Keywords 
SXPG_COMMAND_EXECUTE, program_start_error, CPIC return code 027, 020, 456, MSCS, cluster, note 112266,