Exp 0009
Exp 0009
Routing
Contents
Roles
Restricting possible agents
Definition with responsibilities
Ad Hoc workflow and agent
assignment
Role resolution and binding
SAP AG 1999
SAP AG 1999
Introduction Routing 9
Customizing Deadlines
SAPAG1999
SAPAG
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.
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
SAP AG 1999
Role: Possible
Possible agents:
agents:
Restriction of possible agents Group of all
Group of all
according to organizational model managers
managers
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 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.
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
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 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
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 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.
Org. Result of
Org. unit
unit Person
Person role resolution
Job
Job Position
Position
User
User
SAP AG 1999
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 1999
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 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"
4.
1.
2. Select one
or more
agents
3.
Copy selection
Start test
SAP AG 1999
Change agent
Consequence: The work item is immediately removed from the workflow inbox of the current agent
1. Select the work item from the outbox of the workflow inbox
2. Change agent
SAP AG 1999
This is the first of two options for changing the agent at runtime.
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 1999
Unit: Routing
Topic: Creating Role Resolution Using Responsibilities
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.
Test the successful case (material group 001), and the error case (material
group not 001)
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.
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.
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.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.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?
_____________________________________________________________
_____________________________________________________________
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
1.4 Return to the screen "Standard Role: Change", and enter your organizational unit
ZWF_ORG_## as the agent.
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-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 EASY ACCESS -> Tools -> Business Workflow -> Development ->
Runtime Tools -> Start Workflow (Test Environment)
Caution: Set the material group in the material master to the correct test
value.
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:
Abbr: z##_chooseag
Method Display_Changes
In the “Choose agent type” dialog box, select User, then choose the “Continue
Enter” button.
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.
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
Abbr: WS##_Sel_Ag
Select the undefined step and choose Wizards -> “Include Choose agent”'
In the screen "Workflow Builder - Create", choose the “Generate and activate
runtime version” icon, followed by the “Test” icon.
In the Initialize Container dialog box, use the input help and enter the material
in the “Material” field.
SAP EASY ACCESS -> Tools -> Business Workflow -> Development ->
Definition Tools -> Tasks/Task Groups -> Copy
1.11 Delete the agent assignment for each dialog step in the copied workflow.
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.
In the Workflow Builder basic screen, choose the “Generate and activate runtime
version” icon
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”.
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”.