0% found this document useful (0 votes)
46 views41 pages

Exp 0009

Sap workflow 9

Uploaded by

Monica Paez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views41 pages

Exp 0009

Sap workflow 9

Uploaded by

Monica Paez
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 41

0

Routing

Contents

 Roles
 Restricting possible agents
 Definition with responsibilities
 Ad Hoc workflow and agent
assignment
 Role resolution and binding

 SAP AG 1999

© SAP AG BC601 9-1


0.2
Routing: Unit Objectives

At the conclusion of this unit, you will be able to:


 Designate responsible agents
 Use roles

 SAP AG 1999

© SAP AG BC601 9-2


0.3
Course Overview Diagram (9)

Course Overview Containers

Introduction Routing 9

Customizing Deadlines

Workflow Definition Events

Business Object Builder Workflow Wizards

Tasks Workflow and the Internet

Monitoring and Analysis Appendix


 SAP AG 1999

© SAP AG BC601 9-3


0.4
Routing: Business Scenario

 In the ‘material’ business process you want


to restrict the number of possible
agents in order to obtain those users that are
responsible for this step according to
runtime data.

 SAPAG1999
 SAPAG

© SAP AG BC601 9-4


0.5
Workflow Step: Agent Assignment Options

Process Organization
workflow definition Business
Org. unit Workplace
Job
Worklist
Position
Prio Tasks Date
User ID
1 Approve Form Mar 1
Responsibility 2 Post Invoice Mar 25
Role 3 Post Invoice Apr 5
function

Previous
workflow
Your worklist can display
agents: all work items for which
you are a recipient

 SAP AG 1999

 Using the agents in the workflow step, and the possible agents for the task, the runtime system
determines the current valid agent for the workflow step.
 All responsible agents, who are also possible agents for the task, will become recipients of the work
item.
 The workflow system only enters this work item once in the work item list.
 All recipients can view this work item by refreshing their worklist.
 You have the option to make fixed agent assignments. These include
- Members of organizational units
- Owners of positions
- Owners of positions who have inherited tasks from job assignment
- SAP users
 They can refer to variables (output) of the workflow container.
For example, you can save the agent for the 1st workflow step in a variable of the workflow
container and enter this variable in the 5th step of the workflow as the agent for that step.
 Another possibility are agents who are found dynamically at runtime using a role.
According to runtime entries that are transferred into the role container, a role function module
determines responsible users, for example, the superior of the workflow initiator.

© SAP AG BC601 9-5


0.6
Role Definition

 Role types can be


 Responsibilities

 Data from the workflow container is assigned to agents


 No ABAP Code, just configuration

 Organizational data
 SAP Organizational Object Types are used to assign
agents
 No ABAP Code, just configuration

 Function module
 ABAP Code
You are free to develop every function module you need

 SAP AG 1999

 There are 3 different role types.


Two of these only require system settings, the third variant requires a customer-specific function
module to be stored in R/3.
 Organizational data:
Roles using organizational data require an SAP organizational object type in the system.
Table T7791 contains the SAP organizational object type and the information about which object
types can be linked to them.
Within the object type processed by the workflow, one element must refer to this SAP organizational
object type.
The SAP organizational object type is linked to agents through organizational units, positions or
jobs.
For more information, see the appendix of this file or the workflow documentation, key word
"Organizational object"
 Responsibilities:
From Release 4.0 onwards, you can define roles using responsibilities.
In the workflow container, you store variables that are filled with values at runtime.
You also store value ranges for these variables and assign agents to the different values.
 Developing customer-specific function modules for role resolution is the topic of course BC610.

© SAP AG BC601 9-6


0.7
Options for Defining a Role

With SAP Without SAP


Organizational Structure Organizational Structure
- Particular groups - Fixed user assignment
or positions - Role with responsibilties
- SAP role, for example, Manager for user
- Responsibilities Workflow container element,
for example, workflow initiator
- SAP Org. Objects or last agent
- BBP Manager - SAP Office distribution list
Ad Hoc Selection - New step for the free
- New step for the free selection of the next
selection of the next recipient
recipient - Own ABAP function with
customer tables or SAP tables
- Own ABAP programs
with evaluation path
or self-created
function

 SAP AG 1999

 During implementation the self-defined ABAP solutions take the longest.


