Expand +



Create Custom Workflows with SAP's Workflow Builder

by Alan Rickayzen | SAPinsider

July 1, 2001

by Alan Rickayzen, SAP AG SAPinsider - 2001 (Volume 2), July (Issue 3)

This article provides a brief introduction to the Workflow Builder, a graphical tool by SAP designed specifically for creating workflow processes. We'll look at a simple workflow built specifically for this article. But first, a few words of warning:

  • For the purposes of this article, I use an example that highlights a CRM business scenario. However, this workflow can be built in any SAP system, since it only uses components available in the technology basis.1
  • One of the great advantages of the Workflow Builder is its graphical features. Although the screenshots are taken from a 4.6C system, the graphical elements are available from Release 3.0a and up - those of you using earlier releases will notice the difference. The functionality described in this article is available in all releases, even if it is not always as user-friendly as in later releases.
  • This article offers a basic overview of the Workflow Builder. For more details and background, see the "For Further Information" section at the end of this article.

     In this article, I'll look at a simple business scenario in which a customer sends an e-mail enquiry. This triggers a workflow to ensure that the e-mail is processed properly, quickly, and with a minimum of effort. After first looking at the process definition, we'll run through the creation of this workflow using the Workflow Builder.

Workflow Process Definition

     The process runs as shown in Figure 1: After the e-mail has been received (Step 1), an automatic reply is generated as a courtesy to the customer (Step 2). A manual dispatcher decides who would best process this e-mail, and dispatches it accordingly (Step 3). If it is a sales or support issue, an operator drafts a reply (Steps 4 and 6) and this is sent by the system (Steps 5 and 7).

     This is, of course, a deliberately simple example, and could definitely be improved. In fact, all sorts of refinements are possible - loops, quality checks by a supervisor, or automatic parsing of the e-mail, to give just a few examples.

Figure 1 Workflow Process Defenition for a Customer Enquiry Scenario

Overview of the Workflow Builder

     The Workflow Builder screen is divided into several frames, as shown in the completed workflow in Figure 2.

     The central portion of the builder, the Workflow frame, displays a flow diagram that is very similar to the process definition in Figure 1. This is one of the biggest benefits of the Workflow Builder: you can see at a glance what the process is about. To the right of the Workflow frame, you can see the complete process - the Overview frame. You can zoom in and out on the portion of the workflow shown in the Workflow frame by resizing the cursor in the Overview frame. By sliding the cursor around, you choose which section of the flow you want to display. With some workflows containing dozens of steps, this method of navigating is extremely fast and convenient.

Figure 2 Workflow Builder Display

     The Navigation frame lists, in tree format, all the steps in the workflow. Clicking on one of the entries in the list has the same effect as double-clicking on a step in the graphical Workflow frame - it zooms in to show the detailed information about that particular workflow step.

Below the navigation tree is the Objects frame, which includes:

  • The "Workflow container." The Workflow container allows you to view and edit all the data that is passed through the workflow. I've added two elements to this workflow container: "enquiry" and "reply." The Workflow Builder can automatically generate container elements based on the steps you add to the workflow.
  • The "Document templates" view. This section of the Objects frame lists the PC document templates that will be used in the workflow. For example, if the e-mail reply is to include an MS Word document as an attachment, the document is defined as a template, and variables (such as a product or distributor name) can be referenced and filled in automatically as the workflow progresses.
  • The related-tasks list. When you click on the "My Workflow and Tasks" bar, the Tasks frame appears, listing the last workflow that you worked on, together with all the workflows, sub-workflows, and tasks that you have subscribed to. A subscription can be made to your favorite workflows and tasks, to a development class, or to a Business Object. So, if you have subscribed to the Business Object "Purchase Order," you will see all the tasks and workflows related to purchase orders. Later when you edit your own workflow, you can pull workflows and tasks from this frame directly into the process definition displayed in the Workflow frame.

     On the far right of the Workflow Builder screen, the Step Types frame shows all the types of workflow steps or iterations - tasks, XML steps for collaborative scenarios over the Internet, loops, conditions, branches, etc. These can be selected one by one and dropped into the workflow. If you prefer not to work with icons, you can select the task from a list of step types by pressing the "New step" button.

     The Information frame at the bottom of the screen displays information and error messages during workflow creation. So if you try to create a loop without an end condition, a warning is displayed at the bottom of the screen. Clicking on the warning takes you to the offending section of the workflow definition.

Workflow Data

     "Workflow data" can be defined either as simple data elements and structures, or as references to SAP Business Objects. These Business Objects are defined by SAP and maintained in the Business Object Repository (BOR). Their attributes are the information that you use in the workflow to end loops, to automatically branch, or to simply display the information to the work item recipient.

     The BOR is key to this process. By using it, you avoid any worries about how the attributes are defined - this has been taken care of by SAP. Any internal changes in application tables or function modules that take place from release to release are hidden from you by the BOR, making the repository very stable and easy to use. Because attributes themselves can be references to Business Objects, too, you can drill down into the BOR for as much detail as you like. For example, you can drill down from workflow data to the dispatcher, and from there to the dispatcher's telephone number.

     The workflow I am creating here references two Business Objects: the enquiry (type MESSAGE) and the reply (also type MESSAGE).

Building a Workflow

     Figure 2 showed you what this workflow looks like at the completion of the Workflow Builder process. This workflow began as a new, undefined workflow, starting at the Workflow Builder screen (Transaction SWDD) with a blank workflow, as shown in Figure 3. The following sections give you a basic overview of the steps you will take to create the new workflow specified in our workflow process definition.

Figure 3 An Undefined Workflow, with "New Step" and "New Workflow" Buttons

