You are on page 1of 139

SAP Business Workflow Training

August 21st 2012


K.B.Saraswathi Ramakrishnan
saraswathi_balakrishnan@mahindrasatyam.com
WfMC

The Workflow Management Coalition is the globally


recognized body for the advancement of workflow
management technology and its use in industry.
Definition of Workflow

According to WfMC , Workflow is defined as the


automation of a business process , in whole or part ,
during which documents , information or tasks are
passed from one participant to another for action ,
according to a set of procedural rules.
When is Workflow needed ?
It is particularly beneficial
when different people are involved in different parts of the
process
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
By automating the process, you free the users from having to
know what to do when. Work items are sent to the
participants notifying them of what they have to do, and a
single click on the notification calls the correct transaction
and navigates to the relevant screen.
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 provide their own functionality so that the operational
user has access to everything that is useful to improve the
flow of the process,
o they disappear on their own when they have been executed
by someone else or made obsolete.
These work items can be received in the R/3 business
workplace, MS Outlook (or any other MAPI compatible client),
Lotus Notes, or work item notifications can be distributed by e-
mail.
Purpose of SAP Business Workflow
SAP Business Workflow can be used to define business
processes that are not yet mapped in the R/3 System. These
may be simple release or approval procedures, or more complex
business processes such as creating a material master and the
associated coordination of the departments involved.
SAP Business Workflow is particularly suitable for situations in
which work processes have to be run through repeatedly, or
situations in which the business process requires the
involvement of a large number of agents in a specific sequence.
SAP provides several workflows that map predefined business
processes . These workflows do not require much
implementation
Integration

SAP Business Workflow uses the existing transactions and


functions of the R/3 System and does not change the functions.
You can combine the existing functions of the R/3 System to
form new business processes with SAP Business Workflow. The
workflow system takes over control of the business processes.
Technical Principles

The definition and execution of Workflow can be divided into


four main areas.
Business Workplace
Workflow Builder
Tasks
Business Object Repository (BOR)
Technical Principles
Technical Principles
BUSINESS WORKPLACE
o Work items are displayed to the user for execution in their SAP Inbox
WORKFLOW BUILDER
o Workflow definitions are defined which are made up of steps that
control the workflow or the tasks to be executed . This linking is defined
in Workflow Builder .
TASKS
o Tasks describe elementary business activities . They always refer to the
method of the object . Tasks can be background tasks or dialog tasks .
OBJECTS AND OBJECT TYPE
o Object type describes the data with which you want to work in workflow
, e.g. MATERIAL . Each Object type has methods in which activities are
defined which can be executed with data e.g. creation of material .
Demo Example
Process Flow
o An employee enters a notification of absence (leave request) in the R/3 System by
filling out the relevant input template.
o The direct superior of the employee is responsible for approving or rejecting the
notification of absence. The R/3 System determines the direct superior
automatically on the basis of the organizational plan maintained.
o If the request is approved the creator is notified by mail:
o If the request is not approved, the creator is informed and can decide whether to
withdraw the notification of absence or revise it. If the superior has given reasons
for the rejection in an attachment, the creator can take these into consideration.
o If the creator revises the request, it is submitted to the superior for approval again.
The applicant can also add an attachment, which can then be accessed by the
superior.
o This cycle is repeated until either the superior approves the leave request or the
creator withdraws it.
o The applicant can find out the current processing status at any time by looking in
their workflow outbox.
Demo Example
Business Object Builder

USE :
You use the Business Object Builder to create , display or
change object types .
The path is Tools Business Workflow Development
Definition Tools Workflow Object Builder
The transaction code is SWO1
Business Object Builder

OBJECT TYPES :
Object Type is the description of data (objects) in the system created
at definition time in the Business Object Builder
The examples are :
o Documents (invoices, purchase requisitions, job applications, and so
on)
o Master data (customer, material, vendor, and so on)
o Transaction data (order, quotation, and so on)
Business Object Builder

CREATING OBJECT TYPES :


There are two ways of creating a new object type:
You create a completely new object type
You create an object type as a subtype of an existing object
type, which inherits the components of the existing object
type automatically.
Business Object Builder
Business Object Builder
Business Object Builder
Business Object Builder
Business Object Builder
PROCESSING OBJECT TYPES :
Check
o To check that the implementation program with the attribute
and method accesses is syntactically correct and complete with
regard to the object type definition, select .
Change release status
o To change the release status of the object type, choose Object
type Change release status to ....
o To change the release status of an object type component,
proceed as follows:
o Open the object type in change mode.
o Select the object type component.
o Choose Edit Change release status Object type
component ....
Business Object Builder
RELEASE STATUSES :

The following release statuses exist for object types and object type components:
Modeled
You cannot call modeled object types/object type components at
runtime.
Implemented
Implemented object types/object type components are either in the test
phase or are only used internally. You can call and test them at runtime.
Implementation may not yet be stable.
Released
Released object types/object type components are released for use. You
can call them at runtime. Any enhancements made by SAP to released
object types and object type components are upward-compatible
Business Object Builder
DEFINITION OF OBJECT TYPE COMPONENTS :

o You need object type components to work with an object type.


A newly created object type only has the object type
components that is inherits from the standard interface, which
is supported by every object type
o To set up the object type for your tasks, you define key fields,
attributes, methods and events
Business Object Builder
PROCESS FLOW :
To define an object type, you do not have to edit all object
type components. You should follow the sequence below:
You check whether any object type components required
are already contained in interfaces and implement them.
You define the key fields.
You create the necessary attributes.
You create the necessary methods, for which you can define
method parameters and exceptions.
You create the necessary events, for which you can create
additional event parameters.
Business Object Builder
IMPLEMENTATION OF INTERFACES :

