+ All Categories
Home > Documents > SAP Business Workflow_Basic

SAP Business Workflow_Basic

Date post: 26-Nov-2015
Category:
Upload: kalpana-kadam
View: 128 times
Download: 12 times
Share this document with a friend
Description:
SAP Business Workflow_Basic
Popular Tags:
113
IBM Global Business Services Workflow Basic Training Jan-2007 © 2007 IBM Corporation SAP Business Workflow - Basic
Transcript
Page 1: SAP Business Workflow_Basic

IBM Global Business Services

Workflow Basic Training Jan-2007 © 2007 IBM Corporation

SAP Business Workflow - Basic

Page 2: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation2 Jan-2007Workflow Basic Training

Question and Answer/Recap

Hands on -Design workflow on Flipcharts and present to class. Class to be divided in 3 - 4 groups DAY4(4 hours)

Basic Monitoring transaction(SWEL, SWI2_FREQ)

Hands on (Raise Events and Rule as agent)

Types of Agents

Organizational Plan, Role Resolution (Responsibility + Function Module)DAY3(4 hours)

Question and Answer/Recap

Hands on (Create task and Workflow Template)

Workflow Events (Change Doc and ABAP coding)

Container and bindings

Detailed discussion about the different steps involved in a WF Template

TasksDAY2(4 hours)

Question and Answer/Recap

Hands on (Create a Subtype and Delegate)

Basic Business Object Program

Business object overview

Basic Workflow Template

Workflow Architecture

Introduction to Workflow DAY1(4 hours)

TOPICDAY

Page 3: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation3 Jan-2007Workflow Basic Training

SAP Business Workflow

� SAP Business Workflow® is a cross-application tool that makes it possible to integrate business tasks/processes between applications.

� This tool was introduced in R/3 Release 3.0A, and received a substantial facelift in the Enjoy Release, 4.6A,which warranted the new name Workflow Builder.

Page 4: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM CorporationWorkflow Basic Training

Need of Workflow

Hmm ! Time to put in a Hmm ! Time to put in a purchase requisition requestpurchase requisition request

11

33

I guess I’d better send off I guess I’d better send off some intersome inter--office mail to office mail to ask the approvers to ask the approvers to approve my requisition.approve my requisition.

22 I wonder whoI wonder whoapproves buying this approves buying this stuff?stuff?

55

Time drags on . . .Time drags on . . .Meanwhile, in Meanwhile, in Mr. Manager’s office . . . Mr. Manager’s office . . . “What shall I do next?”“What shall I do next?”

44

TIME IS MONEY!!!TIME IS MONEY!!!

Page 5: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM CorporationWorkflow Basic Training

Drawbacks

� Inefficiency.

� Each lacks a way to trace where a task is.

� Who executed or is executing it.

�How much time it required.

Page 6: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation6 Jan-2007Workflow Basic Training

Why SAP Workflow

� Workflow ensures that the right work is sent to the right person at the right time in the right sequence with the right information.

� Tool for the automization of business processes� Not tied up to any paricular application

� Operates uniformly accross applications� Coordinate all participating tasks

� Provide users with active support� Intelligent routing

Page 7: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation7 Workflow Basic Training

How to use Workflow - (Common Examples)

� Workflow is best suited for document routing� Example: If we want to route a candidate’s resume to a set of people

� Workflow is best suited for automating business process� Example: If we want various Purchase Orders to be approved by heads of various

department

� Workflow is best suited for participation in data creation by a collective set of people� Example: Vendor address by front end, Vendor account by General Accounting

� Workflow should not be used solely for notification purpose� Example: Send notification when a SO is created, Invoice is blocked etc.

Page 8: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation8 Workflow Basic Training

SAP Workflow- (BEST Business Practices)

Improve Quality and Decision Making

Deliver accurate information to Process Participants; both within the Enterprise and Externally; Ability to attach documents and Objects to a work item

Improve Operational Efficiency

Prevent duplication of effort; Pre-defined Business Process and ActorsEliminate time wasted waiting to take action .

Ensure Compliance

Monitor and Control Processes; Deadline Monitoring and Escalation Procedures

Speed Time to Market

Accelerate the execution of SAP Transactions by routing information quickly to users for immediate action; Ability to substitute; Ability to Forward Work Items

Page 9: SAP Business Workflow_Basic

IBM Global Business Services

Workflow Basic Training Jan-2007 © 2007 IBM Corporation

SAP Business Workflow - Basic

Workflow Architecture

Page 10: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation10 Jan-2007Workflow Basic Training

Workflow Architecture

OrganisationalLevel

OrganisationalLevel

Process LevelProcess Level

Business Object Level

Business Object Level

Page 11: SAP Business Workflow_Basic

IBM Global Business Services

Workflow Basic Training Jan-2007 © 2007 IBM Corporation

SAP Business Workflow - Basic

Workflow Definition

Page 12: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation12 Jan-2007Workflow Basic Training

Workflow Definition

Workflow definition consists of

1. Basic Data2. Information about triggering events3. Initial Values4. Containers5. Bindings

A workflow definition describes the workflow process

Page 13: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation13 Jan-2007Workflow Basic Training

Workflow BuilderThe workflow definition is created in the Workflow Builder and displayed graphically in a network.

Transaction: SWDDMenu Path: Tools � Business Workflow � Development � Definition tools