The roles based on responsibility can be implemented within minutes.
 In general, role definitions with fixed agent assignment are not recommended.
This is because the agent assignment does not change automatically if an employee in the enterprise
takes over a new task, and is no longer available for the task assigned in the workflow.
 From Release 4.0 onwards, roles can generally be defined by responsibilty instead of by SAP
organizational objects. Roles by responsibilties are more flexible and easier to use.

© SAP AG BC601 9-7


0.8
Example 1: Role "Superior ..."

 Role: Possible
Possible agents:
agents:
Restriction of possible agents Group of all
Group of all
according to organizational model managers
managers

 Standard Task (Definition):


Approve notification of absence
 Linked to job: Head of department

 Role (agent): Superior...

 Parameter for role: Employee Responsible


Responsible agent:
agent:
 Work item (activity at runtime):
Approve notification of absence 4712
Employee: Marcus Adams
Evaluation of organizational plan
Superior: David Boss

 SAP AG 1999

 The role “Superior...” can be used to route a notification of absence to the responsible superior.
 In this case, Adams wants to go on vacation and only David Boss should receive this work item.
No other possible agents should receive this notification of absence.

© SAP AG BC601 9-8


0.9
Example 2: Role "Invoice Verification Clerk ..."

 Role: Customer names Invoice verification clerk


Restriction of possible agents A-G
according to organizational model

 Possible Agents of Task:


Post document
Linked to job:
Invoice verification clerk

 Role: “Find invoice verification clerk”


2 Parameters: Customer
- Customer name names
- Invoiced amount H-N
Customer names
 Work item (activity at runtime): O-Z
Post document 4712
Customer - Manley Corp. Invoiced amount: < $ 50,000
Invoiced amount - $ 258,300
Invoiced amount: > $ 50,000
 SAP AG 1999

 Example of how role resolution could be used in an “invoice verification” workflow.


 Design requirements -
 All clerks working in this unit are assigned to a special customer group. At runtime they should
only receive invoices from those customers.
 Each clerk has a pre-defined personal transaction limit. If the invoice is above this limit, this clerk
is not allowed to process the invoice.
 Runtime -
 The two import parameters for the role resolution (“Manley Corp.” and $ 258,300), determine that
the work item should be sent to the three agents circled in red.
 Only those three recipients will receive this work item in their worklist.
The first user to execute the work item at runtime will block access to this work item. No other
user can access it. The work item will actually disappear from the worklist of the other two
users, when they refresh their worklist.
After the "first agent" has completed the work item, it will disappear automatically from their
worklist after the next refresh.

© SAP AG BC601 9-9


0.10
Customer-Specific Role for Material Controller

 Material Master changed by Schmid


Material: My_part Change documents
Old material: Original_part
New_part
Cr
ea Design department
te CAD engineer position
ZBUS1001.
d Owner: Schmid Possible Old_Material_Changed
by Product management agents
department
Product manager position
Task
Owner: Jones
Display material
Material Controller Position Selected
Owner: Meier Role:
agents
Find Controller
Import parameters

 SAP AG 1999

 Acceptance for this example of a business process:The creator of the material master basic view is
considered to be the material controller.
 Design-Procedure for the Material Controller Role:
 First - Assign the possible agents to the task.
 Second - Create a role that returns the controller for a given material. You will probably have to
create this role yourself:
Copy an existing role function module (ABAP-program).
Change this program to find the creator of the imported material master.
 Third - Assign this role to your step definition and provide the import parameter. If you use the task
stand alone, you can assign the role directly to the task.
 During runtime this role resolution will return a special user ID. This user becomes a recipient if he
or she is also a possible agent for this task.

© SAP AG BC601 9-10


0.11
Creating a Distribution List

 Business Workplace
 Shared folders - right mouse button
 Create new subfolder
Name: WF_Verteiler
 Button: Distribution lists
 Create button:
Name: WF_VLISTE
Title: Any title
Folder: WF_Verteiler
 Tab page distribution list content
- Enter recipient (SAP user ID)
 Save

 SAP AG 1999

© SAP AG BC601 9-11


0.12
Role Resolution With Distribution List

 Workflow Builder
 Process dialog step
 Agent assignment:
- Role 30000012 (swx_read_dli)
 Binding: WF_VLISTE