o You use this function to define the interfaces that your object type
supports
o SAP supplies interfaces that you can use when defining your own object
types
o Using interfaces standardizes the definition of the object type
components.
o Using an interface guarantees that the object type fully supports the
methods (with all parameters and all exceptions), attributes and events
in the interface
o All objects types support the standard interface.
o This contains the interfaces Check existence and Display
o You can add other interfaces to your object type
Business Object Builder

STANDARD INTERFACE :
All object types support the standard interface and
hence inherit the attribute ObjectType and the
interfaces Display and Check existence
These contain the methods Display and
ExistenceCheck
The attribute ObjectType returns the type of an
object
Business Object Builder
DEFINING KEY FIELDS :
Objects are always identified using one or more key fields
The identifying key of an object is made up of all the key fields of the
object type
Procedure
Position the cursor on the component name Key fields (blue
background).
Select
Answer YES to the question Create with ABAP Dictionary field
proposals? The Create with Data Dictionary Field Proposals
dialog box appears
Enter the table from which you want to reference the fields, and
select the fields that are the key fields of your object type
Business Object Builder
DEFINITION OF ATTRIBUTES FOR AN OBJECT TYPE :
You must define attributes for an object type when you
want to query particular properties, statuses or values at
runtime
Attributes can be used to formulate conditions in the
workflow definition
At runtime, the attribute values are read or calculated,
and can also be used to control the workflow
Object type attributes can return data in the following
formats:
Value of ABAP Dictionary field
Object reference
Value calculated at runtime
Object status in status management
33
Business Object Builder
DEFINITION OF ATTRIBUTES FOR AN OBJECT TYPE :
Attributes have various sources of information
VIRTUAL
Attribute for which a read procedure always has to be
implemented, since no field content in the database
corresponds to this attribute. A virtual attribute can return
the value of an ABAP Dictionary field or an object reference
DATABASE FIELD
When this type of attribute is defined, reference is made to a
database field as the source of the required information. An
attribute whose source is a database field can either return
the database field contents or an object reference
OBJECT STATUS
Attribute whose value is an object status

34
Business Object Builder
DEFINITION OF METHODS FOR AN OBJECT TYPE :
With a method you define a function with which you can
edit, create, search for or delete an object of this object
type
The methods refer to ABAP functions (transactions,
function modules, dialog modules, and so on) and make
them available to the workflow system
Features
You can also define the following data for each method:
Import parameters (for synchronous and asynchronous
methods)
A result (only for synchronous methods)
Export parameters (only for synchronous methods)
Exceptions (only for synchronous methods)
39
Business Object Builder
DEFINITION OF METHODS FOR AN OBJECT TYPE :
SYNCHRONOUS METHODS :
Method that assumes process control for the duration of its
execution and reports back to the calling component (in this
case the work item manager) after its execution
Terminating events can be defined for a single-step task
described with a synchronous object method
A synchronous method can return the following data to the
workflow:
Return parameters
One result
Exceptions

41
Business Object Builder
DEFINITION OF METHODS FOR AN OBJECT TYPE :
ASYNCHRONOUS METHODS :
Method that does not report back directly to the calling
component (in this case the work item manager) after its
execution
It does not return any result, any parameters or any
exceptions
At least one terminating event must be defined for a single-
step task described with an asynchronous object method
An asynchronous method must enter its results itself. Import
parameters can be passed to it only

43
Business Object Builder
DEFINITION OF METHODS FOR AN OBJECT TYPE :
RESULT
A specific parameter of a synchronous method for returning
the essential result of this method
The possible values of this result can be defined in a fixed
value domain or a check table so that they are known in the
workflow definition and can be taken into account
A method can only ever have one result, but it can have any
number of return parameters as well
A method does not necessarily have to have a result

45
Business Object Builder
DEFINITION OF METHODS FOR AN OBJECT TYPE :
EXCEPTIONS
Object type component: Error which may occur during
method execution and indicates whether a method was
successful
Exception categories:
Application and system error
Temporary error
Temporary errors can occur when system resources are not
available

46
Business Object Builder
DEFINITION OF METHODS FOR AN OBJECT TYPE :
PROCEDURE
To create methods for an object type, position the cursor on
the name Methods (blue background), and select
If the new method is based on a function module, you should
answer the question with YES . You are then supported by a
wizard in the definition of the method
GENERAL TAB
DIALOG : If you do not set the indicator Dialog on the tab
page General, the method is executed in the background at
runtime
SYNCHRONOUS
RESULT
INSTANACE DEPENDENT
48
Business Object Builder
DEFINITION OF METHODS FOR AN OBJECT TYPE :
PROCEDURE
RESULT TYPE TAB
Define the reference to ABAP Dictionary
ABAP TAB
You enter the function to be executed when the method is
called on the tab page ABAP
e.g if the transaction has to be called by the method
then Checkbox Transaction is to be selected and the
transaction code to be entered in the NAME

50
Business Object Builder
DEFINITION OF METHOD PARAMETERS :
You define method parameters for a method under the
following circumstances:
When the method requires other input values apart from the
object reference, which are not requested in dialog.
When the method returns parameters apart from the object
reference
Integration
The following data type references exist for method
parameters:
ABAP Dictionary reference
Object type reference

