Starting External Commands and Programs

Use

This section describes special procedures for starting service programs or daemons that are to remain active in the target system and multiple cascading programs.

Starting Service Programs and Daemons

Once you've used the background processing system to start service programs, such as daemons in UNIX systems, they remain active rather than terminating and returning to the SAP background control program as other programs do.

When you start a service program, you should use the control flag setting Job to wait for external program to end (found in Transaction SM36, the control flags function in the Job Step Definition) when you schedule the job. Since the external program isn't supposed to immediately terminate, you should also change the default Wait setting. The SAP control program will then terminate as soon as it has started the external program. You can continue to get trace data back from the control program up until the time that it starts the external program.

Starting Cascading Programs

Cascading programs run one or more other external programs. However, you may not be able to obtain useful feedback from the initial external program. If the external program terminates without waiting for the other programs, the return code in the job log provides no useful information on the additional processing done in the target system. You may be able to remedy this in a couple of ways:

  • If you can modify the external program, have it issue an event to the background processing system rather than starting the additional programs. You can then schedule individual jobs for each of the cascaded programs that are to be started. When the initial program issues the event, the background processing system starts each of the jobs that is waiting for the event. The advantage to this is that you can receive return codes, output, and/or trace data from each of the external programs in the job logs.

  • If you cannot modify the external program, then modify the cascaded programs to trigger events to signal their outcomes to the SAP System. You can use the event to have the background processing system start additional processing.

Upon termination of the transfer program, the control program checks the return code and issues the appropriate event to the SAP System with the SAP program SAPEVT. You can have the background processing system use the event to start the ABAP program that processes the transferred data.