You are on page 1of 82

WorkFlow

An Overview

Definition

Workflow is automation of business practices as a whole or their parts, during which documents, information or tasks are moved from one participant to the other for further processing, which corresponds to the defined organizational structure.

Why do we need Workflow?


In most business processes, the time involved in the actual processing of data is only a fraction of the total time required to complete a transaction. Most of the time from start to finish is consumed by moving data from one person to another and waiting for that data to be used.

SAP Business Workflow provides you with infrastructure and tools that enable you to manage your human resources and business processes more efficiently. It helps you get data quickly to the right person-even if that person is in a different office or a different countryand makes it easy for approvers to deal with transactions and send them on to the next step.

What does Workflow do ?

SAP Business Workflow uses the existing transactions and functions of the R/3 System and does not change the functions. You can combine the existing functions of the R/3 System to form new business processes with SAP Business Workflow. The workflow system takes over control of the business processes. If you are already using SAP Organizational Management, you can use the organizational structure created there to have the relevant agents carry out the individual activities. It is possible to have an activity carried out by a position.

Where and why ?

To define business processes that are not yet mapped in the R/3 System simple release approval procedures creating a material master associated coordination of the departments involved. Particularly suitable for situations with repeated work processes, or situations involving a large number of agents in a specific sequence for a business process.

Profits from implementation of Workflow :

Impr ovement of i nf or ma ti on f low In cr ease of ef fect iveness of pr acti ces an d decr eas e of t ota l cost s Ma ki ng th e a cti vit ies an d comm uni cat ion in t he bu si ness pr act ice mor e effect ive

Tr anspa rency of bu sin ess pr act ices Dea dli ne C ont rol

Features & Tools Available

Workflow Builder- SWDD Workflow Wizard Explorer-SWF3 Business Object Builder SWO1 Business Workflow Explorer-SWDM Business Workplace - SBWP

From a technical point of view, a SAP workflow consists of 3 main components : Workflow Task Object Method

Workflow Components

Workflow

Task

Object Method

The workflow : A series of tasks which represents a business process (e.g. Leave Approval Business Process) Defines what tasks are executed (sometimes based on outcomes of previous tasks)

A task : Usually akin to a specific step in a process (ie. Display Employee Leave History) Define Agents (which users can and cannot execute the step) Deadline monitoring is defined here

An object method : The ABAP which actually executes the task. (ie. SQL, etc) This could be straight ABAP Or Call Transaction (dialog task) Call to a FM, subroutine, etc

Business Object Builder


As SAP Business Workflow was developed on an object-oriented basis, it is possible to enter relevant information as object types in the SAP system.

Examples : Material Master Sales Order

Business Object Builder

Objects are comprised of: Key fields Attributes Interfaces Methods Events

Key Fields

In order to define an object in SAP, it must have a key. Normally, this is done with reference to some database table via SAP's data dictionary (DDIC). The key may be comprised of one or more fields. If more than one field, the object key is then a concatenation of the fields.

Attributes
The attributes of the object are any other non-key data related to the object. Again, this is defined via the data dictionary. If so, SAP will generate the code necessary to retrieve the data. Attributes can also be freely defined by using the Virtual option. In this case, the developer must write the code in order to retrieve the attribute's value.

Interfaces
Interfaces are predefined components inherited by the object. This is SAP's mechanism by which Virtual functions may be implemented. The 'Interface' object has a number of methods. These methods are then inherited by the Object. In order to use the methods, the Interface object must be extended and code added to the method in order to handle the particular object.

Methods
Methods define which functions an object can do. Methods are coded. They may call any existing functionality in SAP. It has Import, Export, Table, Exception and Results parameters. A method can be viewed as a Remote Function Module (RFC), although it actually is executed as a tRFC (Transactional RFC) or aRFC (Asynchronous RFC).

Events
Events generally occur within a particular context. In this case, related to the Object under which it is defined. An event must be defined in order to be published (External event). In order to publish the event, the object's key must be specified in order to define the context. The event may also carry with it other data components. This is done by defining the event's parameters.

Program
The definition of any object requires that a program be defined for it. When maintaining it's various components, SAP generates code which is placed in the program. The Key definition, Attribute access and methods are all stored in the program.