52
Business Object Builder
DEFINITION OF METHOD EXCEPTIONS :
You define exceptions for a method when you want to "publicize" error
situations in a standardized manner in order to give the caller of the method
the opportunity to react to the error situations
To define exceptions for a method, position the cursor on the method and
select Exceptions. The existing exceptions for the method are displayed and
you select to create a new exception.
Give the exception an identifying number in the dialog box Add Exceptions,
which is used to address it in the implementation program. The following
number ranges apply:
0001-1000: Exceptions defined for interfaces
1001-7999: Application-specific exceptions, reserved for SAP
development
8000-8999: Exceptions triggered by the object manager
9000-9999: Customer-defined exceptions, reserved for
customers
53
Business Object Builder
DEFINITION OF METHOD EXCEPTIONS :
Exceptions are classified according to error types.
Temporary error: This error type indicates that certain system
resources are not available at the moment, and that it is
advisable to call the method again at a later point in time.
Temporary errors can also occur if the method is temporarily
locked by another user for processing.
Application error: This error type is caused within the application
called in the method. A table that cannot be maintained or a
document that does not exist are typical application errors.
System error: This error type shows incorrect configuration of the
object manager or an inconsistency between object type
definition and method call. Missing mandatory method
parameters when calling a method are an example of a system
error.

54
Business Object Builder
DEFINITION OF EVENTS FOR AN OBJECT TYPE :
You define events for an object type, if a status change in
an object of this type is to be published across the system
You use an event in a workflow under the following
circumstances:
In a workflow or task definition as a triggering event
The workflow or task is started when the event is triggered.
In a task definition as a terminating event
The task is terminated when the event is triggered.
In a workflow definition for steps of the types Event creator and
Wait for event.
The event is triggered (event creator) or the workflow is
continued when the event is triggered (wait for event).

55
Business Object Builder
DEFINITION OF EVENTS FOR AN OBJECT TYPE :
o The event is not normally triggered in the implementation program,
but instead by an event creation. You can use the function modules
SWE_EVENT_CREATE or SAP_WAPI_CREATE_EVENT to trigger an event
o An event is published without the creating application being informed
as to whether a receiver reacts to this event. The system enters
potential receivers in a linkage table, which is evaluated by the event
manager
o Every event has an event container that contains data about the
context of its creation. The data is passed to the task or workflow via a
binding

56
Business Object Builder
DEFINITION OF EVENT PARAMETERS :
The event parameters are displayed as event container
elements and you use them in binding definitions
between the event container and the task or workflow
container
There are two different types of data type reference for
event parameters:
ABAP Dictionary reference
Object type reference

57
Business Object Builder
PROGRAMMING IN THE IMPLEMENTATION PROGRAM :
o The information specified about the object type components is
only of a descriptive nature. Attribute accesses and method
calls are programmed in the implementation program of the
object type
o This program is called and executed by the system at runtime.
o During object type definition you select Program to go to the
ABAP Editor
o You go directly to the lines in the implementation program that
contain the relevant source text for the selected method or
attribute
o Parts of the source text can be generated automatically to help
implementation

59
Business Object Builder
PROGRAMMING IN THE IMPLEMENTATION PROGRAM :
The source text is generated based on the specifications
you made when defining the object type and the object
type components, and inserted into the implementation
program
MANUAL POSTPROCESSING
You need to check the program as automatic program
generation only provide templates
CHANGES AFTER PROGRAM GENERATION
Changes made to object type components do not
automatically change the program
So all subsequent changes have to be made manually

60
Business Object Builder
PROGRAMMING IN THE IMPLEMENTATION PROGRAM :
Only in the following cases the source code gets
automatically changed in the implementation program
Deletion of methods
Deletion of virtual attributes
Renaming of methods
Renaming of virtual attributes
INCLUDING MACRO INSTRUCTIONS
Macro instructions for processing containers and accessing
objects are used in the implementation program
The macro instructions are available if the macro <OBJECT> has
been included into the implementation program

61
Business Object Builder
PROGRAMMING IN THE IMPLEMENTATION PROGRAM :
The macro instructions for processing the container can
also be used outside the implementation program
The macro instructions for accessing objects, attributes
and methods can only be used within the implementation
program

62
Business Object Builder
MACRO INSTRUCTIONS FOR PROCESSING A CONTAINER
These macro instructions can be used in following programs :
Implementation programs of object types
Function modules for event creation
Function modules for role resolution
Processing a container instance includes:
Accessing the value of a container element
Entering a value for a container element

63
Business Object Builder
DEFINITION OF EVENT PARAMETERS :
You define event parameters to supplement the system
event parameters
EVENT PARAMETERS :
Runtime-specific information from the event creation context
Event parameters are defined as elements of the event
container and are passed to the event receivers via binding
The following event parameters are automatically contained
in the event container:
The reference to the object whose change of state is
described by the event.
The user name of the party who triggered the event creation.

64
Business Object Builder
The include file <CNTN01> must have been included into
the program in order to use these macros
The container must be declared and initialized with the
following macro instructions:
SWC_CONTAINER <Container>. "Declaration
SWC_CREATE_CONTAINER <Container>. "Initialization
You can assign the content of a field to a container
element or write the content of a container into a field
This content can be multiline, that is, in the form of an
internal table
The content of a field can be an elementary data type, a
structure or an object reference
65
Business Object Builder
ACTIVITIES :
Deleting a container element
SWC_DELETE_ELEMENT <Container> <ContainerElement>.
Copying a container element
SWC_COPY_ELEMENT <SourceContainer>
<SourceElement> <TargetContainer> <TargetElement>.
Writing a field value
SWC_SET_ELEMENT <Container> <ContainerElement>
<Value>.
Reading a field value
SWC_GET_ELEMENT <Container> <ContainerElement>
<FieldVariable>.

66
Business Object Builder
ACTIVITIES :
Writing a multiline field value
SWC_SET_TABLE <Container> <ContainerElement> <Value>.
Reading a multiline field value
SWC_GET_TABLE <Container> <ContainerElement>
<TableVariable>.
Writing an object reference
DATA <Object> TYPE SWC_OBJECT.
SWC_CREATE_OBJECT <Object> <ObjectType> <ObjectKey>.
SWC_SET_ELEMENT <Container> <ContainerElement> <Object>.
Reading an object reference
DATA <Object> TYPE SWC_OBJECT.
SWC_GET_ELEMENT <Container> <ContainerElement> <Object>.
SWC_GET_OBJECT_KEY <Object> <ObjectKey>.
SWC_GET_OBJECT_TYPE <Object> <ObjectType>.