Transmitting the Auto Reply (Step 2)

     The first step in our new workflow is actually the second step in the original process description - the "Auto Reply." This step sends an e-mail that gives the customer a case number to use for future reference. In Figure 4, you see the workflow step detail obtained by double-clicking on an individual step in the Workflow frame.

Figure 4 Workflow Step Detail with Auto Reply

     For example, in the description, you can see the e-mail address of the message's sender (&ENQUIRY. SENDER.ADDRESSSTRING&) and the case number (#&_WORKITEM. WORKITEMFATHER.WORKITEMID&), which is an attribute of the workflow itself.

     The resulting message is shown in the reply shown in Figure 4.

     Because this reply is sent automatically, with no human intervention, the task is configured as a background task. (It is possible to create entire workflows that consist only of background tasks, but this would not take full advantage of workflow technology, which is mainly about improving team cooperation in a business process.) In our process description in Figure 1, Steps 5, 7, and 8 are also background steps.

Deciding How to Process the Enquiry (Step 3)

     The "Dispatch" operation (Step 3) is handled by a "user decision" step, which allows you to type in a question (including variables) to be put to the user receiving this work item, along with possible responses (see Figure 5).

Figure 5 Generic User Decision Detail in the Workflow Builder

     It is up to you how many responses you create (in our example, there are three: "Brochures requested," "Sales request," and "Technical support issue"). The Workflow Builder automatically generates one branch in the workflow for each possible response.

     As you can see, user decisions are not only very easy to create, but they also have the advantage that they can be used without displaying the SAP GUI - they can appear in a user's Web browser inbox (either mySAP Workplace or the Easy Web Transaction) and can be integrated with Microsoft Outlook and Lotus Notes.

Drafting the Reply (Step 4)

     This "Edit Reply" task (Step 4) is performed manually by an operator, so it is important to include a clear description of the task the user is to perform, as shown in Figure 6. A good description will explain exactly what has to be done (and why) and may also include links to the company's intranet site for FAQs and background information. The operator will see this description when he or she receives the work item.

Figure 6 Workflow Task Description for Users

     By making the workflow as user-friendly as possible, you ensure that the operator will execute the work item promptly and diligently - the signature of a good workflow.

     Because this task is a "dialog" (rather than "background") task, you must specify who is to perform it (the same applies to the user decision described above). At the task level, you assign a job (such as hotline support, engineer, or purchasing agent) to the task, so that any assigned user can perform this task.

     At the Workflow Step level, you can additionally define a role resolution, which limits the number of users further, according to criteria such as product, division, or sales group. Only this subset of users then receives the work item. As soon as the work item is processed by one user, it disappears from the other users' inboxes.

     There are other methods of assigning users to the step: office distribution lists, direct agent assignments, etc. But using organizational management (e.g., roles) is the most common and the most powerful. With this approach, you can take advantage of features such as a sophisticated substitution mechanism. However, for simplicity's sake in this particular flow, I've taken the easy way out by directly assigning a single user to the step.

Ensuring the Work Is Completed On Time

     Deadlines can be defined for any dialog step, as you can see in Figure 7.

Figure 7 Deadline Handling

     There are many ways of handling a missed deadline. One of the simplest is to send a message to the workflow administrator.

     The Workflow Builder also gives you the option of creating a text to accompany this e-mail. The workflow engine monitors the deadlines automatically, and the deadline is defined at the step level. The time allowed for deadlines can vary from step to step, and some steps may not have deadlines at all.

Wrapping Up

     The workflow described in this article was built in under an hour without any programming. It can be configured to trigger automatically whenever an e-mail arrives in the system (Transaction SO28, SAP Office Customizing).

     Bear in mind that this uses SAPoffice or the mySAP Workplace (rather than Lotus Notes or Microsoft Outlook) as the processing center. This is justifiable because we are dealing here with a business function rather than ad hoc e-mails. The tracking and monitoring of the mails (and replies) is critical to the success of the interaction center.

     Of course, you would need to spend additional time verifying the workflow with operational users and improving the descriptions accompanying the tasks. You would also have to spend some time checking that your company has the resources to answer e-mails in the first place - and determine who will do the replying.

     This short overview gives you an idea of how easy it is to automate a simple process using the Workflow Builder. And the additional benefits, such as the workflow logs, generic object services, and process reporting, are automatically enabled with no further development work.

     Remember, the purpose of the article is to show how simple it is to create your own workflow from scratch. If you are already using the SAP CRM Interaction Center, then you are obviously better off using the out-of-the-box CRM workflow, which is far more sophisticated and very simple to set up.

For Further Information

     There is an excellent online tutorial at that is well worth following for more detailed background information. After choosing your release, follow the path through Basis to the online workflow documentation. Under the reference section, you will find a complete section dedicated to tutorials. A direct URL to these tutorials is available at

 For additional information, including a detailed step-by-step description of how this workflow was built, see my article "A Beginner's Guide to Building Workflows with the Workflow Builder" in the March/April 2001 issue of the SAP Professional Journal (

Alan Rickayzen is the product manager of WebFlow. He has been with SAP since 1992 and in data processing since 1988. In 1995, he joined the SAP Business Workflow group, performing development work as well as consulting for various major U.S. customers, and as a result amassed a good technical knowledge of the product. In 1998, he moved to the area of workflow product management. The author may be contacted at For more information about SAP Workflow, please visit

1 The mySAP CRM solution also provides its own standard workflow, which simply needs to be activated to be used in the production environment.

Did you find this article helpful? Get access to the latest updates and resources from SAPinsider with a free subscription.

Get the SAPinsider subscription now »»

An email has been sent to:

More from SAPinsider


Please log in to post a comment.

No comments have been submitted on this article. Be the first to comment!