Triggering Mechanisms
Events (publish and subscribe mechanism) Majority of workflow are triggered by events. A developer will register a workflow for a particular event. When this event occurs (ie. Sales Order.Created, Parked Document Deleted) the subscribed workflow will be triggered (ignoring Check FMs and starting conditions) Status Management Change Documents User Exits and others Various Function Modules

Manual Triggering

Workflow Components

Workflow

Task

Object Method

Task Tasks describe elementary business activities. Tasks always refer to a method of an object type. Possible agents are defined for tasks. Tasks can refer to automatically executable methods (background tasks) or they can need a user to execute them (dialog tasks).

Task as a Step in a Workflow Definition

A task is referenced in an activity as a step in a workflow definition. A task can refer to A customer task/standard task A workflow task/workflow template.


Within SAP Business Workflow you use tasks for the following purposes: To use methods of an object type in a workflow (Single step task) As a framework for defining a workflow (Multistep task)

Creating a Workflow Task

Single step task

You use a Single step task to define an activity that can be executed within a workflow definition or independently. This activity can be a transaction in the R/3 System. A single-step task can be part of a workflow definition as a step of the type activity.

Multiple step task


Task containing a workflow definition. It describes the formal "framework" (interface, triggering events) for a workflow definition.

In addition to the reference to the workflow definition, the multistep task contains other information: Definition of the workflow container (interface description) Triggering events

Task Type

T TS WF WS

For customer tasks For standard tasks For workflow tasks For workflow templates

Role Resolution Determining the Agent(s) The process of determining which Agent(s) is responsible for a particular Task. For Role Resolution to occur, the Task must be defined as a Dialog Task. The responsible Agents for a Task/Step are specified Directly or Indirectly in the Responsibility screen of the Step or the Additional Data->Agent Assignment menu option of the Task. At runtime, the system first looks in the Step definition, then in the Task definition.

Role Resolution Determining the Agent(s) Directly: Specification of the user name Indirectly: Association to another component linked to one or more users. eg. Org. Units, Job and Position Definitions and Work Centers. (based on the PD Org. structure shared by the HR module). Standard Role is most flexible mechanism. Determination of the Agent(s) is fully programmable via the creation of a function module.

Dataflow: Containers and Binding


The exchange of information between the individual components of the workflow system is based on standardized rules which are specified in the binding definition. Containers Local data repository for a particular component. Used in: Workflow Definition Step (Workitem) Task Containers, with their table-like structures, are used to contain values (constants) and object references for control purposes for the workflow process and execution of work items.

Binding Information is exchanged between the individual containers according to the assignment rules specified in the binding definition. Mechanism by which data is transferred from one container to another. Essentially a data mapping step. Each container is defined with its components

Task container
Container of a task for storing data from the task environment. The task container contains the control information in the form of constants and object references: Information on execution of the object method (object reference to the object to be processed, current agent of work item, and so on) Information available after processing the method The task container already contains some defined

Workflow System Elements in the Task Container The task container holds some container elements as workflow system elements. You cannot edit these but you can use them. The workflow system assigns values to the workflow system elements as standard.
_WI_Object_ID _WI_Actual_Agent _Adhoc_Objects _Workitem _WI_Result _Attach_Objects _WI_Group_ID

Defining Single-Step Tasks


Def ining ta sks Mainten an ce of a gent ass ignments Lon g tex ts f or ta sks Speci fyi ng a tri ggeri ng e ven t Acti vati ng l inkage Def ining bi ndi ng between even ts an d tas ks Speci fyi ng a defa ult ro le f or ta sks Def ining bi ndi ng between a task a nd a r ol e

StandardTaskCreationMaterialCreate

TriggeringEvents

DataflowBindingbetweenContainers

AgentAssignment

AgentAssignmentUser

Identifying and Enhancing Object Types

Enhancements to object type Events Attributes Creating subtypes for existing object types Adding an event Adding attributes Activating object types

CreatingyourownBusinessObjectTypes

CreatingAttributes

CreatingMethods

CreatingMethods

CreatingMethods

CreatingEvents

Raising Events via Change Documents

