Learn how you can implement a custom watchdog program in just three steps to back up the standard messaging functionality. This ensures that you find out about process chain errors as soon as possible and allows you to quickly address issues as they arise. Also find out tips to optimize your use of the watchdog program.
Key Concept
SAP NetWeaver BI does not send out email alerts if an error occurs in your process chain in the following three cases: a dump in the program used in the ABAP process type, lack of messaging in the process type's variant, or an unexpected system shutdown in the middle of a process chain execution. However, by using a custom watchdog program, you can set up your system to send out messages for any of these scenarios.
Process chains are a part of a periodic data loading process in an SAP NetWeaver BI system. The lion’s share of SAP NetWeaver BI installations relies exclusively on process chains to automate data load schedules, monitor data load progress, and administer data targets.
If a process chain fails, end users do not have access to the most recent data. In the worst case, the failure can introduce data inconsistencies in different layers of the data warehouse depending on the location of the error in the data flow path. Inconsistencies could occur in the data acquisition (staging), primary data management (DataStore objects), or data delivery (architected data marts or InfoCubes) layer. Therefore, timely data availability in SAP NetWeaver BI greatly depends on the successful execution of process chains.
If you are unaware of a process chain failure, you do not have a chance to react in a timely manner. To avoid this, I created a watchdog program that you can implement in your SAP BW or SAP NetWeaver BI system to notify you when an issue occurs. The watchdog program complements the standard messaging functionality. This means that if SAP NetWeaver BI has sent out notifications about a process chain failure, the program doesn’t send duplicate messages.
First I’ll explain why the standard SAP NetWeaver BI messaging function sometimes fails and then I’ll describe how the watchdog program enhances your process chain monitoring. You can set up this program in three steps.
Why the Standard Messaging Function Does Not Always Work
SAP NetWeaver BI can capture and notify you about most process chain errors using the standard SAP messaging function. However, this function is not comprehensive and falls short for the following three scenarios:
- A lack of messaging in the process type’s variant. Sometimes the implementation team forgets to create a message option during the process chain design time.
- A dump in the program used in the ABAP process type. In this case, the process chain terminates, but the system does not generate an email alert. For ABAP process types, SAP does not provide an option that allows you to create a message based on a program’s execution status.
- An unexpected system shutdown in the middle of a process chain’s execution. On rare occasions, one or more servers may shut down without notice. If a process chain’s job is running on that server during that time, the system does not send any email alerts when the system comes back after the shutdown, leaving you in the dark about the casualty.
How the Watchdog Program Works
The watchdog program works in three stages. In the first stage it identifies the process chains that the system has not yet analyzed. In this example, the system has not sent out any email alerts or no one has analyzed the process chain’s log.
In the second stage, the watchdog program checks the process chain's status. Only those process chains that have the error status are selected for further processing. The program performs three checks in this process. It analyzes the status given in the process chain’s log. Then it analyzes the status of the job spawned from the process chain’s step. If the process type has any interface, the watchdog program checks the status of the interface. These three checks help to gauge the status of the process chain’s execution accurately.
When the watchdog program completes the checks, it sends an email notification if the selected process chains have errors. The program provides you a selection screen that allows you to choose the people or distribution lists for the alerts.
In the third stage, the watchdog program, after sending the alerts, updates the process chain log’s Analyzed status. This ensures that the watchdog program doesn’t pick the same process chain run (log) again the next time the program runs. An SAP function module updates the status in the process chain’s log.
Three-Step Implementation Process
Step 1. Download the source code for the watchdog program (ZZ_PROCESS_ CHAIN_WATCHDOG). This source code is available to download via this link. Remember where you saved the file because you need it in the next step.
Step 2. Create the watchdog program in your system. Go to transaction code SE38. In the initial screen, enter the name ZZ_PROCESS_CHAIN_WATCHDOG and click on the Create button (Figure 1). In the subsequent screen that appears, enter the program attributes shown in Figure 2. When finished, click on the Save button.

