Académique Documents
Professionnel Documents
Culture Documents
Course Content
Introduction
Workflow architecture
Workflow Definition and workflow Template
Workflow steps in details
Task
Business Objects and Methods
Container Structure and Container Programming
Events
Organisational structure and role resolution
Different types of Agent
Workflow and ALE
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.
Need of Workflow
2 I wonder who
approves buying
this stuff?
Hmm ! Time to put in a 3
purchase requisition
request
1
4 Meanwhile, in
Time drags on . . . Mr. Manager’s office . . .
“What shall I do next?”
Drawbacks
Inefficiency.
Workflow ensures that the right work is sent to the right person at the
Workflow Architecture
Organisational
Level
Process Level
Business
Object
Level
Workflow Definition
Workflow Definition
3. Basic Data
4. Information about triggering events
5. Initial Values
6. Containers
7. Bindings
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.
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.
Workflow Design
Workflow Steps
There are
- Steps which refer to business activities (activities & user decision)
- Steps which are used for internal process control and monitoring
(condition, multiple condition, loop, etc)
User Decision
- This provides an opportunity for user interaction with the system.
- The response to this decides the selection of the subsequent step.
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
| © Copyright IBM Corporation 2003
IBM Global Services
Multiple condition
- In contrast to condition, multiple condition makes it possible for the workflow
definition to branch in more than two branches.
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
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 .
Event Creator
- An event is created when this step in the workflow is reached.
Standard Task(TS)
Single step
Customer Task(T)
Tasks
Workflow Template(WS)
Multistep
Workflow Task(WF)
Client-dependent Client-independent
Tasks
Single-step tasks
ƒ The multistep tasks form the business framework for a workflow definition
and each references one workflow definition.
Defining a Task
General
Work Item
ƒ Executable single-step tasks are represented by work items at
runtime.
ƒ Depending on the work item type, some of these work items are
displayed in a user's work list. Other work items, on the other hand,
are only used and processed internally.
Workitem Types
W: Dialog work item
Runtime display for a single step task with a user dialog
Workitem Text
ƒ First create the workitem text and position the cursor to include a varible
Example
Processes request from &_WI_Object_ID.CreatedBy&
ƒ The business object types are identified and described with their
object methods in the Business Object Repository(BOR) of the
R/3 System.
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
Key Fields
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.
Attributes
Attributes provides access to data.
Methods
Methods incorporate the permitted functions available for an object.
Methods have importing and exporting parameters as well as exceptions.
Methods
u lt
es
R
Import METHOD
Export
Parameters Parameters
Ex n
ce s
pt
io
| © Copyright IBM Corporation 2003
IBM Global Services
–Synchronous / Asynchronous
- Result:
- Instance independence:
Exceptions
•Error handling is accomplished through the use of method exceptions
(synchronous methods only).
Exceptions
Events
Events describe the change in the status of an object.
Workflow are usually started using events
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.
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.
KNA1 ZKNA1
Calling Method: Method:
Program
Change password Change password
Types of Containers
Workflow Container
Task Container
What is a Container?
Container Container
Definition Instance R/3
• Object
references
Definition Runtime
Definition Runtime
Binding
ƒ A binding is simply the art of of pouring selected container elements from
one container into another.
SWC_CONTAINER Declare
Container
SWC_CREATE_CONTAINER Initialize
Container
Release
SWC_RELEASE_CONTAINER
Container
Container
Instance
Variable SWC_GET_ELEMENT
Variable SWC_SET_ELEMENT
Internal SWC_GET_TABLE
Table
Internal SWC_SET_TABLE
Table SWC_DELETE_ELEME delete value
NT
Container
Declare a variable as the key of your object: Instance:
DATA: MATNR LIKE MARA-MATNR. CONTAINER
Fill the key with a value:
MATNR = ‘123456’. Object
Element:
Declare a variable as an object: MATRL
DATA: MATERIAL TYPE SWC_OBJECT.
Container
Declare a variable as an object:
DATA: MATERIAL TYPE SWC_OBJECT.
Instance:
CONTAINER
Read value of container element to your object:
SWC_GET_ELEMENT CONTAINER ‘MATRL’ MATERIAL.
Object
Declare a variable as the key of your object:
Element:
DATA: MATNR LIKE MARA-MATNR.
MATRL
Read the object type key into your variable:
SWC_GET_OBJECT_KEY MATERIAL MATNR.
Container
Declare a variable as an internal table object: Instance:
DATA: REQITEMS TYPE SWC_OBJECT OCCURS 0. CONTAINER
Since this internal table has no header, declare a
work area: DATA: REQITEM TYPE SWC_OBJECT.
Once the internal table is filled, transfer the internal table to the
multiline container element:
SWC_SET_TABLE CONTAINER ‘PRItems’ REQITEMS.
| © Copyright IBM Corporation 2003
IBM Global Services
Container
Read value of multiline container element Instance:
into your internal table object: CONTAINER
SWC_GET_TABLE CONTAINER ‘PRItems’ REQITEMS.
Events
Event
Status Message
Change
Management Control
Document
ABAP Code
Specific
In User Exit
HR Tables
Event linkage is
Status Event creation
done to connect to
Management (BSVW )
the workflow/ task
IF SY-SUBRC = 0.
COMMIT WORK.
ENDIF.
Anybody want
this event?
Event
Published
Events
Linkage
Receivers Creator
| © Copyright IBM Corporation 2003
IBM Global Services
Transaction: SWE2
Menu Path :Basic menu -> Tools -> Business Workflow -> Utilities > Other tools >Event linkage
Event Trace
Transaction: SWEL
Menu Path :Basic menu -> Tools -> Business Workflow -> Development -> Utilities ->
Events -> Event Trace.
Organisational Structure
Organizational Management
ƒ Organizational units contain positions, occupied by employees.
ƒ Positions can be linked to jobs. They inherit all the tasks assigned to
that job.
Assign Holders
Position: FI administrator 1
User 3
Agent
ƒ 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.
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
Role Resolution
A role defines rules by which selected agents can be determined at runtime through
role resolution. Role resolution restricts the number of possible agents.
Role
Resolution
Standard Rules
The rule parameters determine which information is required for the rule resolution
to be executed at runtime.
If an error occurs during rule resolution, setting the termination indicator for the rule
resolution determines how the workflow will continue:
Flag is selected - the workflow assumes an Error status and a notification is sent
to the workflow administrator.
Indicator is not activated - the workflow forwards this work item to ALL possible
agents.
Rule Basics
Transaction : PFAC_INS(Create)
Menu Path: Tools – Business Workflow – Development – Definition tools – Rules for Agent
Assignment – Create/Change/Display.
Jones Smith
William
Ross
Areas of Responsibility
Value From From To Name Mr. Miller
A* K* Employees from A-Z
Transaction : OOAW
Menu Path:
Evaluation path describes how to find one or more organizational objects based
On an initial organizational units
Example
Evaluation path Meaning
Possible agents
User Position Job Org. Unit Person
Default role
Business
Workplace
TASK
Possible Agents
Triggering
Event
Task definition with
no default role
Triggering
Event All possible agents who
qualify to execute task
Task definition with
no default role
Error Notification
Active Monitoring
IDOC Processing
B u s in e s s U s e r A n a ly s is
U s e r/G ro u p U s e r c h e c k s in b o x
E x c e p tio n D e te r m in e
g e t s n o t if ie d a n d e x e c u te s th e
R a is e d R e c ip ie n ts
v ia a w o r k ite m w o r k ite m
R e s ta rt th e Yes C a n e rro r b e
F ix th e e r r o r
p ro c e s s f ix e d ?
N o
End P u rg e th e ID o c
Execute Workitem
input Finished
Workitem completed
Active Monitoring
Active monitoring allows to specify threshold values for the state of the system
For e.g threshold can be on the number of IDocs in error or the time limit
Business Workflow
Customization
- Workflow -