67
Business Object Builder
ACTIVITIES :
Writing a multiline object reference
DATA <ObjectList> TYPE SWC_OBJECT OCCURS 0.
DATA <Object> TYPE SWC_OBJECT.
SWC_CREATE_OBJECT <Object> <ObjectType> <ObjectKey>.
APPEND <Object> TO <ObjectList>.
...
SWC_SET_TABLE <Container> <ContainerElement>
<ObjectList>.
Reading a multiline object reference
DATA <ObjectList> TYPE SWC_OBJECT OCCURS 0.
SWC_GET_TABLE <Container> <ContainerElement>
<ObjectList>.

68
Business Object Builder
MACRO INSTRUCTIONS FOR ACCESSING OBJECTS ,
ATTRIBUTES AND METHODS
You can use these macros for simplifying access to Business
Object Repository objects
The include file <OBJECT> must be incorporated into the program
in order to use these macros
You must declare variables in which an object reference is to be
stored with the following instruction:
DATA : <Object> TYPE SWC_OBJECT.

69
Business Object Builder
GENERAL MACROS
SWC_CREATE_OBJECT <Object> <ObjectType> <ObjectKey>.
SWC_REFRESH_OBJECT <Object>.
SWC_GET_OBJECT_TYPE <Object> <ObjectType>.
SWC_GET_OBJECT_KEY <Object> <ObjectType>.
SWC_CALL_METHOD <Object> <Method> <Container>.
SWC_GET_PROPERTY <Object> <Attribute> <AttributeValue>.

SWC_GET_TABLE_PROPERTY <Object> <Attribute>


<AttributeValue>.

70
Business Object Builder
EXECUTING MACROS ON OWN OBJECT
All the macros in the section General macros can also be
executed directly on the object itself in the implementation
program
To do this, you replace <Object> with SELF in the macro calls
e.g.
SWC_GET_PROPERTY SELF <Attribute> <AttributeValue>.
.

71
Business Object Builder
SETTING AN OBJECT KEY
When implementing methods with which an object is created,
the object key must be set
This typically applies to the methods Create and Find
SWC_SET_OBJECTKEY <ObjectKey>.
RAISING EXCEPTIONS
Within the implementation program, you can raise the
exceptions defined for a method
EXIT_RETURN <Exception> <Var1> <Var2> <Var3> <Var4>.

72
Business Object Builder
DATA DECLARATION FOR VARIABLES USED
The system automatically creates an area for the data
declaration for key fields, attributes and method parameters in
the implementation program
This area is between the two macro instructions BEGIN_DATA
OBJECT and END_DATA OBJECT at the beginning of the source
text
The data structure of the object key is between the macro
instructions BEGIN OF KEY and END OF KEY and is created
automatically by the system
The method parameters and attributes are then declared
Since the system obtains the information about the names of the
variables and the field references directly from the definition of
the individual object type components, you cannot make any
changes here

73
Business Object Builder
DATA DECLARATION FOR VARIABLES USED
EXAMPLE
BEGIN_DATA OBJECT. " Do not change.. DATA is generated
* only private members may be inserted into structure private
DATA:
" begin of private,
" to declare private attributes remove comments and
" insert private attributes here ...
" end of private,
BEGIN OF KEY,
MATERIAL LIKE MARA-MATNR,
END OF KEY,
PURCHASEREQUISITION TYPE SWC_OBJECT OCCURS 0,
PURCHASEORDER TYPE SWC_OBJECT OCCURS 0,
PURCHASINGINFO TYPE SWC_OBJECT OCCURS 0,
PURCHOUTLINEAGREEMT TYPE SWC_OBJECT OCCURS 0,
DOCUMENT TYPE SWC_OBJECT OCCURS 0,
COSTESTIMATE TYPE SWC_OBJECT OCCURS 0,
PIECEOFEQUIPMENT TYPE SWC_OBJECT OCCURS 0,
_MAKT LIKE MAKT,
_MARA LIKE MARA.
END_DATA OBJECT. " Do not change.. DATA is generated

74
Business Object Builder
PROGRAMMING ASYNCHRONOUS METHODS
It is programmed between the macro instructions
BEGIN_METHOD
<Method> and END_METHOD
The unique ID of the object is available in the structure of the
key fields under the variable OBJECT-KEY
An asynchronous method can be implemented with a
transaction. The transaction is called in the program with the
ABAP command CALL TRANSACTION

75
Business Object Builder
PROGRAMMING SYNCHRONOUS METHODS
It is programmed between the macro instructions
BEGIN_METHOD <Method> and END_METHOD
The unique ID of the object is available in the structure of the
key fields under the variable OBJECT-KEY
A synchronous method can be implemented with a function
module. The function module is called with the ABAP command
CALL FUNCTION in the program
In the case of synchronous methods, a result and/or the export
parameters can be returned to the caller if you pass the result to
the container CONTAINER within the method
implementation
The result is always put into the container element RESULT. The
result is available in the task container in the container
element _WI_RESULT

76
Business Object Builder
PROGRAMMING EXCEPTIONS
You implement exceptions within a method, that is within the
macro instructions BEGIN_METHOD <Method> and
END_METHOD , using the macro instruction EXIT_RETURN
EXIT_RETURN <Code> <Variable1> <Variable2> <Variable3>
<Variable4>.
You must declare <Code> with the type SWOTINVOKE-CODE
STANDARD EXCEPTIONS
EXIT_OBJECT_NOT_FOUND
EXIT_CANCELLED
EXIT_NOT_IMPLEMENTED
EXIT_PARAMETER_NOT_FOUND

