Create your own auto-reaction messages in Business Process Monitoring via BAdI exit
Business Process Monitoring (BPMon) aims to monitor your most critical business processes and interfaces in an automated way. Alerts can be created on critical incidents in almost every part of your SAP landscape. See the Functional Scope of Business Process Monitoring in SAP Solution Manager of Volker von Gloeden to get a first impression on BPMon in general, and to find links to more detailed information on specific topics within BPMon.
One main advantage of the BPMon concept is that alerts are not only created and displayed in the SAP Solution Manager system. But that you can assign automated auto-reaction messages like sending an e-mail, SMS, or Service Desk Message to the responsible persons for every alert that is triggered within the Business Process Monitoring session. The standard alert notification in BPMon contains basically all technical context information of the alert (like the business process, the business process step, and the SID of the system that is affected) and the alert message text itself (which contains among others the key figure information, the timestamp of the alert, and the measured value).
However, for some customers this information is not sufficient enough. Either they want to determine the recipients of a certain alert in a more sophisticated way (e.g. depending on the criticality of the alert), or they want to include more (business) context-specific information (like adding the document numbers of the erroneous application documents to the long text of the message). For such cases the BPMon framework offers a BAdI exit that enables you to enrich the standard alert messages with customer-specific information or even to create own-defined messages from scratch.
Where can I find the BAdIs?
Basically, what you need is the EhP 1, SPS23 on your SAP Solution Manager system. Then the two parts that are necessary to use the new functions are available: an updated BPMon Setup session (which is contained in ST-SER 701_2010_1), and the corresponding Enhancement Spot where the BAdIs are located (contained in ST 400 SP23). Just call package DSWP_BPM in transaction SE80 and navigate to Enhancements -> Enhancement Spots -> ENH_SPOT_DSWP_BPM_NOTIF to find all the BAdIs related to Business Process Monitoring notifications.
Which BAdIs are available?
We offer two different kinds of BAdIs: either you can adjust the existing message by adding own content, and the message will then be sent out via the standard BPMon notification mechanism (via transaction SCOT or SAP Service Desk). Or you can create a completely new message which means that you also have to take care of the creation and sending of the message by yourself. Both functions are available for e-mails and for SAP Service Desk messages:
BADI_BUILD_MESSAGE: enrich existing BPMon e-mail
BADI_BUILD_SUPNOTF: enrich existing SAP Service Desk message
BADI_CUSTOM_MESSAGE: create e-mail from scratch
BADI_CUSTOM_SUPNOTIF: create SAP Service Desk message from scratch
In addition, a fifth BAdI (BADI_BPMON_ALERT_CONFIRMATIO) exists that provides an interface with which you can trigger any extra action every time you confirm an alert in the BPMon session.
How to create a BAdI implementation?
Well, this is nothing specific to the BPMon BAdIs hence I will keep this short. BAdI implementations can be created via the BAdI Builder (transaction SE18). The logic to be implemented later on is just simple ABAP coding that you apply in the corresponding method. Please have a look into the BAdI documentation available in SAP Help if you need more general information.
Only one thing that is important to mention here: you can apply filter values for your BAdI implementation which can then be used in the BPMon Setup session to further specify the messages to be sent out. This enables you to use different BAdI implementations for different Monitoring Objects, meaning you can send out specific messages for almost every alert independently.
Now let’s give you a short example on how a possible BAdI implementation could look like.
Imagine you are monitoring workflows within your Order to Cash process. Any failures are normally handled by your own application team located in EMEA. However, as the Business Process is running 24/7, and the workflows are a critical step within the data flow, incidents have to be corrected as soon as possible. Thus, a second team located in US is responsible for reacting on alerts that are triggered during EMEA night time. As soon as a critical (red) alert is raised in the BPMon session an SAP Service Desk message should be created that is filled with shift-specific information.
In the BPMon standard it is not possible to realize such a requirement. But you can use BADI_BUILD_SUPNOTF to define shift-specific messages which contain different contact persons for escalating the issue within the long text of the SAP Service Desk message.
First step will be to maintain the parameters for the SAP Service Desk Message in the BPMon Setup session. What you basically have to provide is
The processor: Who should work on the SAP Service Desk message?
The threshold values: When should an SAP Service Desk message be created?
The type of message: Will a standard SAP Service Desk message be created (which still can be enriched via BAdI implementation), or should a customer-defined message be sent out?
In our case we decide to have an enriched SAP Service Desk message. Thus, beneath the information on the processor, the customizing in the BPMon Setup session could look like the following:
In this case an SAP Service Desk message will be sent out automatically as soon as one red alert is created in the BPMon session, and this standard message will be enriched by the content of the implementation BADI_BUILD_SUPNOTF which is identified by the filter value “DAY_NIGHT”.
In order to get the shift-specific content into the long text we now have to create a corresponding implementation for BADI_BUILD_SUPNOTF. Let’s name it Z_BADI_DAY_NIGHT_SUPNOTF. We also define a filter value “DAY_NIGHT” in order to distinguish it from other BAdI implementations that we plan to have for other Monitoring Objects within our solution:
Now the BAdI logic can be applied in the corresponding method which in this case is called IF_EX_DSWP_BPM_BUILD_SUPNOTIF~BUILD_SUPNOTIF. We apply a generic subject text for the SAP Service Desk message, but the long text will be individual for both shifts. In both regions different second level support teams are available which can then be contacted if the problem cannot be resolved by one of the recipients of the SAP Service Desk message.
In the end an SAP Service Desk message like the following is created:
This example, as well as a complete description on how to set up auto-reaction messages in BPMon, and to implement and work with BAdIs in the BPMon environment, can be found in the “Setup Guide – Auto-Reaction Messages” which is available on SAP Service Marketplace, alias BPM (http://www.service.sap.com/bpm -> Media Library -> Technical Information).