(Enter name of distribution list as constant)
 Activate workflow

 Start workflow
 Check work item recipient

 SAP AG 1999

© SAP AG BC601 9-12


0.13
Role Definition With Responsibilities: Background

 Why do we need this type of role?


 The applicaton often requires the assigment of
responsibilities to business objects, such as, for example,
"who is responsible for material group xy"?
 What is a role of this type?
 A role that does not have to be programmed (!)
 Just configuration, no ABAP code
 How are these roles defined?
 Definition of role parameters (container)
 Responsibilities (positions, organizational units, users, etc.)
can be defined for values or value ranges of the parameter

 SAP AG 1999

 This type of role can help the application to solve problems, such as finding the person responsible
for a material, without separate tables and role function modules.
 An assigment table is evaluated for role resolution, in which the various instances of the role
parameters are assigned to objects of organizational management (jobs, positions, users,
organizational units).
 If you create a role of this type, you must:
 Maintain the elements in the role container
 Maintain the responsibility for each possible value/value interval of the role parameter(s) in the
assignment table
 Assign responsible agents to the values/value intervals
 Advantages of role definition with reponsibilities:
 If an organizational object is deleted, the roles of this type are also updated
 Where-used lists for organizational objects also find these roles
 No ABAP programming is required

© SAP AG BC601 9-13


0.14
Role Definition With Responsibilities: Example

Reponsible for
Employee names A - K

Bern Thom
Dreier

Class
Mr Smith Ms Jones
Peters Adams
Position: Schulz Position:
Administrator Lynn Administrator
2 in HR dept. 1 in HR dept.
Rost
Kerner

Dreier
Andrews Zylink
Reponsible for

Employee names L - Z
 SAP AG 1999

 The two administrators are responsible for employee queries in a medium-sized business:
 Mr. Smith for employees from A to K,
 Ms Jones for employees from L to Z.

© SAP AG BC601 9-14


0.15
Role Definition With Responsibilities: Introduction

Role container definition (basis for comparison)


Container element Data type Name

Element Char 1 First letter of surname

Area of responsibility first letter of surname


Value from Value to Name

A K Employees from A to K Mr Smith

L Z Employees from L to Z Ms Jones

Which value Which agent

 SAP AG 1999

 To create a role with responsibilites, you must make the following entries.
 1. Role container
The first letter of the surname is transferred at runtime, so here you are creating an element that is
character long.
 2. The areas that can be assigned to agents must be defined.
In this case, the areas are "Employees from A to K" and "Employees from L to Z".
 3. The area "Employees from A to K" is defined by the interval into which the values must fall at
runtime, in order to belong to this area of responsibility.
Likewise for area "Employees from L to Z".
 4. Finally, the persons responsible are assigned: Use the "Insert agent assignment" button.
 What happens at runtime:
The role just defined is called, and receives a value for "element".
If the current value is between A and K, Mr Smith is the selected agent. If the current value is
between L and Z, Ms Jones is the selected agent.

© SAP AG BC601 9-15


0.16
Role Resolution and Binding

Role parameters (runtime)


Role parameters (definition) "Input "
Role container
Parameter1 Binding
Binding from
from task
task
Parameter2 container or workflow
container or workflow
... container
container

Role resolution Master


Master data
data
Organizational
Organizational plan
plan
Function module for Customizing
Customizing data
data
role resolution “Rules”

Org. Result of
Org. unit
unit Person
Person role resolution
Job
Job Position
Position
User
User
 SAP AG 1999

 SAP provides standard roles.


 To find these roles, see
SAP EASY ACCESS -> Tools -> Business Workflow -> Development -> Definition Tools ->
Standard Roles.
 You can display all the standard roles using the input help (F4).
 A role is identified by a unique name.
A role container is defined for each role. The role parameters establish which information is required
for the role resolution to be executed at runtime.
 If an error occurs during role resolution, the termination flag setting for role resolution will
determine how the workflow continues:
Flag is selected - the workflow will stop and a message is sent to the workflow administrator.
Flag not selected - the workflow will route this work item to ALL possible agents.

© SAP AG BC601 9-16


0.17
Select Recipient at Runtime

