Special Techniques: Starting External Programs
Use
This section describes special procedures to use for starting:
-
service programs or demons that are to remain active in the target system
-
multiple programs in cascade fashion
Starting Service Programs and Demons
You can use the SAP background processing system to start service programs, such as demons in UNIX systems.
These programs are intended to remain active after they have been started. They do not terminate and return to the SAP background control program like normal programs.
When you start a service program, you should use the following Control Flag setting when you schedule the job:
Termination: Don't wait: Since the external program should not immediately terminate, you should change the default Wait setting. The SAP control program will then terminate as soon as it has started the external program.
The SAP control program will then terminate as soon as it has started the external program.
Starting Cascades of Programs
Often, an external program started by the background processing system in turn starts one or more other external programs. However, in many cases 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 can avoid this problem in two ways:
-
If you can modify the first external program, then have it issue an event to the SAP background processing system rather than starting the additional programs.
In the background processing system, 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.
Advantage: You can receive return codes, output, and/or trace data from each of the external programs in the job logs.
-
If you cannot modify a "master program," then modify the "cascaded" programs to signal their outcomes to the SAP system with events. You can use the event to have the SAP background processing system start additional processing.