77
Business Object Builder
EXTENDING AND ADAPTING OBJECT TYPES
You can extend an object type to add more object type components
not in the standard version
This ensures that productive workflows and tasks remain executable
in the same manner with the original object type
Process Flow
You cannot change the object types supplied by SAP. If you want
to use one of these object types, but would like to make specific
extensions or adaptations in certain areas, you proceed as follows:
You create a new object type as a subtype of the object type that you want to
extend. For further information, refer to Creating Subtypes. The new object
type inherits the components and their implementation from the supertype.
You modify and add to this object type. You can redefine existing attributes and
methods and create new object type components. For further information,
refer to Maintenance of an Object Type Component.
You make this object type into a delegation type of the supertype. For further
information, refer to Defining Delegation Types.

78
Business Object Builder
EXTENDING AND ADAPTING OBJECT TYPES
DELEGATION TYPE
Object type whose definition is considered at runtime instead of the
definition of another object type, although this other object type is
specified in all definition components (for example task and workflow
definition, linkage tables). In all definition tools you can still refer to the
original object type, but the system uses the definition of the delegation
type for every access.
The delegation type must always be a subtype of the object type it is to
replace. The delegation type can have different or additional methods,
attributes and events.
A delegation type is always defined for an object type on a system-wide
and cross-client basis

79
Business Object Builder
EXTENDING AND ADAPTING OBJECT TYPES
DELEGATION TYPE
Object type whose definition is considered at runtime instead of the
definition of another object type, although this other object type is
specified in all definition components (for example task and workflow
definition, linkage tables). In all definition tools you can still refer to the
original object type, but the system uses the definition of the delegation
type for every access.
The delegation type must always be a subtype of the object type it is to
replace. The delegation type can have different or additional methods,
attributes and events.
A delegation type is always defined for an object type on a system-wide
and cross-client basis

80
Business Object Builder
EXTENDING AND ADAPTING OBJECT TYPES
DEFINING DELEGATION TYPES
Defining a customer-specific delegation type across the system
Choose Settings Delegation System-wide. You are on the screen
Display View "Customizing Object Types": Details.
Select .
Select New entries.
The screen New Entries: Details of Added Entries is displayed.
Enter the ID of the object type for which you want to define a delegation
type. in the field Object type.
Enter the name of a person responsible.
Enter the ID of the subtype for the object type in the field Delegation
type

81
Business Object Builder
EXTENDING AND ADAPTING OBJECT TYPES
DEFINING DELEGATION TYPES
Defining a customer-specific delegation type for a specific frontend
On the screen Business Object Builder: Initial Screen,
enter the ID of an object type as a frontend-specific
delegation type in the field Object/interface type.
You can only specify a frontend-specific delegation for an
object type if you checked "GUI-specific" beforehand for
this object type when maintaining system-wide
delegation.
Choose Settings Delegation Frontend.

82
Tasks and Task Groups

83
Tasks
DEFINITION OF TASK
o You use a Task to define an activity that can be executed
within a workflow definition or independently (as a single
step). This activity can be an SAP System transaction.
o You have to create new tasks as standard tasks .

CREATING A TASK
Choose Tools Business Workflow Development Definition
Tools Tasks/Task Groups Create.
Select the relevant task type.

84
Tasks
SINGLE STEP TASK

Maintain names, work item text, object type and method Tab page Basic data
Maintain agent assignment Additional data Agent
assignment
Maintain
Maintain elements in task container Container
Maintain triggering events Tab page Triggering
events
Maintain terminating events Tab page Terminating
events
Maintain default rules Tab page Default rules
Maintain description and notification texts Tab page Description
Maintain additional data Additional data
Selection
criteria...Additional
data
Classification
Change
Maintain SAPphone properties Tab page SAPphone.

85
Tasks
MULTI STEP TASK

Maintain names, work item text, object type and method Tab page Basic data
Maintain agent assignment Additional data Agent
assignment
Maintain
Maintain elements in task container Container
Maintain triggering events Tab page Triggering
events
Maintain description and notification texts Tab page Description
Maintain additional data Additional data
Selection
criteria...Additional
data
Classification
Change
Maintain SAPphone properties Tab page SAPphone.

86
Tasks

87
CONTAINER
The elements of a container are described with ID, data type reference and
other properties

Types of Container
Method Container
Event Container
Rule Container
Task Container
Workflow Container

Usually containers are already defined. These containers hold standard


container elements defined by the workflow system

88
BINDING
Values can be assigned to container elements in
different ways.
Value assignment using a binding from another container according to a
binding definition carried out previously.
Value assignment directly to a container instance in the program of an
application.
Value assignment with an initial value determined at definition time when
the container instance is created.

At definition time you create binding definitions for the workflow. This
involves specifying the assignment rules for how data is exchanged between
two containers. At runtime these binding definitions are executed making
workflow execution possible

89
BINDING

90
BINDING
Binding Definition from Task Container
You define the bindings from the task container in the
following two places.
In the definition of a task
There are binding definitions to the:
Method container (for import parameters of method)
Rule container (for definition of default rules)
In the step definition in the Workflow Builder
The binding definition to the workflow container.
Binding Definitions to Workflow Container
You define the bindings from the workflow container within
the Workflow Builder. There are binding definitions to the:
Task container (activity, user decision, document from
template, send mail, form step)
Event container (event creator)
Rule container (for definition of responsible agents and
recipients)
91
BINDING
Binding Definition from Method Container
You define the binding from the method container to the task
container (for export parameters of the method with synchronous
methods) during definition of a task.
Binding Definition from the Rule Container
You make the binding definition from the rule container to the
workflow container during the definition of a step.
Binding Definition from Event Container
You define the bindings from the event container in the following
three places.
In the definition of a task for the binding definition to the
task container (for triggering or terminating events of the
task).
In the Workflow Builder in the basic data of a workflow for
the binding definition to the workflow container (for
triggering events of the workflow).
In the Workflow Builder in the definition of a wait step for
the binding definition to the workflow container.
92
Workflow Builder