Ch an ge d ocument s a lways r ef er to a bu siness ch an ge docu ment o bje ct. On e or mor e ta bl es are a ss ig ned to each ch an ge docu ment object. Ch an ge d ocument s a re wr it ten wh en t he valu e in a t abl e f iel d ch an ges, b ut on ly i f t he t able is a ss ig ned to a cha ng e docu ment obj ect , i f t he d at a element i n the ta ble fi eld is mar ked as req uir in g a ch an ge d ocumen t.

Flexible Event Creation

Creating an event when a change document is written Assignment between change document objects and object types

ChangeDocumentObjects:OverviewSCDO

DataElementofthetablefieldmarkedasChangeDocument

Connection to Workflow Functionality


BUS1 001 ( Ma terial )

EventsforChangeDocumentSWEC

Workflow Components

Workflow

Task

Object Method

Workflow Template
A workflow template is a modular grouping of individual steps. Example : activity(task reference ) multiple / single conditions loop The steps can either be arranged as a sequence or to be processed in parallel. Each step is a determining component of its block.An

WorkflowTemplateCreateMultiStep BasicData

WorkflowTemplateCreateMultiStep Container

WorkflowTemplateCreateMultiStep TriggeringEvents

WorkflowTemplateCreateMultiStep AgentAssignment

WorkflowTemplateCreateMultiStep DefiningSteps

Steps
Steps perform some action - Execute a method, Compare/set values, Request user decisions. Activity Condition / Multiple Condition Event Creator / Wait For Event Workflow Control / User Decision Loop Until / Loop While Container Operation Fork

Activity
An activity step executes the code of an objects method via a Task. When creating the Task, we specify which object and method the Task is to execute. Dialog Tasks and Background Tasks Background tasks do not need a user. Therefore, the method is executed immediately.

Dialog Tasks
Dialog tasks involve user input. Workflow determines the agents(users) via Role Resolution. The Agent(s) receives a Mail informing that they must complete the relevant task by Executing the Mail. When executed, the method associated with the task will run. The method may now do anything that is required, such as display a Purchase Order or run a report.

Condition / Multiple Condition


Condition Allows for the ability to test the value of an expression (normally a container variable). This will generate a True/False branch and associated events. Multiple Condition Allows for the ability to associate the value(s) of an expression (normally a container variable) with any subsequent events (along with subsequent Undefined steps).

Event Creator /Wait For Event


Event Creator Raises an external event, which must be associated with an object. It can be used to trigger other workflows, signal the end of an asynchronous process or to communicate to a running Workflow. Wait For Event Listens for a particular external event (which must be associated with an object) to be raised. Used to wait for a particular user process to occur (which would raise the event).

Workflow Control / Container Operation Workflow Control Allows for the cancellation of the Workflow or of a work item (Runtime key must be supplied). Container Operation sets a value to a container element.

User Decision

Sends a message to an Agent. Upon execution, a popup box will display a set of options to the user. This is based on the default generic task TS8267 (which can be swapped if it is needed to add special instructions to the user).

Loop Until / Loop While


Loop Until creates a feedback loop. At the end of the loop, a condition step is inserted. Continuing looping or not is controlled via the contents of a particular container variable. Loop While creates a feedback loop. At the start of the loop, a multiple condition step is inserted. Continuing looping or not is controlled via the contents of a particular container variable.

Fork
Will create a fork of n specified branches which can run parallel steps.

WorkflowTemplateCreateMultiStep DefiningBindingbetweentaskandworkflowcontainer

WorkflowTemplateCreateMultiStep DefiningAgenttothestep

APPLICATIONS

CA - Cross-Application Components Processing Document Info Records . Message Control . EDI Status Record Processing .

FI - Finance Workflow Scenarios in Finance . Workflow Scenarios in Asset Management . Triggering a Workflow From a Validation .

LO - Logistics

Changes with Reference to an Engineering Change Request or Change Request or Engineering Change Order .

Logistics Information System: Trigger Workflow from an Exception in the Early Warning System.

MM - Materials Management Releasing a Purchase Requisition. QM - Quality Management Quality Notification . Quality Inspection .

PM - Plant Maintenance
Maintenance Order Management . Purchase Order Change . Service Management

PS - Project System Workflow in the Project System . PA - Personnel Administration Recruitment . Personnel Administration . Process Absence Approval . Automatic Generation of Documents for HR Applications Using SAP Business Workflow.

Ques ti ons ?

You might also like