SAP WORKFLOW
Course Contents
Workflow Overview
Business Object Repository
Task Builder
Workflow Builder
Customizing
Workflow Testing
Business Workplace
Organizational Plan
Workflow Administration
WORKFLOW OVERVIEW
Workflow Overview
Definition
Examples
Components
Tools
Workflow Definition
Workflow is defined as the automation of a business
process, during which documents , information or
tasks are passed from one participant to another for
action, according to a set of procedural rules.
Workflow ensures that the right work is sent to the
right person at the right time in the right sequence
with the right information.
When is Workflow
needed
?process is executed repeatedly
When a business
When different people are involved in different parts
of the process and co-ordination is required in a
specific sequence
When the users need to be reminded of what they
need to do
When the duration of the process is critical and
deadlines have to be met
How does it work?
When the workflow runs it creates work items which
are like e-mails, but
o they have the advantage that they contain the intelligence
needed to execute the relevant task with the correct data
when the operational user executes them,
o they disappear on their own when they have been executed
by someone.
o These work items can be received in the R/3 business
workplace, MS Outlook, Lotus Notes, or work item
notifications can be distributed by e-mail.
Workflow Examples
Workflow in MM module (Purchase)
Workflow in ALE-IDOC area
Workflow in HR Module
Business in MM
Email sent
Email to manager
Client / Agent in
SAP
Purchase Engineer
creates PR
Manager 1
Approval
cycle
SAP
Manager 2
SAP
Approves
PR approval
Level-1
PR approval
Level-2
Final
approval
Confirmation from
Vendor after receipt
of email
Emails to Vendor &
Manager with PO
as attachment
Automatic PO
creation
(background)
in SAP
System
Material iDoc from third party system
Third Party
System
Sending File
NO
SAP iDoc
reading
starts
Checks whether
material should be
created
Application
server
YES
Material gets created in
SAP via Posting
Further posting
including BOM creation
Email sent to third party
& MM manager
Email
sent to
third
party
Enter Notification of
Absence (Employee)
Notification of
Absence
Yes
Approved
(Head of Dept)
Update Personnel Data
No
No
Decision regarding further
processing (Employee)
Withdraw Notification
Yes
Revise Notification of
Absence (Employee)
Resubmit for approval
(Employee)
Workflow
Definition
Components
Workflow Definition
Components
Workflow definition consists
Step (Frontend)
Task
Business Object Method (Backend)
Workflow
Step
Task
BO
Method
55 Questions
Questions
Business
forfor
anyany
Business
Process
What What activity need to be performed
In what Order Order in which work should flow.
With what object Need to find suitable BO
Who does Person who can execute the task
When workflow should be triggered
Workflow
Tools
Workflow Tools
Workflow provides a number of tools for defining and
analyzing workflows as well as for monitoring
operation. They are:
Workflow Builder
Task Builder
Business Object Builder
Business Workplace
Workflow
Workflow Tools
Tools
Workflow Builder
It is for displaying and making changes to workflows. We can make
Small extensions directly to the original workflows supplied by SAP,
such as carrying out your own agent assignments or changing deadline
monitoring.
Task Builder
Task is an interface between workflow step and BO method. Task can
be executed in Foreground (Agent assignment) or in Background
(Workflow System).
Business Object Builder
Business Objects are used to make the functions of the R/3 Systems
available to a workflow.
Workflow Tools
Tools
Workflow
Business Workplace
This is the area where the end user receives information about the
activities they are to carry out. This provides them with a central
overview of all the activities that they are authorized to carry out.
They can commence the activities from here.
Important T. Codes
SWLD: All Workflow related
SWDD: Workflow Builder
SBWP: Business Workplace
SWU3: Verify Workflow customizing
SWO1: Business Object Builder
SWI1 : Work Item Display
SWUD: Consistency Check of Workflow
Important Tables
SWWWIHEAD
: Header Table
SWWWIAGENT : Work Item Agents
SWWLOGHIST : History of a work item
BUISINESS OBJECT
REPOSITORY
Business Object Repository
Object Type
Key Fields
Attributes
Methods
Exceptions
Events
Delegation
Exercise
Object Type (SWO1)
Its a data with which you want to work in a
workflow (e.g. Purchase Order).
Object Type (SWO1)
Implementation
& Release
of theofObject
Implementation
and Release
Objecttype
Type
Release Status
Release Status
: Not accessible at runtime
Execution not possible)
Implemented: Only for tests or Internal
use ,
possibly unstable
Released
: Released for use
Obsolete
: Functionality has been
Modeled
replaced
Key Fields
Key field represents unique identification for an
object.
The declaration between BEGIN_DATA and
END_DATA is generated entirely from the definition
data.
The Business Object Builder always works with
object references.
An object reference of this kind must be created in the
calling program with the macro
SWC_CREATE_OBJECT before a method is called
or an attribute determined.
Attributes
Attributes
Database Attribute
Database attributes are read from
the associated application table and
buffered in the object. Source code
is generated beforehand by the
Business Object Builder for this
purpose.
Virtual Attributes
Virtual attributes are calculated on
calling. Its combination of
other attributes Explicit
implementation is required.
Calculation upon attribute access
Database Attributes
Database Attribute
Source code is generated in the implementation program to read the date
from the application table.
If the attribute is derived from a field in a table whose key fields do not
correspond to or only correspond partly to the key fields of the object
type, the extensions in the implementation program are not sufficient
The source code between GET_TABLE_PROPERTY and
END_PROPERTY is generated entirely from the definition data. The
form select_table_<table name> is also generated automatically for the
actual database access.
The macro EXIT_OBJECT_NOT_FOUND returns the exception
"Object not found". This exception corresponds to the T100 message
OL826
Virtual Attribute
Virtual
Attribute
The data declaration is generated from the definition data
and is used as a runtime buffer.
The implementation between GET_PROPERTY and
END_PROPERTY must be created manually, since there is
no other definition information. The object reference to be
returned, in particular, must be created explicitly via the
macro SWC_CREATE_OBJECT.
Both the Business Object Builder runtime buffer "objectsalesgroup" and the associated container element
"SalesGroup" must be completed for data transfer.
Attributes implementation
Implementation Program
in BOR
Methods
Methods
With a method you define a function with which you
can edit, create, search for or delete an object of this
object type.
You cannot edit a method in the list of methods
displayed, which was inherited from the Super type or
an interface. But you can redefine an inherited method
by selecting it and choosing . You can then edit the
method.
Creating a method
Creating a Method
Synchronous Method
Results returned directly to calling program
Return of exceptions possible
All the methods that do not write their changes to the
database via the update task
Indicates that the activity is complete when the method
execution is finished
Synchronous Method
The implementation between
BEGIN_METHOD and
END_METHOD is generated from
the definition data.
The macro
SWC_REFRESH_OBJECT must
also be called after the application
functionality for synchronous
methods that can change object
attributes, in order to delete the
object buffer.
Asynchronous Method
Result can only be returned via an event
Only restricted exceptions possible
Asynchronous methods are always necessary if the
encapsulated application functionality uses updating
Indicates that the activity is not complete until a
terminating event is received
Communication for
Methods
Import
Parameters
Export
Parameters
Results
Exceptions
Synchronous
Method
Asynchronous
Method
Parameters
Parameters
Results
Results
Results are only relevant for
synchronous methods
It can be linked to possible
outcomes in workflow
Exceptions
Exceptions
Exceptions
Exceptions
No source code is generated for
triggering an exception.
Every exception must correspond
to a T100 message.
Up to four parameters, which
correspond to the four parameters
of the T100 message, can be
transferred with the
EXIT_RETURN macro.
The triggering of exceptions is
the same for all error types.
Exceptions
Exceptions
Temporary Error
Error occurs when certain
system resources are not
available
Application Error
Error exists in the called
application. (Example: There is
no authorization to edit the
object)
System Error
Inconsistencies exist between the
object type definition and the
method call. (Example:
Mandatory method parameters
for the method call have not been
set)
Events
Events
An occurrence of a change of a state of object. E.g.
PR created, PO released
List of Business Objects
SWO3
Macros to beto
used
Macros
be used
Only macros from <cntn01> may be used to manipulate objects
and containers.
Data Declaration:
Data: <Obj_ref> TYPE SWC_OBJECT
Create a Object
SWC_CREATE_OBJECT <obj_ref> <obj_type> <obj_key>
Reference an Object
SWC_GET_OBJECT_TYPE <obj_ref> <obj_type>
SWC_GET_OBJECT_KEY <obj_ref> <obj_key>
Refresh Object
SWC_REFRESH_OBJECT <obj_ref>
Macros to be used
Attribute access:
SWC_GET_[TABLE_]PROPERTY <Obj_ref> <attribute> <value>
Call a Method
SWC_CALL_METHOD <obj_ref> <method> <container>
Define Container
SWC_CONATINER <cont>
SWC_CREATE_CONTAINER <cont>
Reading and setting elements
SWC_GET/SET ELEMENT <cont> <element> <value>
Delegation
Delegation
Super Type
The object type from which attributes and methods are inherited
is called the Super type
Sub type
The Subtype inherits components from the super type. Has the
same Key field as its super type. ( Has extended functionality)
Delegation
Delegate the Super type to subtype. Define subtype and
delegation. Delegation "covers" the original super type.
You Continue to use the super type
TASK BUILDER
Task Builder
Standard Task
Triggering Event
Terminating Event
Agent Assignment
Standard Task
Single step task
Represents an activity
Associated with object type & its one of
methods
Triggering event is associated
There can be any number of standard tasks
in a
template
Standard Task Definition
Standard task can have following attributes:
Dialog task / Background
Synchronous /Asynchronous
Confirm end of processing: A pop up box will appear after
execution of work item
Dialog attribute is defined by the attached method
property
Result Type for the method/Exception of function modules
can become output for the task
Asynchronous task requires terminating events
Background task are accomplished by WF-BATCH
(System)
Task Creation
Assigning Object Type
and Method
Triggering Event
Terminating Event for
Asynchronous Task
Agent Assignment
Agent Assignment
Maintain Agent
Agent can be maintained in following ways
User
Job
Position
Rule
Expression
Organization Plan
Organization Plan
Position
Agent assignment