93
WORKFLOW BUILDER
This is the main WebFlow Engine tool for creating, displaying,
and processing workflow definitions. You can test workflow
definitions and generate operable versions.
The Workflow Builder provides a graphical and an alphanumeric
modeling view and also a tree display of the workflow definition
You can only use the graphical modeling view if you are working
with the SAPGUI for Windows. If you call the Workflow Builder
using a different SAP GUI, the alphanumeric modeling view is
displayed automatically

94
WORKFLOW BUILDER

95
WORKFLOW BUILDER
Workflow
Here you can insert new steps into the workflow definition
and process existing ones. Double-clicking on a step calls
the associated step definition.
Overview
The overview graphic is displayed here. The part of the
workflow graphic displayed in the screen area Workflow is
marked with a green rectangle. Changing the size or
position of the rectangle changes the display in the screen
area Workflow.
Step types
All step types that you can use in the workflow are
displayed here if you are in change mode. You can insert a
new step using Drag&Drop.
Objects
This screen area contains the following:

97
WORKFLOW BUILDER
Workflow container
All workflow container elements are displayed here. You can also define
new container elements and generate a where-used list here. In the
options in the Workflow Builder, you can choose not to display the
workflow system elements here.
My workflows and tasks
Tasks and workflows that are displayed can be inserted into your
workflow definition as activities by double-clicking. The binding between
the task container and the workflow container as well as the other
container elements required is generated automatically by the workflow
system as far as possible. You can also go directly to the relevant
definition. You define which workflows and tasks are displayed here
yourself. For more information, see Business Workflow Explorer.
Document templates
All the workflow's document templates that can be used in steps of the
type document from template are displayed here. You can use a where-
used list to determine the steps in which a document template is used.
Workflow Wizards
All Workflow Wizards that you can use in the definition of your workflow
are displayed here.
Teamworking
Here you can search for steps by selected criteria. The result is displayed
graphically in the workflow area.

98
WORKFLOW BUILDER
Workflows of this definition
Your Workflow Outbox is displayed here, which displays all running
workflows for this definition.

Navigation
The workflow steps are displayed here according to the
workflow definition display. You can go directly to the
relevant step definition from the list.
Messages
All messages generated in where-used lists and
workflow tests are displayed here. Double-clicking on a
message takes you to the relevant step definition.
Information
This displayed which workflow is loaded in which
definition, the status of the respective workflow, and
the version number of this workflow in the original
system

99
WORKFLOW BUILDER
CALLING THE WORKFLOW BUILDER
Direct Start
Tools Business Workflow Development
Definition tools Workflow Builder .
Start from Task Definition
If you start the Workflow Builder from a screen for
processing or displaying a multistep task, choose
Workflow Builder on the tab page Basic Data. The
active version of the workflow definition is loaded. If
there is no active version, the version with the highest
version number is loaded.
To call another version of the workflow definition,
choose Goto Workflow Builder Choose version in
the task definition. This takes you to a dialog box in
which you can choose a version of the workflow
definition.

100
WORKFLOW BUILDER

101
WORKFLOW BUILDER

Maintenance of Activities
At runtime, an activity is represented with a work item of
one of the following types:
Dialog work item if the activity references a task with
dialog.
Background work item if the activity references a task
processed by the system without dialog.
Workflow work item if the activity represents a
workflow.

102
WORKFLOW BUILDER
Maintenance of Mail Transmission
You use this step type to send a mail to different
recipients. You define the text and subject of the mail
when defining the step. You can use variables in the text,
which are filled from the task container at runtime.
This step type replaces the wizard Include "Send mail".
The system creates a task automatically, which sends
the mail. The text to be sent is stored with the task. The
system creates the variables used within the step
definition in the task container and defines a binding
from the workflow container to the task container for
them

103
WORKFLOW BUILDER
Maintenance of User Decision
In a user decision, the recipients receive the task description
together with the possible decision options during execution.
You can use a user decision in the following situations:
Only one of several possible alternatives can be
processed in the workflow from a business point of view at
execution time.
A decision about the progression of the workflow must be
made in dialog with a user.
An instruction (= user decision with only one decision
option) is required to continue the workflow.
For approval and release steps, possibly in connection
with a secondary method (the latter is possible without the
application having to cater for these functions).

104
WORKFLOW BUILDER
Maintenance of Conditions
You use a condition in a workflow definition if:
At execution time, only one of two possible alternatives
can be processed during the workflow, from a business
point of view.
The workflow system can make a decision based on the
contents of the workflow container without user
interaction
The system inserts a step of the type condition into the
workflow definition. The system adds a branch to the
workflow definition for each outcome. To ensure the
consistency of the block structure, all branches created are
brought together before the next step of the workflow
definition

105
WORKFLOW BUILDER
Maintenance of Multiple Conditions
You use a multiple condition in a workflow definition if:
At execution time, only one of several possible alternatives
can be processed during the workflow, from a business
point of view.
The workflow system can make a decision based on the
contents of the workflow container.
The decision can be formulated based on a comparison
between an expression from workflow container and a finite
amount of comparison values (constants, expressions).
The system inserts a step of the type condition into the
workflow definition. The system adds a branch to the
workflow definition for each outcome. To ensure the
consistency of the block structure, all branches created are
brought together before the next step of the workflow
definition

