By Rehan Zaidi
Whether you’re a consultant, manager, developer, or end user of an SAP system, sooner or later you’ll most likely be involved in the implementation cycle of SAP Business Workflow, which helps organizations better manage business processes. By using SAP Business Workflow, you can design a business process so that every step or process is carried out at the correct moment.
Workflow is simply defined as a reaction to the occurrence of a predefined event such as the creation of a sales order, the hiring of an employee, or the application for a leave. Workflow allows you to automatically trigger an existing SAP program. You can even create chains of program execution, linking the start of one program with the end of another. In this manner, new business processes may be defined without altering existing ones.
For example, an employee wants to go on leave. As soon as he files an electronic leave form in SAP, e-mail should be sent to his boss along with his name and personnel number. When the boss rejects or accepts his request, the employee should be notified via e-mail. How do you handle this? Write a workflow.
Workflows and the BOR
A workflow is defined using a standard SAP transaction known as the Workflow Builder. The workflow definition comprises one or more tasks that refer to actions or operations that need to be performed at runtime, for example, sending e-mail to the boss about the employee’s request. In the definition, you also specify the event on which you’d like your workflow to be triggered—the leave application in our example.
SAP Business Workflow accesses the business logic of SAP R/3 through an object-oriented interface. It views all SAP data as business objects, such as Material, Employee, and Sales Order. While the details of workflow creation are beyond the scope of this article, we can become familiar with the object orientation embedded in the concepts of workflow within the SAP landscape.
To master the object-oriented concepts of workflow, you must familiarize yourself with the standard program provided by SAP known as the Business Object Repository (BOR). BOR gives you a complete overview of all the Object Types available in the R/3 system. The BOR interface enables quick navigation through all the Object Types of SAP and their various components.
Let’s consider the information provided by the BOR.
Object Types and Objects
Before you can include an Object Type in a workflow definition, you must define the Object Type in the BOR. The Object Type encapsulates a complete set of related data and operations as a unit.
In our example, the absence form (FORMABSENC) is the Object Type under consideration. An Object, then, is an active instance of an Object Type. Table A shows examples of Object Types and their corresponding Objects.
The Object Type consists of the following components:
- · Key fields: Because an Object is an instance of an Object Type, there must be some data that distinguishes a particular Object from a number of instantiated Objects. This is made possible via the definition of some key data for each Object. For example, an employee number forms part of the key data Object Type Employee. For our absence form, the form number is the key field.
- · Attributes: The attributes determine the characteristics of an Object. They’re used to devise conditions at the time of workflow writing. The attributes of an Object are determined at runtime and may be used to control the workflow.
- · Events: Events may initiate, stop, or continue the tasks of a workflow. They inform the entire SAP system about the change in status of a particular Object. Events may also be triggered upon errors or exceptional conditions. Typical examples of events are shown in Table B.
The Workflow system has an event-linkage table that maintains a list of all events and their relevant programs. When an event occurs, the name of the corresponding program is read from this table and is executed.
Instance Independent methods are also referred to as class methods or static methods. They don’t require a specific instance of an Object Type (or a specific Object) to be called. Examples of such methods are shown in Table C.
Instance Dependent methods may be called on a particular instance of an Object Type (see Table D).
SAP allows polymorphism in method calls. You can call methods of different Objects via the same method names and parameters. The result that is returned by a method is particularly important and can be used to control workflows.
In defining a workflow for an employee applying for leave, you would create a task that would call the method APPROVE of the Object Type FORMABSENC. However, the application may be rejected or approved. Two separate branches would be created out from the method APPROVE. Each branch would correspond to the two probable instances of the result.
In our leave application example, we formulated a workflow solution by expressing our scenario in terms of the relevant Object Type (FORMABSENC), its attributes (FORMNUMBER), its method (APPROVE), and its respective events (CREATE, APPROVE, and REJECT). Object orientation, the heart of SAP Business Workflow, allows you to think technically while trying to solve your business problems.