Sei sulla pagina 1di 99

IBM Global Business Services

SAP Business Workflow - Basic

Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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.

2 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Need of Workflow

2 I wonder who
approves buying this
stuff?
Hmm ! Time to put in a 3
purchase requisition request

TIME IS MONEY!!! I guess I’d better send off


some inter-office mail to
ask the approvers to
5 approve my requisition.

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

Workflow Basic Training © 2007 IBM Corporation


IBM Global Business Services

Drawbacks

 Inefficiency.

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

 Who executed or is executing it.

 How much time it required.

Workflow Basic Training © 2007 IBM Corporation


IBM Global Business Services

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

5 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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.

6 Workflow Basic Training © 2007 IBM Corporation


IBM Global Business Services

SAP Workflow- (BEST Business Practices)

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
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 Actors


Eliminate time wasted waiting to take action ( P U S H )

Ensure Compliance
Monitor and Control Processes; Deadline Monitoring and
Escalation Procedures
7 Workflow Basic Training © 2007 IBM Corporation
IBM Global Business Services

SAP Business Workflow - Basic

Workflow Architecture

Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Workflow Architecture

Organisational
Level

Process Level

Business
Object Level

9 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

SAP Business Workflow - Basic

Workflow Definition

Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Workflow Definition

A workflow definition describes the workflow process

Workflow definition consists of

1. Basic Data
2. Information about triggering events
3. Initial Values
4. Containers
5. Bindings

11 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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

Transaction: SWDD
Menu Path: Tools  Business Workflow  Development  Definition tools
 Workflow Builder.

12 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Workflow Definition - Steps

A workflow definition is made up of individual modular steps.

13 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Example: Workflow Definition

14 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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.

15 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

How workflow gets executed

16 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Workflow Toolbox - SWUS

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

17 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

SAP Business Workflow - Basic

Business Object

Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Object Types & Workflow

ƒ 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.

19 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Object Types & Objects

 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.

20 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Object Type - Definition

21 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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

22 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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.

23 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Attributes

Attributes provides access to data.

ABAP Dictionary Field Virtual

24 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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 :

25 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Methods

Import METHOD
Export
Parameters Parameters

26 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Methods - Call attributes


–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 back


to the calling program. These types of methods can return export
parameters, results and exceptions. Asynchronous methods do not
return control to the calling program immediately. Once executed,
they depend upon events to communicate the results of the method
back to the calling program. Asynchronous object methods cannot
have results, export parameters or exceptions.

27 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Methods - Call attributes

 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.

28 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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.

29 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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)

30 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Exceptions

•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

31 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Events

Events describe the change in the status of an object.


Workflow are usually started using events

32 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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.

33 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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.

34 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Delegation

Transaction: Menu Path: SW01


Tools  Business Workflow - Development - Definition tools - Business Object Builder -
Settings - Delegate

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.

KNA1 ZKNA1
Calling Method: Method:
Program
Change password Change password

35 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Objects in the workflow

36 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Some common Business Objects and Interfaces

BKPF Posting document


BUS2019 Customer document
BUS2020 Vendor document
BUS2041 Asset document
BUS2069 G/L account document
BUS2029 Price change
EKKO Purchasing document
VBAK Sales document
DRAW Drawing Object
BUS2032 Sales order
BUS1001 Material Master
BUS1010 Customer Credit Account
BUS1022 Fixed Asset Object
BUS1065 Employee
BUS2012 Purchase Order
BUS2078 QA Notifications
IFSTATUS Generate events from status management
IFARCH21 Archive Link Interface
IFIDOCOUT IDoc outbound processing

37 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

SAP Business Workflow - Basic

Business Object Programming

Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Some Key features

 BOR programming makes extensive use of macros.


 The macro instructions required for programming are incorporated via the
include <object>.
 The Business Object Builder always works with object references. Object
reference is created in the calling program with the macro
SWC_CREATE_OBJECT
 The object declaration is a complex structure that includes the key fields
(OBJECT-KEY-ID) The attribute buffer is used to minimize recalculation.
 Each object type programming is bounded by the macros BEGIN_DATA and
END_DATA.

39 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Container Marcos

Definition and Initialization

SWC_CONTAINER <Cont>
SWC_CONTAINER_CREATE <Cont>

Reading and Setting elements


SWC_GET\SET_ELEMENT <cont> <element> <value>
SWC_GET\SET_TABLE <cont> <element> <int_tab>

Workflow Basic Training © 2007 IBM Corporation


IBM Global Business Services

Writing/Reading Container Elements Defined as Field Values

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'