106
WORKFLOW BUILDER
Maintenance of Event Creators
Use an event creator if you want to publish an event from a
workflow. This event can be used as follows:
To start other workflows or tasks.
For this, the event must be entered as a triggering event for
the relevant workflow or task.
As a terminating event of a task.
For internal communication and synchronization

107
WORKFLOW BUILDER
Maintenance of Wait Steps
The following shows possible uses of a wait step in a
workflow definition:
To suspend the entire execution of the workflow until a
defined event has occurred.
To wait for an event in a parallel processing branch,
which renders processing in the other branches
unnecessary

At runtime, a wait step is represented by a wait step work


item

108
WORKFLOW BUILDER

Maintenance of Container Operations


You use a container operation to change a container element
of the workflow container at runtime

Maintenance of Process Controls


You use this step type to complete or cancel other work
items of the current workflow or the workflow itself at runtime

109
WORKFLOW BUILDER
Maintenance of Until Loops
You use an UNTIL loop in a workflow definition if:
At execution time with one of two possible alternatives, the
workflow is to "jump back" to process sections of the
workflow definition again.
The workflow system can make a decision based on the
contents of the workflow container
Maintenance of While Loops
You use the WHILE loop in a workflow definition if:
At execution time, only one of several possible alternatives
can be processed in the workflow from a business point of
view, and then the comparison is to be performed again.
The workflow system can make a decision based on the
contents of the workflow container.
The decision can be formulated based on a comparison
between an expression from workflow container and a finite
amount of comparison values (constants, expressions).
110
WORKFLOW BUILDER
Maintenance of Forks
You use a fork in a workflow definition when the business
process can be continued by several users at the same time.
You can also configure the fork in such a manner that not all
branches have to be processed .

111
Events in Workflow

112
EVENTS

An event is created from any application program and


published system-wide. Any number of receivers can
react to the event
Events that you want to use must be defined as
components of an object type.
Events are published without the creating application
knowing whether a receiver reacts to them. The event
manager checks whether there are active linkages for
the published event

113
EVENTS

An event can be used as follows in SAP Business


Workflow:
As a triggering event of a task or a workflow.
When the event occurs, the task or workflow is started as a
response.
As a terminating event of a task.
When the event occurs, the task is terminated as a response.
In workflow definition steps of the types event creator
and wait for event
If you use events only within SAP Business Workflow,
the linkages required are created automatically by the
workflow system. You can edit existing linkages .

114
EVENTS

EVENT CREATION
Events can be created in following ways :
Function Module like SWE_EVENT_CREATE
Change Documents : Events are created when change
documents are written
General Status Management : Events creation at status changes
Message Control
LIS : Event creation when an exception situation occurs
Business Transaction Events
HR Master Data : Event creation when HR Master data changes
You can used Wizard for Event Creation

115
EVENTS
EVENT CONTAINER
The event container contains the event parameters as
container elements.
If you define triggering events or terminating events for a
task, you can specify the binding from the event container to
the task container.
If you define triggering events for a workflow, you can specify
the binding from the event container to the workflow
container
You define a binding from the workflow container to the event
container in the definition of an event creator.
You define a binding from the event container to the workflow
container in the definition of a wait step.
The event container contains workflow system elements as
standard. You can add more container elements to the event
container within object type definition in the Business Object
Builder

116
EVENTS
USING LINKAGES
A linkage defines the assignment of events to the event
receivers interested in them
The potential receiver of an event must define the linkage.
This can be done using function modules provided or a
maintenance transaction
The workflow system in the form of the event manager
evaluates all the events created. In doing this, the event
manager carries out the following steps:

117
Business Workplace

118
BUSINESS WORKPLACE
Business Workplace is the main interface between an end
user and the Workflow system
All the work items to which a user is assigned are
displayed in users Workflow inbox

You can access the Business Workplace by choosing one


of the following from the SAP Easy Access screen:
Office Workplace,
Tools Business Workflow Development
Runtime tools Business Workplace.

119
BUSINESS WORKPLACE
BUSINESS WORKPLACE SCREEN AREAS
The Business Workplace has three screen areas, which are used in
the following manner by SAP Business Workflow:

120
BUSINESS WORKPLACE
Overview tree

The following workflow functions are available under the Inbox node,
which is under the initial node Workplace:

Workflow
Grouped according to task
Grouped according to content
Grouped according to content type
Grouped according to sort key
Overdue entries
Deadline messages
Incorrect entries

121
BUSINESS WORKPLACE
The following functions are available under the Outbox
node, which is under the initial node Workplace:
Started Workflows
Work items executed by me
Forwarded work items

122
BUSINESS WORKPLACE
WORKLIST
The worklist is displayed in the upper right corner of the Business
Workplace screen. Depending on whether you are in the workflow inbox,
the workflow outbox or the workflow resubmissions, you have various
functions available to you.
Work item preview
In the lower right corner of the Business Workplace screen , the work
items selected in the worklist are displayed in a preview. Not all the
functions of the work item display or the workflow log are available.
Workflow Toolbox
SAP Business Workflow's Workflow Toolbox enables the user to access
workflow functions even during a workflow-driven application transaction.

123
BUSINESS WORKPLACE
WORK ITEM
Definition
Object that represents a task or action in the workflow system at
runtime.
Work items are subdivided into a specific work item type according to their
assignments. The internal processing procedures are controlled via this work
item type.
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

124
BUSINESS WORKPLACE
DIALOG WORK ITEM
o Work item that represents a single-step task at runtime,
which requires interaction with the user.
o When a dialog work item is executed, the underlying object
method of the single-step task is called
o A type W work item is displayed with ready status in the
workflow inbox of the Business Workplace. It is removed from
the integrated inboxes of the other agents when the recipient
reserves, executes, or processes this work item with other
functions.