Figure 1
Create the program ZZ_PROCESS_CHAIN_WATCHDOG

Figure 2
Enter the program attributes
Next, upload the source code of ZZ_PROCESS_CHAIN_WATCHDOG program as shown in Figure 3. You can do this either by clicking on the load local file icon or by copying and pasting the program’s source code into the screen.

Figure 3
Upload the watchdog program source code
Then activate the program by going to Program>Activate. Next, enter the selection texts for the program by following menu path Goto>Text Elements>Selection Texts. Enter the values for the variables P_CHAIN, P_DAYS, P_EMAIL, P_TEST, and S_MAIL shown in Figure 4. These values appear in the selection screen when you run the watchdog program. When finished, go to Text Elements>Activate to activate the selection texts. Then create the program variant, which you use later for the job creation step. Figure 5 shows sample values for the variant.

Figure 4
Enter the selection texts

Figure 5
Set up when the program should run and who the program should notify about errors
If you choose the Test Run option, the watchdog program returns the list of process chains in error on the screen/spool, but does not send out an email alert. For the Process Chain (ID) fields, enter the name of process chain to analyze. If you leave these fields blank, the program picks up all the process chains. Use the Number of days to consider field to set how far back you want to check the process chain run. Select the Send email? check box to send an email notification and then enter the email addresses of the people you want to notify in the Email recipients field.
After entering the selection values, click on the Attributes button to name your variant and enter a meaning for it. In my example, I named the variant ALL_PC and entered Check all Process Chains for the Meaning. Click on the save icon to save this variant.
Step 3. Define and schedule the watchdog job. To define the watchdog job, go to transaction SM36 to create a job named ZZ_PROCESS_CHAIN_WATCHDOG. Click on the Step button. In the Create Step 1 screen that pops up, click on the ABAP program button (Figure 6). In the ABAP program section, enter ZZ_PROCESS_CHAIN_WATCHDOG for the Name and ALL_PC for the Variant.

Figure 6
Create the background job
The next step is to schedule the background job. Go back to transaction SM36 and click on the Start Condition button. Select Periodic job, click on the Period values button, and then click on the button for the desired frequency (Figure 7). Click on the save icon at the bottom of the pop-up screen to save your settings. This returns you to the main screen for transaction SM36. Click on the save icon at the top of this screen to schedule the job.

Figure 7
Schedule the job at the desired frequency
Tips for Using the Watchdog Program
Tip 1. You can schedule the watchdog job after the normal process chain runtime. For example, if your nightly data load finishes by 5:00 am, you can schedule this program at 5:30 am. I recommend scheduling this program (using a background job) to run every hour. This program consumes a negligible amount of system resources. The benefit of scheduling the job at a greater frequency (hourly) is that the watchdog program searches for errors more often and thus you get email notifications in a timely manner.
Tip 2. You can create multiple jobs for different process chains. This feature is particularly useful if you want to notify different people about different process chain failures. When you set up the watchdog program's job in step 3, select different variants. The variant dictates the selection of the process chains.
Tip 3. You can change the text of the notification message. To do this, you need to edit the downloaded source code for the ZZ_PROCESS_CHAIN_WATCHDOG program. I’ve provided the instructions to do this in the source code at the section FORM send_email.
Note
For more information about this topic, you can attend SAP Education class BW360: SAP BI Performance & Administration for SAP NetWeaver BI 7.0.
Jeevan Kumar Ravindran
Jeevan Kumar Ravindran is an SAP-certified (in BW and SAP NetWeaver Portal) independent consultant specializing in end-to-end BI implementations. Jeevan has more than 14 years of SAP experience in a wide range of industries. Since 2002, he has been focusing on SAP BW projects, and has worked in many phases of these projects, including project planning, configuration, development, and post-go-live support.
You may contact the author at Jeevan.Ravindran@tli-usa.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.