Workflow Definition
Task
displays
list Task
Select Container:
of
recipient Import: Workflow
possible
for next step TaskID TS500000xy Container
agents
Task Export:
of
TS30200146 SelectedObjectList Agent_list
TS500000xy
on the
screen.
Recipient
Next Responsible agent
chooses
dialog step Expression:
valid
Task Agent_list
agents
TS500000xy
as
selected
object list

 SAP AG 1999

 Your workflow is very dynamic, and in some steps the responsible agent cannot be determined at the
design stage. Within the workflow, however, each user knows who will execute the next step.
 You can use the task TS30200146 to enable manual selection of the responsible agent for one of the
following steps. This task generates an on-screen list of the possible agents for the subsequent task.
 At runtime, the user who executes the work item for the first step may choose from the list of
possible agents for task TS500000xy.
 All those manually selected responsible agents are transferred to the agent list for the next step.
 The work item of the next step is now available for all users who have a connection to the elements
of the agent list.
 Until Release 4.5, the task for the subsequent step (“TS500000xy”) may not be defined as a general
task.
 Using the wizard "Select agent", you can enter the dispatcher task TS30200146 into your workflow
definition, as well as the subsequent task.
 In Releases before 4.5 this wizard does not exist, and you should use task TS30200141.
With this task you can only select one agent.

© SAP AG BC601 9-17


0.18
Ad Hoc Workflow Functions

 Standard functions in the workflow inbox


 Add attachment
 Forward work item
 Send mail
 Change work item priority
 Delete work item deadline
 Configurable options
 Either the workflow initiator alone can enter new agents, or
 An additional workflow step allows somebody to
determine the next agent ad hoc

 SAP AG 1999

 Order of development steps in the Workflow Builder:


- Specific Workflow Design: Ad hoc steps can only have possible agents
- Menu option: Extras - Ad hoc functions - Enable ad hoc agent assignment
- Menu option: Extras - Ad hoc functions - Test ad hoc agent assignment

© SAP AG BC601 9-18


0.19
Developing Ad Hoc Workflows

3. Finally, activate 1. First assign all possible users to each dialog step
the workflow

2. For all ad hoc steps, do not assign an agent in the activity definition
 SAP AG 1999

 You can develop a workflow very quickly with the use of task groups.
 After the workflow has been activated, call the function:
Extras - Ad hoc functions - Enable ad hoc agent assignment.

© SAP AG BC601 9-19


0.20
Ad Hoc: Workflow Container Elements

The menu option


Extras - Ad hoc functions - Allow ad hoc agent assignment
generated the AGENT_00xy container elements, and correspondingly assigned the
agent definitions in the activities with no agents.

 SAP AG 1999

 The menu option "Extras - Ad hoc functions - Enable ad hoc agent assignment"
has also changed the workflow basic type:
See the "Technical Information" tab page in the workflow basic data.
Menu: Workflow Builder - Goto - Basic data
Tab page: Technical information
-> Type of workflow definition: "Ad hoc"
 Note: Ad hoc workflow agent assignment will only work with this ad hoc definition type.
 Finally, reactivate the workflow.
 Next configuration step: "Extras - Ad hoc functions - Test ad hoc agent assignment"

© SAP AG BC601 9-20


0.21
Ad Hoc: Test Agent Assignment
SAP enables you to select
from all possible
Find agents of the task
agents

4.

1.
2. Select one
or more
agents

3.
Copy selection

Start test
 SAP AG 1999

 The workflow developer tests the ad hoc functions.

© SAP AG BC601 9-21


0.22
Change Ad Hoc Agent in Test
1st option :
Change the agent for the current work item after the start of the workflow instance

Change agent

2nd option for changing the agent:


- First find and select
- Then save
 SAP AG 1999

 Consequence: The work item is immediately removed from the workflow inbox of the current agent

© SAP AG BC601 9-22


0.23
Ad Hoc Agent for Several Steps

1. Select the work item from the outbox of the workflow inbox
2. Change agent

3. Enter agent for all


ad hoc steps not
yet completed

 SAP AG 1999

 This is the first of two options for changing the agent at runtime.

© SAP AG BC601 9-23


0.24
Ad Hoc: Workflow Step
Task TS70007966 from task group TG70000003

Notes: 1. Do not forget the agent assignment for this task.


2. The binding for this task remains undefined
 SAP AG 1999

 This is the second option for changing the agent at runtime.


 At runtime, the recipient of this work item can select the agents for all ad hoc steps in the workflow