125
BUSINESS WORKPLACE
WORKFLOW SETTINGS
You use the workflow settings to maintain the special workflow
functions in the Business Workplace.
Personal settings
Display organizational assignment
Refresh organizational environment
Adopt substitution
End substitution
Maintain substitute
Activate substitute
Adopt view
Exit view

126
BUSINESS WORKPLACE
PERSONAL SETTINGS
The personal settings for workflow enable you to adapt the
runtime system to suit your requirements

128
BUSINESS WORKPLACE
ORGANIZATIONAL ASSIGNMENT
You can query this user's organizational assignment
The organizational assignment of a user is buffered and
read at each new logon or once a day (but not each time
the Business Workplace is called).
If the organizational assignment of a user changes while
the user is logged on and must be updated, you choose
Settings Workflow settings Refresh organizational
environment in the Business Workplace.
The following information is displayed for the user logged on:
The name maintained in the user address
The organizational unit
The position the user occupies
The job describing the position
By double-clicking on an entry, you can display the staff
assignments or the job description.

129
BUSINESS WORKPLACE
SUBSTITUTION FOR WORKFLOWS
SAP Business Workflow implements a substitution
arrangement to deal with a user's duties in their absence
The automatic appearance of work items in the substitute's
worklist is dependent on a workflow settings . It is possible to
define which objects can be entered as position-related
substitutes by maintaining table T777E.
Substitution always involves two users:
One user specifies a substitute: User B
The other user (the substitute) 'adopts' the substitution:
User A

130
BUSINESS WORKPLACE
HOW DOES THE SUBSTITUTION WORKS
Substitution works in two ways:
User A adopts substitution for user B and for the duration
of the substitution sees only the work items seen
previously by B in their workflow inbox. User B must have
entered user A as their substitute for a particular period
without activating the substitution. During this period, A
can adopt substitution for B at any time without having to
confer with B.
Instead of their own worklist, user A is displayed user B's
worklist. B's name is in the column Substitution for in the
worklist, as long as this column is included in the current
configuration of B's Business Workplace.

131
BUSINESS WORKPLACE
HOW DOES THE SUBSTITUTION WORKS
Substitution works in two ways:
User A automatically sees not only the work items
previously seen by employee B, but also their own work
items in their Business Workplace. This also applies to all
work items generated for B in the future ("automatic
forwarding").
User B must enter user A as substitute and activate the
substitution. No further action on the part of user A is
required for this kind of substitution.
A can continue working as usual. They see a Business
Workplace to which B's work items are added dynamically.
A can recognize these work items by the fact that B's name
is in the column Substitution for, as long as this column is
included in the current configuration.

132
BUSINESS WORKPLACE
HOW DOES THE SUBSTITUTION WORKS
Substitution works in two ways:
In both cases, user A can perform operations on these "foreign" work
items within the scope of the substitute profile assigned to them by B. It is
irrelevant whether A is assigned to the underlying single-step tasks as a
possible agent.
User B can continue working without any restrictions in both cases.

133
BUSINESS WORKPLACE
MAINTAINING AND ACTIVATING SUBSTITUTES
1. In the Business Workplace, choose Settings Workflow settings
Maintain substitute.
The Maintain substitute dialog box appears.
To facilitate maintenance of the substitution, the Personal
substitutes entry and the positions you occupy are displayed in
the hierarchy on the Maintain substitutes screen.
Personal substitute
A personal substitute can see and execute all your work items,
including those assigned to you via a personal agent
assignment.
You can only specify one other user as a personal substitute.
Position-related substitute
A position-related substitute can only see and execute the work
items you have received on the basis of agent assignment at the
level of position, job or organizational unit.
You can enter another position or a user as a position-related
substitute 134
BUSINESS WORKPLACE
MAINTAINING AND ACTIVATING SUBSTITUTES
2. Position the cursor either on the entry Personal substitutes or on
the relevant position, and select Create substitute.
3. Specify the validity period for the substitution on the detail
screen for substitution. Only within this period can the substitute
adopt the substitution
4. Specify a substitute profile in the dialog box Detail screen
substitution
Select the field Substitution active if applicable.
You must activate the substitution if you want work items to be
visible for the substitute automatically from now on .
6. Save your entries and exit substitute maintenance.

135
BUSINESS WORKPLACE
ACTIVATING SUBSTITUTES
In the Business Workplace, choose Settings Workflow settings
Activate substitute
DEACTIVATING SUBSTITUTES
In the Business Workplace, choose Settings Workflow settings
Activate substitute
The Activate substitute dialog box appears.
Select the substitutes that you want to deactivate, and
choose the function Deactivate
ADOPT SUBSTITUTION
In the Business Workplace, choose Settings Workflow settings Adopt
substitution. The Choose substitution dialog box appears.
Select the user(s) for which you want to adopt substitution.
Exit the dialog box
END SUBSTITUTION
In the Business Workplace, choose Settings Workflow
settings End substitution.
136
BUSINESS WORKPLACE
WORKFLOW INBOX
The worklist of the user currently logged on to the Business
Workplace is displayed in the workflow inbox
VIEWS IN INBOX
A user's worklist can be displayed as an overview or according to the
following grouping criteria:
Grouped according to task
The work items are grouped according to the tasks to which they belong.
Grouped according to content
The work items are grouped according to the object instances to which they belong.

Grouped according to content type


The work items are grouped according to the object types to which they
belong.

137
BUSINESS WORKPLACE
Grouped according to sort key
The work items are grouped according to sort keys

You can also choose from the following views:


Overdue entries
Deadline messages
Incorrect entries

138

You might also like