EXPORTING
CUSTOMER_NUMBER = CUSTOMERNUMBER
SALES_ORGANIZATION = SALESORGANIZATION
------
------.
IMPORTING
RETURN = RETURN
TABLES
SALES_ORDERS = SALESORDERS
EXCEPTIONS
OTHERS = 01.
CASE SY-SUBRC.
WHEN 0. " OK
WHEN OTHERS. " to be implemented
ENDCASE.

SWC_SET_ELEMENT CONTAINER 'Return' RETURN.


SWC_SET_TABLE CONTAINER 'SalesOrders' SALESORDERS.
END_METHOD.

41 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

SAP Business Workflow - Basic

Task and Workflow Template

Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Single and Multistep Tasks

Transaction : PFTC
Menu Path -> Tools -> Business Workflow -> Development -> Definition tools ->Tasks

References one object type


Single step method and displays one step
in the business process

Tasks

Represents the business


process and is a sequence of
Multistep individual tasks and control
steps

43 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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.

44 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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).

45 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Task Definition – Synchronous and


Asynchronous Methods

46 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Defining a Task

47 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Settings for Tasks

Task executed in At runtime user can


background create attachments
depending on
object method User explains explicitly
that work item is no longer
is to be processed

Background Confirm end of


SAPphones processing

The workflow dials


the telephone
number attached to
the current customer
48 Workflow Basic Training Jan-2007 © 2007 IBM Corporation
IBM Global Business Services

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

Example
Processes request from &_WI_Object_ID.CreatedBy&

49 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

SAP Business Workflow - Basic

Workflow Steps

Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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)

51 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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.

 Document from template


 PA document is created from a document template using variables in the text
that are filled during program execution.

 Web Activity
 Selected container elements are posted using http protocol in XML or SOAP
message

 Subworkflow
 An activity which refers to a workflow rather than a task
52 Workflow Basic Training Jan-2007 © 2007 IBM Corporation
IBM Global Business Services

Internal process control Steps

 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.

53 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Internal process control (contd.)

WHILE Loop
 Steps are processed repeatedly until the conditions contained in the WHILE
step no longer apply.

 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

54 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Internal process control (contd.)

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

 Container operations
- Used to perform arithmetic operation of value assignment to workflow
container elements using constants and data in the workflow container .

55 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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

56 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

SAP Business Workflow - Basic

Containers and Bindings

Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Types of Containers

Workflow Basic Training © 2007 IBM Corporation


IBM Global Business Services

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.

59 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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

60 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Other Types of Containers

Event parameter container


Contains 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 container


Contains elements which will be required as import and export parameters
in connection with the method execution.

61 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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 definitions
Triggering events
Workflow steps
Workflow steps ( Standard roles/ Object methods with parameters)

ƒ The binding editor always references the container to receive the


application data. Binding definitions can reference:
Constants
Variables (container elements)
System fields

62 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Container & Dataflow

Workflow Task Role Method Event


Container Container Container Container Container
1
2 triggering
event
3 4
sync sync
6 task 5 method

7 9
sync sync
task method
11 10

8 role
12 13
async async terminating
task method event
15 14
Workflow Basic Training © 2007 IBM Corporation
IBM Global Business Services

SAP Business Workflow - Basic

Events

Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Event

 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.

65 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Types of Event Creation

Status Message
Change
Management Control
Document

ABAP Code
Specific
In User Exit
HR Tables

Workflow Basic Training © 2007 IBM Corporation


IBM Global Business Services

Using Customizing for event trigger

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

67 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

1. Event Creation of Change Document

Change logged Event linkage is


Changing Event creation
using done to connect to
Master data (SWEC)
change documents the workflow/ task

68 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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.

CALL FUNCTION 'SWE_EVENT_CREATE'


EXPORTING
OBJTYPE = OBJTYPE
OBJKEY = OBJKEY
EVENT = EVENT
CREATOR = APPLICANT
START_WITH_DELAY = ' '
IMPORTING
EVENT_ID = EVENTID
TABLES
EVENT_CONTAINER = CONTAINER
EXCEPTIONS
OBJTYPE_NOT_FOUND = 01.

IF SY-SUBRC = 0.
COMMIT WORK.
ENDIF.
69 Workflow Basic Training Jan-2007 © 2007 IBM Corporation
IBM Global Business Services

Event Creators, Receivers and Event Linkage

Anybody want
this event?

Event

Published
Events

Linkage

Receivers Creator
Workflow Basic Training © 2007 IBM Corporation
IBM Global Business Services

Type Linkage Entry

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

Workflow Basic Training © 2007 IBM Corporation


IBM Global Business Services

SAP Business Workflow - Basic

Agent Assignment and Role Resolution

Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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.

73 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Types of Agents

Processing Agents
Possible agents
are a collection of
agents who qualify to Deadline Agents
execute a work item

