Workflow: Triggering a Workflow from a Message Class
Workflow: Triggering a Workflow from a Message Class
In this note, I’ll describe how to trigger a workflow for specific message classes. These are the types of messages that typically appear to indicate an error, a warning, or just general information.
Prelude
Let’s assume that at your company, a business process automated using a SAP product component involves two departments. Specialists from one department maintain master data that is essential for their counterparts in the other department to complete critical SAP operations.
This often leads to email battles and a slew of meetings, which, more often than not, result in no actionable conclusions. But let’s stay optimistic.
A Variation on the Theme: What Can Be Done?
Assume that after one such interdepartmental meeting, the following decisions were made and documented:
- According to the new procedure, before executing a critical operation in SAP, specialists from one department will run a program that checks whether the required data from the other department is present in the system.
- If the data is missing, the program should trigger a message. Upon receiving it, the user can decide whether or not to notify the relevant personnel from the other department(s).
SAP standard functionality includes the ability to trigger a workflow from a specific message. Whether the workflow is triggered or not is up to the user. The workflow can be initiated by pressing the relevant button in the message’s detailed view.
Below is the step-by-step process for setting up workflow triggering from a specific message class.
Creating a Message
See: Maintaining Messages
Use transaction SE91
to create the message for which the workflow trigger capability will be configured. In my case, it looks like the one in:

Creating a Workflow Template for the Message Type
You don’t need to manually build the workflow and its related components. SAP provides a wizard tool for creating a workflow model linked to a message. You can find it in the SAP menu: Tools → Business Workflow → Development → Definition Tools → Execute the Wizard "Create Workflow-Message Linkage
Or run transaction SWUY directly to save time.

Select your message and click the Complete button.

The system will generate a workflow template.

This process creates a corresponding entry in table T100W that links the message class and number to the workflow model ID.

Adjusting the Workflow
Let’s say the purpose of this workflow is to notify a colleague. The following video snippet demonstrates how to add a user notification task to the workflow.
Creating an ABAP Program to Trigger the Message
To trigger the message, I’ll create a simple ABAP program. You can create the program in transaction SE38
.

Testing
The test scenario is straightforward:
- Run the program
- Trigger the message
- Start the workflow
- Verify that the user notification was sent using transaction SBWP
A video snippet illustrates this sequence.
Note: A Workflow button now appears in the message's detailed view. Again, it is up to the user to decide whether to launch the workflow.

To Deactivate Workflow Triggering from a Message
To disable the workflow initiation from a message, simply delete the corresponding entry from table T100W.
P.S. Any resemblance to real-world interdepartmental situations in your project work is purely coincidental.