that have not yet been completed.
 Note:
Changing an ad hoc agent has immediate effect.
If user "A" is processing an ad hoc-compatible work item,
and user "B" changes the ad hoc user of the work item from user "A" to user "C",
the work item is immediately taken away from user "A", even if he is working
on it at the time.
User "C" then sees the work item in his or her inbox.

© SAP AG BC601 9-24


0.25
Selection Procedure for Work Item Recipient

First: Second:
Find possible agents
Evaluate the Step
(For a general task every
Role Resolution
user is a possible agent)

Third: Fourth:
Evaluate the task Delete all excluded
standard role, if agents from the
no step role exists recipient list
If a user is determined by the
role and is also a possible
agent, this user is
a recipient
If a user is determined by the
role and is not a possible
agent, all possible agents
receive the work item
 SAP AG 1999

 Only recipients who are still on the list after the fourth step can execute a work item.
 Most common error situation:
The dialog task has no possible agents assigned to it (this means that there can never be a recipient).
You have to assign possible agents to all dialog tasks, even to those in workflow templates.
 If no agent assignment is entered in the workflow step, the system checks whether a default role is
saved in the workflow step task.
The default role is on the "default roles" tab page in the task definition.
SAP EASY ACCESS -> Tools -> Business Workflow -> Development -> Definition Tools ->
Tasks/Task Groups

© SAP AG BC601 9-25


0.26
Routing Variants
 Variant 1
Possible agents for the task: Position 1
Agents in the workflow step: Miller (Position 1) + Jones (Position 2)
----> Miller receives a work item
 Variant 2
Possible agents for the task: General task
Agents in the workflow step: Miller + Jones
----> Miller + Jones receive a work item
 Variant 3
Possible agents for the task: Position 1
Agents in the workflow step: Smith + Bern (Position 3)
----> All employees in position 1 receive a work item
 Variant 4
Possible agents for the task: General task
The role in the workflow step does not determine an agent
"Terminate if role resolution has no result" flag set: Workflow error
"Terminate if role resolution has no result" flag not set: All users receive work item
 Variant 5
Possible agents for the task: Organizational unit 1
No agent assignment is specified in the workflow step
----> All employees in organizational unit 1 receive a work item
 SAP AG 1999

© SAP AG BC601 9-26


0.27
Routing: Unit Summary

 Roles are used for finding the


responsible agents
 During runtime the role resolution
will determine one or more
responsible agent(s) for a work
item
 Some roles are supplied by SAP
 You can create your own roles
 Roles definition using
- SAP organizational objects
- Responsibilities

 SAP AG 1999

© SAP AG BC601 9-27


Exercises

Unit: Routing
Topic: Creating Role Resolution Using Responsibilities

At the conclusion of this exercise, you will be able to:


 Define a role resolution using responsibility

This procedure will enable you to create a role resolution based on your
own requirements, without writing ABAP code.
By assigning responsibilities to specific field values, you can use a role to
map those responsibilities to your organizational chart.
In this scenario we assume that particular people are responsible for
material groups. If a material is changed, the role will find who is
responsible for that material group and notify them of the change.

1-1 Create a standard role “ZMat_group##”, and specify the role type as Responsibility. The
role should terminate if no agent can be found.

1-2 Create container entries with ABAP Dictionary field proposals for the table name MARA,
field MATKL. Use the default element name “Material Group”.

1-3 Define a responsibility and assign a name for this responsibility, such as “Matl_grp_001”.
The material group should be 001.

1-4 Define the organizational unit ZWF_ORG_## as the agent for the responsibility.

1-5 Simulate the role for test purposes.

1-6 Update your workflow definition with this new role:


1-6-1 Call the Workflow Builder with your workflow template for the material master
zwf_test1_##.

© SAP AG BC601 9-28


1-6-2 Select the step ”Display material master”, and change the responsible agent in
“Role assignment”.'

1-6-3 Enter your role number, for example 99100131.

1-6-4 Next, accept the current binding.


Finally, change the binding to integrate the material group for your object (the
material group of your object type Y##MARA) into the binding.

1.6.5 Activate your workflow.


1.6.6 Test your workflow. To do this, log on as user “WF-BC-MGR'” (password
Welcome), and start your workflow in the test environment.
In the first step, the change documents are displayed to the workflow initiator,
WF_BC_MGR.
The work item of the second step is routed to BC601-MGR## and BC601-##.
Check the Business Workplace inbox for both users.