� Workflow Builder.

Page 14: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation14 Jan-2007Workflow Basic Training

Workflow Definition - Steps

A workflow definition is made up of individual modular steps.

Page 15: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation15 Jan-2007Workflow Basic Training

Example: Workflow Definition

Page 16: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation16 Jan-2007Workflow Basic Training

How are Workflows Created in a System

� Within workflow templates, there is a key with the following structure:- A WS task abbreviation for the workflow template- An 8-digit sequence number

� From the structure of the 8-digit number, the system knows whether the template is a standard template delivered by SAP or one created by the customer.

� Customer-defined templates start with the prefix number that was defined in Customizing for the system and client.

Page 17: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation17 Jan-2007Workflow Basic Training

How workflow gets executed

Page 18: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation18 Jan-2007Workflow Basic Training

Workflow Toolbox - SWUS

Transaction:Transaction: SWUS.SWUS.Menu Path:Menu Path: Tools Tools --> Business Workflow > Business Workflow --> Development > Development --> Runtime Tools> Runtime Tools--> Start > Start Workflow (Test Environment).Workflow (Test Environment).

Page 19: SAP Business Workflow_Basic

IBM Global Business Services

Workflow Basic Training Jan-2007 © 2007 IBM Corporation

SAP Business Workflow - Basic

Business Object

Page 20: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation20 Jan-2007Workflow Basic Training

�SAP Business Workflow has been developed on an object-oriented basis.

�The business object types are identified and described with their object methods in the Business Object Repository(BOR) of the R/3 System.

�Generally one object is created in the system and then processed in a workflow over several steps by various employees.

Object Types & Workflow

Page 21: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation21 Jan-2007Workflow Basic Training

� Workflow deals with object types. Object types are definitions of data. In order to access database data, workflow uses the object type interface.

� Most of the information represented by object types is available in the ABAP/4 Dictionary.

� Objects are created at runtime and are specific instances of defined object types.

� Many object types are delivered by SAP. In addition, the customer can create new object types or extend SAP objects by creating subtypes (child objects). New customer objects or subtypes may be desired if the delivered SAP object does not contain all the characteristics (attributes) or processing options (methods) desired.

Object Types & Objects

Page 22: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation22 Jan-2007Workflow Basic Training

Object Type - Definition

Page 23: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation23 Jan-2007Workflow Basic Training

Interfaces

� Interfaces are a combination of attributes, methods, and events to be used in common among multiple object types. The purpose of interfaces is to define common functionality in one object type, and to assign that common functionality via an interface to multiple object types across the Business Object Repository. This avoids redundancy of data and functionality definition.

� Each new object type automatically receives the interface IFSAP, the SAP standard interface. IFSAP provides every object type with the following:

� Method Display

� Method ExistenceCheck

� Attribute ObjectType

Page 24: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation24 Jan-2007Workflow Basic Training

Key Fields

Key fields are designed to uniquely identify the object type.

If the key field has a data type reference of a dictionary table field, the runtime system will look to that table field to retrieve the value of the key when processing the object. When the key field is created, the ABAP/4 program code is generated automatically when the object type is generated.

Page 25: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation25 Jan-2007Workflow Basic Training

Attributes

Attributes provides access to data.

ABAP Dictionary Field Virtual

Page 26: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation26 Jan-2007Workflow Basic Training

Methods

Methods incorporate the permitted functions available for an object.Methods have importing and exporting parameters as well as exceptions.

Methods can be created using :

Page 27: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation27 Jan-2007Workflow Basic Training

Methods

ImportImportParametersParameters

METHODMETHOD

Result

Result

ExportExportParametersParameters

Exceptions

Exceptions

Page 28: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation28 Jan-2007Workflow Basic Training

–Dialog / or background :

Execution of the method is via a work item in a user’s integrated inbox or in background by the workflow runtime system. Background methods cannot use messages or exceptions because they cannot be processed by the background system and will result in termination of the program.

–Synchronous / Asynchronous

•Synchronous methods finish executing before handing control backto the calling program. These types of methods can return export parameters, results and exceptions. Asynchronous methods do notreturn control to the calling program immediately. Once executed, they depend upon events to communicate the results of the methodback to the calling program. Asynchronous object methods cannothave results, export parameters or exceptions.

Methods - Call attributes

Page 29: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation29 Jan-2007Workflow Basic Training

� Result:

Synchronous methods may return an export parameter as a result. A

result can be defined like a dictionary field or an object type .

� Instance independence:

Indicates whether an object reference is passed to the method by binding

at the time of execution. Methods that generate and return an object

reference, such as Create, or methods that generate a report listing should

be instance independent.

Methods - Call attributes

Page 30: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation30 Jan-2007Workflow Basic Training

Import /Export Parameters

•The method parameter container contains references to all import, export and result parameters which need to be exchanged back and forth between the calling program (single-step task) and the method. Binding is necessary between the single-step task and the method parameter container to accomplish the data transfer.

•Import parameters are those values which are necessary to execute the method. Import parameters are retrieved from the container CONTAINER using the macro instructions SWC_GET_ELEMENT (single-line) or SWC_GET_TABLE (multiline).

•Export parameter values are passed to the container CONTAINER using the macro instructions SWC_SET_ELEMENT (single-line) or SWC_SET_TABLE (multiline). The result parameter is passed to the CONTAINER element RESULT via the same macro instructions.

Page 31: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation31 Jan-2007Workflow Basic Training

Exceptions

•Error handling is accomplished through the use of method exceptions (synchronous methods only).

•The workflow definition can branch according to these possible error states and allow for subsequent steps to handle these conditions. Messages and exceptions cannot be used with background methods because they will terminate the program.

•Number of the exception: •0001-1000: exceptions defined for interfaces•1001-7999: application-specific exceptions (free for SAP development)•8000-8999: exceptions raised by the object manager•9000-9999: exceptions defined by the customer (free for customers)

Page 32: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation32 Jan-2007Workflow Basic Training

•Exceptions are implemented within a method, between the macro instructions BEGIN_METHOD and END_METHOD.

–EXIT_RETURN Code Variable1 Variable2 Variable3 Variable4.•Code = the 4-digit number of the exception•Variable1 through Variable4 correspond to up to 4 variables which can be derived from the message issued with the exception.

•The following exceptions (for temporary errors) are also available to allow exiting of the program:

–EXIT_OBJECT_NOT_FOUND = object not found–EXIT_CANCELLED = cancelled by the user

Exceptions

Page 33: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation33 Jan-2007Workflow Basic Training

Events describe the change in the status of an object.Workflow are usually started using events

Events

Page 34: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation34 Jan-2007Workflow Basic Training

Object Type - Release Status

�Not accessible at runtime.

�Only in test or internal use, possibly unstable.

�Released for use by the customer.

�The functionality has been replaced. The old functionality is still supported for two releases.

Page 35: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation35 Jan-2007Workflow Basic Training

Subtype

The subtype inherits all attributes, methods and events of the supertype and is open for new customer-specific attributes, methods and events. The key fields of the supertype and subtype must be identical. This means that any methods and attributes defined on the parent can be executed and accessed on the child object.

Page 36: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation36 Jan-2007Workflow Basic Training

Delegation

This delegation is powerful because it lets you implement your own business logic without modifying any SAP code. As long as the objects are properly delegated, your method will be executed.

CallingCallingProgramProgram

KNA1KNA1

Method: Method:

Change passwordChange password

ZKNA1ZKNA1

Method: Method:

Change passwordChange password

Transaction: Menu Path: SW01Tools � Business Workflow - Development - Definition tools - Business Object Builder -Settings - Delegate

Page 37: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation37 Jan-2007Workflow Basic Training

Objects in the workflow

Page 38: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation38 Jan-2007Workflow Basic Training

Some common Business Objects and Interfaces

BKPF Posting documentBUS2019 Customer documentBUS2020 Vendor documentBUS2041 Asset documentBUS2069 G/L account documentBUS2029 Price changeEKKO Purchasing documentVBAK Sales documentDRAW Drawing ObjectBUS2032 Sales orderBUS1001 Material MasterBUS1010 Customer Credit AccountBUS1022 Fixed Asset ObjectBUS1065 Employee BUS2012 Purchase Order BUS2078 QA NotificationsIFSTATUS Generate events from status managementIFARCH21 Archive Link InterfaceIFIDOCOUT IDoc outbound processing

Page 39: SAP Business Workflow_Basic

IBM Global Business Services

Workflow Basic Training Jan-2007 © 2007 IBM Corporation

SAP Business Workflow - Basic

Business Object Programming

Page 40: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation40 Jan-2007Workflow Basic Training

Business Objects – Programming� Key Features

� BOR programming makes extensive use of macros.

� The macro instructions required for programming are incorporated via the include <object>.

� Attribute programming� Database Field

� Indicator that the attribute value is determined directly from the content of a database field

� Code gets automatically generate

� Virtual Field� Requires Implementation in the program of object type

ex :- GET_PROPERTY Total CHANGING CONTAINER.

DATA : Price TYPE Zprice,

Qty TYPE Zqty.

IF object-total is initial.

SWC_GET_PROPERTY self ‘Price’ Price.

SWC_GET_PROPERTY self ‘Quantity’ Qty.

Object-Total = Price * Qty.

ENDIF.

SWC_SET_ELEMENT CONTAINER ‘Total’ object-total.

END_PROPERTY.

Page 41: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation41 Jan-2007Workflow Basic Training

Business Objects – Programming cont…� For multiline attribute the structure will look like

GET_PROPERTY <AttributeID> CHANGING CONTAINER.

……code

SWC_SET_TABLE CONTAINER <AttributeID> InternalTable

END_PROPERTY.

� Methods Programming

BEGIN_METHOD <MethodID> CHANGING CONTAINER.

…..code

END_METHOD.

Ex : BEGIN_METHOD display CHANGING CONTAINER.

SET PARAMETER ID ‘MAT’ FIELD object-key-material.

CALL TRANSACTION ‘MM03’ AND SKIP FIRST SCREEN.

END_METHOD.

Page 42: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation42 Jan-2007Workflow Basic Training

BEGIN_METHOD GETLIST CHANGING CONTAINER.DATA:

CUSTOMERNUMBER LIKE BAPI1007-CUSTOMER,SALESORGANIZATION LIKE BAPIORDERS-SALES_ORG,------------RETURN LIKE BAPIRETURN,SALESORDERS LIKE BAPIORDERS OCCURS 0.

SWC_GET_ELEMENT CONTAINER 'CustomerNumber' CUSTOMERNUMBER.SWC_GET_ELEMENT CONTAINER 'SalesOrganization' SALESORGANIZATION.

------------.

SWC_GET_TABLE CONTAINER 'SalesOrders' SALESORDERS.

CALL FUNCTION 'BAPI_SALESORDER_GETLIST'EXPORTINGCUSTOMER_NUMBER = CUSTOMERNUMBERSALES_ORGANIZATION = SALESORGANIZATION------

------.IMPORTINGRETURN = RETURN

TABLESSALES_ORDERS = SALESORDERS

EXCEPTIONSOTHERS = 01.

CASE SY-SUBRC.WHEN 0. " OKWHEN OTHERS. " to be implemented

ENDCASE.

SWC_SET_ELEMENT CONTAINER 'Return' RETURN.SWC_SET_TABLE CONTAINER 'SalesOrders' SALESORDERS.END_METHOD.

Writing/Reading Container Elements Defined as Field Values

Page 43: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation43 Jan-2007Workflow Basic Training

Business Objects – Programming cont…

� An object reference can be created in method using SWC_CREATE_OBJECT macro

BEGIN_METHOD <MethodID> CHANGING CONTAINER.

…..code

data : user type swc_object.

SWC_CREATE_OBJECT user ‘User’ <user id>.

SWC_GET_PROPERTY user ‘Name’ <name field>.

…code

END_METHOD.

Page 44: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation44 Jan-2007Workflow Basic Training

Business Objects – Programming cont…� Exception is methods can be raised using the macro EXIT_RETURN

EXIT_RETURN <Exception #> <Var1> <Var2> <Var3> <Var4>

Where <Exception #> is the exception number defined for method

� Macros for Method Exceptions� EXIT_RETURN <Exception #> <Var1> <Var2> <Var3> <Var4>

� Returns the exception

Page 45: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM CorporationWorkflow Basic Training

Container Marcos

Definition and Initialization

SWC_CONTAINER <Cont>SWC_CONTAINER_CREATE <Cont>

Page 46: SAP Business Workflow_Basic

IBM Global Business Services

Workflow Basic Training Jan-2007 © 2007 IBM Corporation

SAP Business Workflow - Basic

Task and Workflow Template

Page 47: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation47 Jan-2007Workflow Basic Training

Single and Multistep Tasks

TasksTasks

Single stepSingle step

MultistepMultistep

References References one object type one object type methodmethod and displays one stepand displays one stepin the business process in the business process

Represents the Represents the business business processprocess and is a sequence of and is a sequence of individual tasks and control individual tasks and control steps steps

Transaction : PFTCTransaction : PFTCMenu PathMenu Path --> Tools > Tools --> Business Workflow > Business Workflow --> Development > Development --> Definition tools > Definition tools -->Tasks>Tasks

Page 48: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation48 Jan-2007Workflow Basic Training

Single-step tasks

�Single-step tasks describe elementary business activities.

�Single-step tasks operate on an object and refer to one object method

each

�Single-step tasks are linked to their possible and permitted agents

whose organizational assignments are described in the organizational

plan of the enterprise.

�Executable single-step tasks are represented by work items at runtime.

Page 49: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation49 Jan-2007Workflow Basic Training

Workflow definition - Multistep tasks

� A workflow definition has a modular structure consisting of individual steps which are linked together.

� The multistep tasks form the business framework for a workflow definition and each references one workflow definition.

� A step in a workflow definition can be an activity.

� An activity always refers to one task (= single-step task or multistep task).

� An activity with one simple triangle refers to a task.

� An activity with three triangles refers to a workflow (subworkflow).

Page 50: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation50 Jan-2007Workflow Basic Training

Task Definition – Synchronous and Asynchronous Methods

Page 51: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation51 Jan-2007Workflow Basic Training

Defining a Task

Page 52: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation52 Jan-2007Workflow Basic Training

Settings for Tasks

Background Confirm end of processingSAPphones

Task executed in background

depending on object method

At runtime user can create attachments

User explains explicitly that work item is no longer is to be processed

The workflow dials the telephone number attached to the current customer

Page 53: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation53 Jan-2007Workflow Basic Training

Workitem Text

�Title of workitem in the Business Workplace

�First create the workitem text and position the cursor to include a varible

�Choose the 'Insert variable' icon under the workitem text

Processes request from &_WI_Object_ID.CreatedBy&

Example

Page 54: SAP Business Workflow_Basic

IBM Global Business Services

Workflow Basic Training Jan-2007 © 2007 IBM Corporation

SAP Business Workflow - Basic

Workflow Steps

Page 55: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation55 Jan-2007Workflow Basic Training

Workflow definition steps

Workflow definition is made up of individual steps. When creating a step in a workflow definition, the step type must be specified first.

There are

1. Steps which refer to business activities (activities & user decision)

2. Steps which are used for internal process control and monitoring (condition, multiple condition, loop, etc)

Page 56: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation56 Jan-2007Workflow Basic Training

Business Activities Steps

� Activity � Can be a single step task with basic business functionality� Can be a multi-step task, which reference to a workflow definition

� User Decision� This provides an opportunity for user interaction with the system.� The response to this decides the selection of the subsequent step.

Subworkflow� An activity which refers to a workflow rather than a task

Page 57: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation57 Jan-2007Workflow Basic Training

� Condition� Branch on the basis of control information from the runtime dependent

context of the workflow. � An attribute of this object can also be accessed for condition evaluation� Condition evaluation can be done by

� Field comparison e.g constants , object attribute, system fields

� Multiple condition� In contrast to condition, multiple condition makes it possible for the

workflow definition to branch in more than two branches.

� For evaluation of the multiple condition, the value of the basis of comparison is checked at runtime against the comparison values and branched accordingly.

Internal process control Steps

Page 58: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation58 Jan-2007Workflow Basic Training

Internal process control (contd.)

� Until Loop� Steps are processed repeatedly until the condition contained in the UNTIL step

is true.

� Fork� Used for parallel processing branches.� Only a part of the parallel processing branches actually has to run to continue

the workflow.� Dynamic parallel processing is also possible

Page 59: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation59 Jan-2007Workflow Basic Training

Internal process control (contd.)

Send mailText entered in this step can be used to send a mail to the agent assigned

� Container operationsUsed to perform arithmetic operation of value assignment to workflow container elements using constants and data in the workflow container .

Page 60: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation60 Jan-2007Workflow Basic Training

Internal process control (contd.)

� Event Creator

� An event is created when this step in the workflow is reached.

� Other workflows can be started as a reaction to the event created in this step. This event must be the triggering event of the relevant workflow tasks and/or templates.

� WAIT for event

� Used to stop the whole execution of the workflow until the event is created in the system.

� Used to wait for events for parallel processing

Page 61: SAP Business Workflow_Basic

IBM Global Business Services

Workflow Basic Training Jan-2007 © 2007 IBM Corporation

SAP Business Workflow - Basic

Containers and Bindings

Page 62: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM CorporationWorkflow Basic Training

Types of Containers

Page 63: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation63 Jan-2007Workflow Basic Training

Workflow Container

�The workflow container contains workflow-specific system variables and other elements which are defined explicitly.

�As part of the definition of the workflow task, the import and export parameters of the workflow are defined as elements of the workflow container.

�When the workflow is defined in the workflow editor, elements can also be added to the workflow container. These elements are then "local variables" within a workflow definition and can be used, for example, to set up a counting loop.

Page 64: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation64 Jan-2007Workflow Basic Training

Task Container

�Each task container already contains the workflow system variable and any additional elements for the method parameters of the referenced object method.

�You have to add additional elements to the task container for additional values are required for variable replacement in the work item text or in the long texts

Page 65: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation65 Jan-2007Workflow Basic Training

Other Types of Containers

Event parameter containerContains an element which can take the (object) reference to the object

whose change of status is announced via the event.

Rule parameter container

Contains the elements required as input in connection with the rule

resolution to be run at runtime.

Method parameter containerContains elements which will be required as import and export parameters

in connection with the method execution.

Page 66: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation66 Jan-2007Workflow Basic Training

Binding

�A binding is simply the art of of pouring selected container elements from one container into another.

�The binding editor is available when defining:Workflow definitionsTriggering eventsWorkflow stepsWorkflow steps ( Standard roles/ Object methods with parameters)

�The binding editor always references the container to receive the application data. Binding definitions can reference:

ConstantsVariables (container elements)System fields

Page 67: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM CorporationWorkflow Basic Training

Container & Dataflow

TaskTaskContainerContainer

MethodMethodContainerContainer

EventEventContainerContainer

Workflow Workflow ContainerContainer

triggeringtriggeringeventevent

syncsynctasktask

syncsyncmethodmethod

syncsynctasktask

syncsyncmethodmethod

rolerole

asyncasynctasktask

asyncasyncmethodmethod

44

terminatingterminatingeventevent

1122

33

5566

77

88

99

10101111

1212 1313

14141515

RoleRoleContainerContainer

Page 68: SAP Business Workflow_Basic

IBM Global Business Services

Workflow Basic Training Jan-2007 © 2007 IBM Corporation

SAP Business Workflow - Basic

Events

Page 69: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation69 Jan-2007Workflow Basic Training

� An event describes a possible status change for an object in the SAP System.

� Before an event can be used in a workflow, it must be defined in the Business Object Repository for the object type.

� Events must be triggered explicitly. The application itself can be the triggering agent.

Event

Page 70: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM CorporationWorkflow Basic Training

Types of Event Creation

ChangeChangeDocumentDocument

Status Status ManagementManagement

MessageMessageControlControl

SpecificSpecificHR TablesHR Tables

ABAP CodeABAP CodeIn User ExitIn User Exit

Page 71: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation71 Jan-2007Workflow Basic Training

Using Customizing for event trigger

Menu Path :Basic menu Menu Path :Basic menu --> Tools > Tools --> Business Workflow > Business Workflow --> Development > Development --> Definition tools > Definition tools --> Events > Events

Page 72: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation72 Jan-2007Workflow Basic Training

1. Event Creation of Change Document

Changing Changing Master dataMaster data

Event linkage is Event linkage is done to connect todone to connect tothe workflow/ taskthe workflow/ task

Event creation Event creation (SWEC)(SWEC)

Change loggedChange loggedusing using

change documentschange documents

Page 73: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation73 Jan-2007Workflow Basic Training

2. Using ABAP Code

This is using done by writing custom code e.g. by using SAP FM like SWE_EVENT_CREATE inside user exits, BADI etc.

�������������� ������������������

�������

���������������������������������������

���������������������������������������

�����������������������������������������

���������������������������������������

������ �����������������

������

���������������������������������������

������

������������������������������

��������

��������������������

���� ����������

����� ���

�����

�������������� ������������������

�������

���������������������������������������

���������������������������������������

�����������������������������������������

���������������������������������������

������ �����������������

������

���������������������������������������

������

������������������������������

��������

��������������������

���� ����������

����� ���

�����

Page 74: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM CorporationWorkflow Basic Training

Event Creators, Receivers and Event Linkage

PublishedEvents

Receivers

EventEvent

LinkageLinkage

Creator

Anybody wantthis event?

Page 75: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM CorporationWorkflow Basic Training

Type Linkage Entry

Transaction: Transaction: SWE2SWE2Menu Path :Basic menu Menu Path :Basic menu --> Tools > Tools --> Business Workflow > Business Workflow --> > Utilities > Other tools >Event linkage Utilities > Other tools >Event linkage

Page 76: SAP Business Workflow_Basic

IBM Global Business Services

Workflow Basic Training Jan-2007 © 2007 IBM Corporation

SAP Business Workflow - Basic

Agent Assignment and Role Resolution

Page 77: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation77 Jan-2007Workflow Basic Training

Agent

� Agent is an executor of a work item.

� Agent is responsible for executing a task in a workflow.

� Agent is determined by the system either through organizational chart or directly if user is assigned as agent for a particular task.

� If the agents of the individual workflow steps are determined using the customer-specific organizational chart, your agent assignment in the workflow remains flexible to change.

Page 78: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation78 Jan-2007Workflow Basic Training

Types of Agents

Deadline AgentsDeadline Agents

Notification AgentsNotification Agents

Processing AgentsProcessing Agents

Selected agentsSelected agentsare those possible are those possible agents who are agents who are elected to execute a elected to execute a task at runtimetask at runtime

Possible agentsPossible agentsare a collection of are a collection of agents who qualify agents who qualify to execute a work to execute a work itemitem

Actual agentActual agent is the is the agent among those agent among those selected agents who selected agents who actually processes the actually processes the work itemwork item

Page 79: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM CorporationWorkflow Basic Training

Tasks: Possible Agents & Default Roles

UserUser PositionPosition JobJob Org. UnitOrg. Unit PersonPerson

TASKTASK

Default roleDefault role

Possible agentsPossible agents

BusinessBusinessWorkplaceWorkplace

The workplace displays thework items for a agent

Page 80: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM CorporationWorkflow Basic Training

How are Selected Agents Determined With and Without a Default Role?

Possible Agents

Task definition withno default role

Task definition withdefault role

Triggering Triggering EventEvent

Page 81: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM CorporationWorkflow Basic Training

How are Selected Agents Determined With a WF Agent?

All possible agents who qualify to execute task

Step definition at workflowdefn. level with an agentspecified. This overrides

default role at task defn. level

Task definition withno default role

Task definition withdefault role

Triggering Triggering EventEvent

Page 82: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation82 Jan-2007Workflow Basic Training

Rule Basics

Transaction : PFAC_INS(Create)Transaction : PFAC_INS(Create)Menu Path:Menu Path: Tools Tools –– Business Workflow Business Workflow –– Development Development –– Definition tools Definition tools –– Rules for Agent Rules for Agent Assignment Assignment –– Create/Change/Display.Create/Change/Display.

Each rule gets a 8 digit generated by the system prefixed with ACRules can be tested using PFTC or by function module ‘RH_GET_ACTORS’

Page 83: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation83 Jan-2007Workflow Basic Training

Rule Definition in a Activity Step Type

Various options to create standard rules :

1. Responsibility (Pure configuration no ABAP coding)� Defined Value ranges are assigned to Agents� Data is filled from workflow container at runtime

2. Evalution paths (Pure configuration no ABAP coding)

3. Organizational data (Pure configuration no ABAP coding)� Jobs , positions

4. Functions to be executed – ABAP Code – Function Module

Page 84: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation84 Jan-2007Workflow Basic Training

1. Rule Definition with Responsibility: Example

JonesJones SmithSmith

AnnaAnna

MichaelMichael

WilliamWilliamRossRoss

DavidDavid

GeorgeGeorge

PeterPeter

Employee Names AEmployee Names A--KK

Employee Names LEmployee Names L--ZZ

Mr. MillerMr. MillerPosition : Administrator Position : Administrator

HRHRMr. AndrewMr. Andrew

Position : Administrator Position : Administrator HRHR

Page 85: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation85 Jan-2007Workflow Basic Training

Rule Definition with Responsibility: Example

NameNameUnameUnameElementElement

NameNameData Type Data Type Container ElementContainer Element

Employees from L-ZZ*L*

Employees from A-ZK*A*

NameFrom ToValue From

Rules Container DefinitionRules Container Definition

Areas of ResponsibilityAreas of Responsibility

Mr. AndrewMr. Andrew

Mr. MillerMr. Miller

Which Value?Which Value? Which AgentWhich Agent

Page 86: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM CorporationWorkflow Basic Training

2. Role Resolution with Function Modules

Exception indication no agents foundException indication no agents foundNOBODY_FOUNDNOBODY_FOUNDExceptionException

Outgoing list of agents in agent formatOutgoing list of agents in agent formatSWHACTORSWHACTORACTOR_TABACTOR_TABTableTable

Incoming rule containerIncoming rule containerSWCONTSWCONTAC_CONTAINERAC_CONTAINERTableTable

MeaningMeaningData Type RefData Type RefNameNameParameter Parameter TypeType

Role resolution with function module should be done only for complex criteria

Here are the basic steps:1. A function module with the following interface is created

2. Create a rule setting the type ‘Function to be executed’.3. Enter the created function module name4. Create container elements.

Page 87: SAP Business Workflow_Basic

IBM Global Business Services

Workflow Basic Training Jan-2007 © 2007 IBM Corporation

SAP Business Workflow - Basic

Organization structure

Page 88: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation88 Jan-2007Workflow Basic Training

Organizational Structure Business Scenario

�An organizational plan in SAP describes the organizational structure of a company.

�The workflow system finds the agents of the individual tasks by evaluating the organizational plan

�The functions to create and maintain organizational plans are part of the Personnel Planning and Development (PD) part of the SAP HR module

�You must connect this organizational structure to the workflow

Page 89: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation89 Jan-2007Workflow Basic Training

�Organizational units contain positions, occupied by employees.

�Jobs are abstract descriptions of task assignments.

�Positions can be linked to jobs. They inherit all the tasks assigned to that job.

�Users. A user is an SAP logon user ID. It thus represents a single person.

�Persons. A person is a specific employee created in the HR module.

�Workflow tasks can be assigned to organizational units, positions, jobs or users.

�The workflow system uses organizational structure to route work items to the correct recipients

Organizational Management

Page 90: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation90 Jan-2007Workflow Basic Training

Create Organisational Plan

Create root organizational unitCreate root organizational unitCreate root organizational unit

Additional organizational unitsAdditional organizational unitsAdditional organizational units

Create jobsCreate jobsCreate jobs

Create positionsCreate positionsCreate positions

Assign HoldersAssign HoldersAssign Holders

Assign tasksAssign tasksAssign tasks

Transaction: Menu Path: PPOCWTransaction: Menu Path: PPOCWTools Tools �� Business Workflow Business Workflow -- Development Development -- Environment Environment -- Organizational Management Organizational Management --Simple Maintenance Simple Maintenance –– Org plan basic data Org plan basic data -- CreateCreate

Create Executive BoardCreate Executive BoardCreate Executive Board

Create Sales region , ProductionCreate Sales region , ProductionCreate Sales region , Production

Administrator , Sales ManagerAdministrator , Sales ManagerAdministrator , Sales Manager

Sales Manager – eastern ZoneSales Manager Sales Manager –– eastern Zoneeastern Zone

Create Sales OrderCreate Sales OrderCreate Sales Order

Page 91: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation91 Jan-2007Workflow Basic Training

Transaction - PPOCW

Page 92: SAP Business Workflow_Basic

IBM Global Business Services

Workflow Basic Training Jan-2007 © 2007 IBM Corporation

Workflow Monitoring

Page 93: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation93 Jan-2007Workflow Basic Training

Event Trace- SWEL

Page 94: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation94 Jan-2007Workflow Basic Training

Event Trace - SWELS

The Event trace needs to be switched on for the event to be visible in the trace

Page 95: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation95 Jan-2007Workflow Basic Training

Event Log Details

Event linkage/instance Linkage not active.

Full key of the business object is not available to create the instance

The event had a start condition defined and the same was not met.

The evaluation of the check FM condition resulted to FALSE

The event started a workflow/task successfully.

Page 96: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation96 Jan-2007Workflow Basic Training

Workflow log-SWI2_FREQ

Page 97: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation97 Jan-2007Workflow Basic Training

SWI2_FREQ Contd.The agents who have participated in the workflow is displayed here.For all the background steps – agents is WF-BATCH

The screen displays the status of individual Workflow instance for the selected workflow

Page 98: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation98 Jan-2007Workflow Basic Training

Workflow log-SWI2_FREQ – Normal View

On clicking this the selected/possible and excluded agents can be viewed if the dialog step is in READY status. If status in COMPLETED then the selected agents is no longer available.

This displays the technical view of the workflow log

This icon indicated a workflow – parent and subsequent sub-workflows

This displays the graphical view of the workflow log

Page 99: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation99 Jan-2007Workflow Basic Training

Agents involved in Workflow

The agents who have participated in the workflow is displayed here.For all the background steps – agents is WF-BATCH

Page 100: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation100 Jan-2007Workflow Basic Training

Workflow log-SWI2_FREQ – Graphical View

The green line indicated in which step the workflow is currently lying

Page 101: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation101 Jan-2007Workflow Basic Training

Workflow log-SWI2_FREQ- Technical View

The value for each container (WF or task) is populated can be viewed

This displays the status of workflow or task. A complete blue cube denotes Complete status.

A partial blue cube denotes that the task is In Process status. A completely white cube denotes

a task in Ready status. A partially red cube denotes a task in Error.

Page 102: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation102 Jan-2007Workflow Basic Training

Some Important Jobs

� SWWDHEX For deadline monitoring

� SWWERRE For error Monitoring

� SWEQSRV For Event Queue Delivery

Page 103: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation103 Jan-2007Workflow Basic Training

Workflow Explorer - SWDM

Page 104: SAP Business Workflow_Basic

IBM Global Business Services

Workflow Basic Training Jan-2007 © 2007 IBM Corporation

Workflow QUIZ

Page 105: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation105 Jan-2007Workflow Basic Training

QUIZ

SAP workflow can be used(i) When work process have to be run repeatedly(ii) Process involve several people or departments (iii) Process include a range of activities(iv) All of the above

SAP Workflow allows process owners(i) To keep an eye on deadlines(ii) Provides statistics on the length of time to complete work processes(iii) Determine the workload with regard to individual participants(iv) All of the above(v) All of the above except (iii)

What do you understand by the term agents in SAP workflow.

Agent assignment in SAP workflow can be done using(i) Organization structure(ii) Single users(iii) Security Roles(iv) All of the above

Page 106: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation106 Jan-2007Workflow Basic Training

QUIZ

Workflow builder is used for building(i) Workflow template(ii) Business object(iii) Organization structure(iv) Task

SAP Workflow is triggered by(i) Events(ii) Business Object(iii) Task(iv) Method

What do you understand by workitem

State difference between workitem and notification

SAP Workflow can handle escalation - True/false

Page 107: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation107 Jan-2007Workflow Basic Training

QUIZ

SAP Workflow uses the existing transactions and functions of the SAP System to formnew business processes – True/False

A background step in a workflow needs agent assignment – True/false

Workflow step which is executed automatically by the system is known as (i) A background step (ii) An dialog step (iii) A internal control step(iv) None of the above

Business Workflow provides a number of tools for (i) Defining Workflow(ii) Analyzing workflows(iii) Monitoring and reporting workflow(iv) All of the above

SAP provides several workflows that map predefined business processes which canbe used with simple configuration - True/False

Page 108: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation108 Jan-2007Workflow Basic Training

QUIZWhich transaction code displays the sap business workflow menu?

a) SWDD b) SWUD c) SWLD d) SWED

What is the transaction to make basic workflow customizing configurations in a system?a) SWU5 b) SWU6 c) SWUD d) SWU3

When we make a subtype of a standard sap business object which of the followingcannot be modified in the custom object.a) Interfaces b) Key fields c) Attributes d) Events

Which of the following elements does the interface IFSAP not provide across all businessobject types.Method ExistenceCheck b) Attribute ObjectType c) Event Created d) Method display

Which of the following parameters is not mandatory when we create an event usingthe function module swe_event_create?a) Object key b) Object type c) Event name d) Event parameter(s)

Page 109: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation109 Jan-2007Workflow Basic Training

QUIZTo create a start condition for an event based on a parameter A, A must be?a) A key field of the business object for the event

b) Event parameter for that specific event

c) Any field in the lead table for the business object type

d) An attribute of the business object.

8) Which transaction is used to check event type linkages?a) SWEL b) SWED c) SWI2 d) SWE2

9) Which of the following objects cannot have a instance linkage with an event?a) workflow template b) standard task c) wait for event step d) create event step

10) Which is the very first step to build a parent workflow template?a) Attach a triggering event b) Create object type container c) Create the workflow

definition in the builder d) Assign a workitem text to the template.

Page 110: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation110 Jan-2007Workflow Basic Training

QUIZWhich of the following workflow steps may be simulated to a CASE ENDCASE statementin ABAP programming.

User decision b) Condition c) Multiple condition d) Fork

While checking the event trace if we get an entry with a red icon then this signifies?The event has not been triggered b) the event type linkage is missing c) the event has raised an

exception d) the workflow has gone into error

In the workflow log which of the following information is not available?Individual task statuses b) the event had a start condition or not c) the user who triggered the

workflow d) the task container values at runtime

When we use rule resolution to determine agents, the rule container receives its data from?workflow container b) task container c) method parameters d) event container

In which of the following workflow step we cannot check a condition to determine theprocess flow.a) Loop until b) Fork c) Wait for event

Page 111: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation111 Jan-2007Workflow Basic Training

QUIZ

Why do we need an event linkage?

How are exceptions raised in a business object program for a method?

How are the import parameters accessed in a program.

When should rules using responsibility be used.

State difference between single and multi task. Give a example when each can be used

What do you understand by subworkflow . State the steps of creating a subworkflow.

What is the transaction for customizing?

What is the different between possible agent, selected agent and actual agent?

What it _EVT_OBJECT

Page 112: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation112 Jan-2007Workflow Basic Training

QUIZIn a particular workflow scenario suppose that I have 5 agents A, B, C, D & E. Agents A, B & C are defined as possible agents for a dialog task (through agent assignment in the task), agents A, C, D & E are determined through the default rule specified in the task definition and agent E is specified as an excluded agent in the step definition of the dialog task in the workflow template. Then which of the following is false.

Agents C & D can be selected agents for the step Agent A can be a selected agent for the step Agent E is a possible agent but cannot be the selected agent for the taskAgent B can be a selected agent for the step

Which of the following macros will not work in an asynchronous method. swc_get_property self swc_get_element container swc_set_element container swc_create_object

Page 113: SAP Business Workflow_Basic

IBM Global Business Services

© 2007 IBM Corporation113 Workflow Basic Training

Thank you

Questions?Questions?

Comments?Comments?

Suggestions?Suggestions?

Within Enterprise

External Business Partners


Recommended