Notification Agents

Selected agents
Actual agent is the
are those possible
agents who are agent among those
elected to execute a selected agents who
task at runtime actually processes the
work item

74 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Tasks: Possible Agents & Default Roles

Possible agents
User Position Job Org. Unit Person

Default role
Business
Workplace
TASK

The workplace displays the


work items for a agent

Workflow Basic Training © 2007 IBM Corporation


IBM Global Business Services

How are Selected Agents Determined With and Without a


Default Role?

Possible Agents
Triggering
Event
Task definition with
no default role

Task definition with


default role

Workflow Basic Training © 2007 IBM Corporation


IBM Global Business Services

How are Selected Agents Determined With a WF Agent?

Triggering
Event All possible agents who
qualify to execute task
Task definition with
no default role

Task definition with


default role

Step definition at workflow


defn. level with an agent
specified. This overrides
default role at task defn. level

Workflow Basic Training © 2007 IBM Corporation


IBM Global Business Services

Rule Basics

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

Each rule gets a 8 digit generated by the system prefixed with AC


Rules can be tested using PFTC or by function module ‘RH_GET_ACTORS’

78 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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

79 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

1. Rule Definition with Responsibility: Example

Employee Names A-K

Jones Smith

Mr. Miller George Anna


Position : Administrator Mr. Andrew
Peter
HR Position : Administrator
Michael HR
David

William
Ross

Employee Names L-Z

80 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Rule Definition with Responsibility: Example

Rules Container Definition


Container Element Data Type Name
Element Uname Name

Areas of Responsibility
Value From From To Name Mr. Miller
A* K* Employees from A-Z

L* Z* Employees from L-Z Mr. Andrew

Which Value? Which Agent

81 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

2. Role Resolution with Function Modules

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
Parameter Name Data Type Ref Meaning
Type
Table AC_CONTAINER SWCONT Incoming rule container
Table ACTOR_TAB SWHACTOR Outgoing list of agents in agent format
Exception NOBODY_FOUND Exception indication no agents found

2. Create a rule setting the type ‘Function to be executed’.


3. Enter the created function module name
4. Create container elements.

Workflow Basic Training © 2007 IBM Corporation


IBM Global Business Services

SAP Business Workflow - Basic

Organization structure

Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

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

84 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Organizational Management

ƒ 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

85 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Create Organisational Plan

Transaction: Menu Path: PPOCW


Tools  Business Workflow - Development - Environment - Organizational Management -
Simple Maintenance – Org plan basic data - Create

Create root organizational unit Create Executive Board

Additional organizational units Create Sales region , Production

Create jobs Administrator , Sales Manager

Create positions Sales Manager – eastern Zone

Assign Holders

Assign tasks Create Sales Order

86 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Transaction - PPOCW

87 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

SAP Business Workflow - Basic

Workflow Monitoring - Basic

Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

T-Code - SWU3

Auto customizing does not include maintenance of the organizational plan nor task-specific customizing
(that is, assignment between tasks and possible agents).

89 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Business Workplace (Transaction SBWP) R/3 ONLY

Documents Sub Folder


For Notifications
Workflow Sub Folder
For Work Items
Work Item Heading
Key information/ fields

Work Item Text Supplement


information/ fields/ action
items

90 Workflow Basic Training © 2007 IBM Corporation


IBM Global Business Services

Various Integration Points

Web-Browser
SAP Portal

MS Outlook

Lotus Notes
SAPGUI

91 Workflow Basic Training © 2007 IBM Corporation


IBM Global Business Services

Event Trace - SWELS

92 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Event Trace - Contd.

Transaction: SWEL
Menu Path :Basic menu -> Tools -> Business Workflow -> Development -> Utilities ->
Events -> Event Trace.

The Event trace needs to be switched on for the event to be visible in the trace
93 Workflow Basic Training Jan-2007 © 2007 IBM Corporation
IBM Global Business Services

Event Log Details

94 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Workflow log-SWI2_FREQ

The value with each container variable is populated can be viewed

Agents can be viewed before processing the work items

95 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

SWU_OBUF

96 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Maintain start conditions for workflow: SWB_COND

Take care if delegation is done – start condition should be on the supertype


Which is mentioned in the triggering event of a WF design.
97 Workflow Basic Training Jan-2007 © 2007 IBM Corporation
IBM Global Business Services

Some Important Jobs


 SWWDHEX For deadline monitoring

 SWWERRE For error Monitoring

 SWEQSRV For Event Queue Delivery

98 Workflow Basic Training Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Thank you

Questions?

Comments?

Suggestions?

Within Enterprise

External Business Partners

99 Workflow Basic Training © 2007 IBM Corporation

Potrebbero piacerti anche