Caution: Remember to set the material group in your test material


appropriately for testing the role resolution.

Test the successful case (material group 001), and the error case (material
group not 001)

© SAP AG BC601 9-29


Unit: Routing (Additional exercise 1)
Topic: Choose Selected User at Runtime

At the conclusion of this exercise, you will be able to:


 Create a task with an agent list
 Define a workflow to route a work item to an agent selected from a list
during runtime

Your workflow is very dynamic, and in some steps the recipient cannot
be determined at the design stage. Within the workflow, however, each
user knows who will execute the next step.

1-1 Create a standard task that has a specific agent list.


Assume we are working with a task that displays the changes to a material (Task:
z##_choosag, Description and work item text: Dynamic agent selection, Method:
Display_Changes, Object type: Y##MARA).
There are three users on the list of possible agents: BC601-##, BC601-MGR##, and
WF-BC_MGR.
Remember to refresh the index in the agent assignment.

1.2 Create a workflow "WS##_SEL_AGENT".


Go to the Workflow Builder, and use a Wizard to include the “Choose agent”
function at runtime.
In the “Enter task” screen, enter the number of the task z##_chooseag.
Enter "Agent chosen at runtime/Display change documents" as the title of the
selection window.
Set the flag “Several agents can be selected”.

1.3 Activate and test your workflow

Execute the first step. This will provide a list of possible agents for the following
step. Select one or more agents, and the work item will be routed to them.

© SAP AG BC601 9-30


Unit: Routing (Additional exercise 2)
Topic: Ad Hoc Workflow Functions

 At the conclusion of this exercise, you will be able to


include ad hoc agent assignment
in your workflow template

Until now you have created and tested a workflow with fixed role
assignment. Now you want to make sending the work item at runtime
more flexible. The SAP Workflow development environment provides the
ad hoc functions for doing this.

1.1 Make a copy of your material display workflow.


Name your new workflow “Z_Ad_Hoc_##”.

1.2 Start the Workflow Builder and open your


Z_Ad_Hoc_## workflow in change mode.
Process all the dialog steps in your workflow, and delete the agent assignment for
each one.

1.3 Also change the possible agents of the corresponding single-step tasks.
Deactivate the assignment “general tasks”,
and enter four user IDs as possible agents. Use your
own IDs and those of your neighboring group.

1.4 Now call the ad hoc function in the Workflow Builder that prepares the dialog steps
in the workflow for ad hoc processing.
What has changed in your workflow after doing this?
_____________________________________________________________
_____________________________________________________________
_____________________________________________________________

1.5 Activate your workflow.

1.6 Insert a new step for the single-step task TS70007966


at the beginning of your workflow.
Define the workflow initiator as agent.
The binding for this task remains undefined.

© SAP AG BC601 9-31


1.7 Activate and test your workflow

1.8 Change the possible agents for your dialog tasks for material display. These tasks
should now be redefined as “general tasks”.

1.9 Test your workflow again after you have refreshed the organizational environment.
Has the runtime procedure changed?
_____________________________________________________________
_____________________________________________________________

© SAP AG BC601 9-32


Solutions

Unit: Routing
Topic: Role Resolution Using Responsibilities

1.1 Create a standard role “ZMat_group##”, and specify the role type as Responsibility.

Menu path: Tools -> Business Workflow ->Development -> Definition Tools
->Standard Roles ->Create, Icon “Create“

Basic data:
Abbreviation: ZMat_group##
Name: Material Group ##
Role definition:
Role Type: Responsibilities
Set the flag “Terminate if role resolution has no result”'
1.2 You want to query the material group in the role.
To do this, you need to create an entry for the element “Material group” in the
container.
Tab page “Container”
Icon “Insert container element”
Answer the question "Create with ABAP Dictionary field proposals?" with Yes.
Enter “MARA” as the underlying table
Select MATKL, Button “Continue”, Button “Create”
Back in the screen “Standard Role: Add”,
save the data, and save the role in the development class z001.

1.3 In the next step, you define the variants that should be in the responsibility,
meaning which agents have which different material group values

Click on the “Responsibilities” tab page


Icon “Create responsibility”

Object abbreviation: Matl_grp_001'


Name: Material group 001 ##
Enter

Screen "Responsibility Change for Standard role"

Name: Material group


Of: 001 To: 001
© SAP AG BC601 9-33
Save the responsibility.

1.4 Return to the screen "Standard Role: Change", and enter your organizational unit
ZWF_ORG_## as the agent.

Position the cursor on "Material group 001 ##".


Icon "Insert agent assignment"

Double click "Organizational unit".


Search term: Your organizational unit zwf_org_##
Choose “Create”'

1.5 You can simulate the role for test purposes.

Choose the icon "Simulate role resolution" in the upper part of the screen, or use
Shift+F8

Enter 001 as the input value for the material group in the “Role container for
runtime”, and choose “Continue”

Your organizational unit should be displayed as the result of the role resolution

1.6 Update your workflow

1-6-1 Open the Workflow Builder and display your workflow for processing the
material master.
If it is not automatically displayed, choose the menu options:
Workflow – Other workflow/version, and enter the number of your
workflow template from zwf_test1_##, or find it using the input help.
Go to the change mode
Double-click the step “Display material master”

1-6-2 In the screen "Workflow Builder: Change step: Activity": Make sure
that you are on the “Control” tab page.
Select “Role” from the pulldown menu in the “Agents” frame.

1-6-3 Enter your role number in the field next to “Role”, e.g. 99100131.

1-6-4 The input parameter for the role must be the material group of the object.
In the “Binding Responsibility for..” window, use the input help (F4) and
select the “Material group” attribute from your object type.
1-6-5 Leave the window and re-activate your workflow by selecting the “Generate
and activate runtime version” button.

© SAP AG BC601 9-34


1-6-6 Log on as user “WF-BC-MGR” (password Welcome), and start your
workflow in the test environment

Caution: Remember to adjust the material group in your material master


according to the role resolution.

SAP EASY ACCESS -> Tools -> Business Workflow -> Development ->
Runtime Tools -> Start Workflow (Test Environment)

Afterwards, check the inboxes for BC601-MGR## and BC601-##.


Both inboxes contain a reference to the same work item for displaying
change documents

Caution: Set the material group in the material master to the correct test
value.

© SAP AG BC601 9-35


Unit: Routing (Additional exercise 1)
Topic: Choose Selected User at Runtime

1-1 Create a single step task that has a specific agent list.
Assume we are working with a task that displays the changes to a material (Task:
z##_choosag, description and work item text: Dynamic agent selection, method:
Display_Changes, Object type: Y##MARA).
There are three users on the list of possible agents: BC601-##, BC601-MGR##, and
WF-BC_MGR.
In the SAP Easy Access menu, choose:
Tools  Business Workflow  Development  Definition Tools  Tasks/Task
Groups.
Double-click "Create".
On the "Task: Maintain" screen, enter the following information:

Field Name Input Data

Task type Standard task

Choose Task Create, or choose the “Create” button.

On the "Basic data" tab page, enter the following information:

Field Name Input Data

Abbr: z##_chooseag

Name Dynamic agent selection

Object type Y##mara

Method Display_Changes

Save the standard tasks.

Choose Additional data  Agent assignment  Maintain.

© SAP AG BC601 9-36


Position the cursor on the line with your task name, and choose Agent
assignment -> Create

In the “Choose agent type” dialog box, select User, then choose the “Continue
Enter” button.

Assign the appropriate users in the “Choose User” dialog box.


Repeat the process until all three users have been assigned.

To generate the new index, position the cursor on the task name and choose the
“Refresh index” icon

When all users have been assigned and the index has been refreshed, return to
the “Standard Task: Create” screen.

Choose the “Save” button.

Choose the "Back" button to return to the "Task: Maintain" screen.

1-2 Create the workflow WS##_SEL_AGENT. Use the Wizard to integrate the
“Choose agent” function at runtime.
Choose
SAP EASY ACCESS -> Tools -> Business Workflow -> Development ->
Definition Tools -> Tasks/Task Groups -> Create

On the "Task: Maintain" screen, enter the following information:

Field Name Input Data

Task type Workflow template

Choose Task Create, or choose the “Create” button.

On the “Basic data” tab page, enter the following information:

© SAP AG BC601 9-37


Field Name Input Data

Abbr: WS##_Sel_Ag

Name Dynamic agent selection

Start the Workflow Builder

Select the undefined step and choose Wizards -> “Include Choose agent”'

Read the description on the “Start” screen.'

Choose the button “Continue”

Follow the instructions in the wizard

In the “Specify task” screen, enter TSxxxxxxxx of task z##_chooseag .

Choose the button “Continue”

Enter "Agent chosen at runtime/Display change documents" as the title of the


selection dialog box.

Set the flag “Several agents can be selected”.

Choose the button “Continue”

Choose the button "Complete"

1-3 Activate and test your workflow


Execute the first step. This will provide a list of possible agents for the following
step. Select one or more agents, and a work item will be routed to them.

In the screen "Workflow Builder - Create", choose the “Generate and activate
runtime version” icon, followed by the “Test” icon.

In the “Start Workflow (Test Environment)” screen, choose the “Refresh


organizational environment” button.

Choose the “Input data” button.

In the Initialize Container dialog box, use the input help and enter the material
in the “Material” field.

Use, for example, T-BDD## where ## is your group number.

© SAP AG BC601 9-38


Unit: Routing (Additional exercise 2)
Topic: Ad Hoc Workflow Functions

1.10 Make a copy of your material display workflow


Name your new workflow “Z_Ad_Hoc_##”.

SAP EASY ACCESS -> Tools -> Business Workflow -> Development ->
Definition Tools -> Tasks/Task Groups -> Copy

Select your workflow template.


Menu: Task – Copy
Name your new workflow “Z_Ad_Hoc_##”.
Save your workflow.

1.11 Delete the agent assignment for each dialog step in the copied workflow.

SAP EASY ACCESS - Tools - Business Workflow - Development – Definition


Tools - Workflow-Builder

Use the menu option: Workflow – Other workflow/version


to open your Z_Ad_Hoc_## Workflow

Then go to the change mode.

Double click each dialog step.


In the “Agents” section, delete the contents of each field to the right of
Expression/User.

1.12 Change the possible agents of the corresponding single-step tasks.


Deactivate the assignment “general tasks”,
and enter four user IDs as possible agents.

Double-click each dialog step in the Workflow Builder.


You can go directly to the agent assignment of the task.
In the “Task properties” box, choose the icon “Agent assignment”.
Select the task title.
Using the “Attributes” button, delete the “General Tasks” flag and use the menu
option “Agent assignment - Create” to assign four agents.

© SAP AG BC601 9-39


1.13 Now call the ad hoc function in the Workflow Builder that prepares the dialog steps
in the workflow for ad hoc processing.
What has changed in your workflow after doing this?

In the Workflow Builder, choose the menu option Extras - Ad hoc functions –
Enable ad hoc agent assignment

Change: Each step that had no agent now has an entry under “Agents”. These
are the variables &AGENT_0001.Agents& and &AGENT_0002.Agents&.
These variables have been created by the system in the workflow container.

1.14 Activate your workflow

In the Workflow Builder basic screen, choose the “Generate and activate runtime
version” icon

1.15 Insert a new step for the single-step task TS70007966


at the beginning of your workflow.
Define the workflow initiator as agent.
The binding for this task remains undefined.

In the Workflow Builder basic screen, select the event "Workflow started".
Choose the “Create” icon.
Double-click to choose “Activity”, and enter the task TS70007966 in the
workflow step displayed.
In the “Agents” section, select “Workflow initiator”.

1.16 Activate and test your workflow

In the Workflow Builder basic screen, choose the “Generate and activate runtime
version” icon
Choose the “Test” icon

The workflow initiator can now select the desired agents for the tasks with ad hoc
agent assignment at the start.

1.17 Change the possible agents for your dialog tasks for material display. These tasks
should now be redefined as “general tasks”.

Double-click each dialog step in the Workflow Builder.


You can go directly to the agent assignment of the task.
In the “Task properties” box, choose the icon “Agent assignment”.
Select the task title.
Choose the “Attributes” button, and set the “General task” flag

© SAP AG BC601 9-40


1.18 Test your workflow again after you have refreshed the organizational environment.
Has the runtime procedure changed?

The workflow initiator can now enter one or more agents.

© SAP AG BC601 9-41

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy