You are on page 1of 37

0

Tasks

Contents
 Basics for defining a task
 Enhanced components for
defining a task
 Task groups
 Business Workflow Explorer

 SAP AG 1999

© SAP AG BC601 6-1


0.2
Tasks: Unit Objectives

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

 Create a task
 Define the basic components of a task
 Define the enhanced components of a task
 Define and use task groups for structuring
tasks
 Use the Business Workflow Explorer

 SAP AG 1999

© SAP AG BC601 6-2


0.3
Course Overview Diagram (6)

Course Overview Containers

Introduction Routing

Customizing Deadlines

Workflow Definition Events

Business Object Builder Workflow Wizards

6 Tasks Workflow and the Internet

Monitoring and Analysis Appendix


 SAP AG 1999

© SAP AG BC601 6-3


0.4
Tasks: Business Scenario

 You nowknowthat in a workflowonly a task brings


about functionality
 You want to create a newtask (Display material
change document) to fulfill the requirements of
your business process
 You have to knowall the characteristics of your
task to correctly integrate it into your workflow
definition
 Existingtasks are to be grouped intoa task group
 You want to manage tasks using the Business
WorkflowExplorer

 SAPAG1999

© SAP AG BC601 6-4


0.5
Task Types WS and TS

Workflow template
Workflow
Task types:
Definition
Workflow template
(WS)
Tasks
Task (TS)
Organizational
plan

Object type
Attribute Method

SAP functions

 SAP AG 1999

 There are 2 main types of tasks:


Tasks - abbreviation TS, reference one method of an object type and represent one step in the
business process
Workflows - abbreviation WS, represent the business process and consist of a sequence of
individual tasks and control steps
 The following questions have to be asked for a new task:
Who will carry out this work?
What work has to be done?
What should the notification text look like?
Do I need additional flags or settings?
For example, "Terminating events".

© SAP AG BC601 6-5


0.6
Tasks

Task
Standard task
Reference to object
TS
method or
manual activity

Workflow
Workflow template
Reference to WS
workflow definition

 SAP AG 1999

 From an organizational perspective, tasks are the central element in the workflow system.
 Tasks are used to describe a business process. Tasks can be executed one after the other in the
business process. Parallel steps can, however, also be defined.
 Tasks are designed as client-independent and time-independent, reusable modules.
 Tasks are generally executed in the context of a workflow definition.
In exceptional cases, they can also be explicitly triggered without being included in a workflow.
 Like tasks, workflow templates are also client-independent and time-independent.
 You may find workflow tasks (WF) and customer tasks (T ) in your system. They are client-specific
and have a validity period.
Up to and including Release 4.0, WF and T could be created with the same authorizations as WF und
TS.
As of Release 4.5A, when you create new workflows and tasks, the system only offers you WS and
TS.
WF and T are not being further developed.
Existing WF and T are still executable.
 Note: You cannot include customer tasks (T ) in a workflow template.

© SAP AG BC601 6-6


0.7
Example of a Task

Material: My_part Write


change
Old material: Original_part document
New_part Triggers

Event
ZBUS1001.
Organizational plan Old_Material_Changed
Design department WHO?
Designer position ( = Possible
agent)
Holder: Mary

ZBUS1001.Display What?
Task
Attributes and key Work item Display material
and (Confirm end of
of ZBUS1001
long texts processing)

 SAP AG 1999

 First: Assign the method of a business object type to your task.


Entries in the Object type/Methods fields.
 Second: Assign the maximum number of possible agents.
Maintain entry under Additional data -> Agent assignment.
It can concern a group of organizational elements.
Create: Select the task, menu option Agent assignment -> Create, choose and specify the
required organizational object.
The task can also be a general task, that is, every SAP user is a possible agent.
Create: Select the task, button ‘Properties’, flag ‘General task’.
 Third: Define the work item text and the long text of the task.
You can insert variables of the workflow interface that are expanded with current data at
runtime.
Entry in ‘Work item text’ field.
Entry on ‘Description’ tab page.

© SAP AG BC601 6-7


0.8
DefiningaDialogTask:Overview

O rganizational
Standardtask
plan
Ob jecttypewith Whois
What isto
obje ctmethod responsible
execute forthe
thetask? task?

Characteristics
"G eneraltask"
all SAPu sers

Texts Events
Workitemtext:Titleofwork
iteminin bo x TerminatingEvents
L ongtexts: Triggeringevents
D escrip tion Onlyif thetaskisn ot
N otification usedinaw orkflow
M isse dd eadlines
SAPA
G1999

 A task refers to a method of an object type.


 A task has to have possible agents referring to the organizational model or all SAP users (general
task).
 The work item text will show up in the "Description" column of the Business Workplace.
 The task description can be used to inform the user about the work that has to be done.
 If tasks are controlled with simple deadline monitoring, individual message texts have to be defined
for all types of missed deadlines.
 The variable parts of all those texts are automatically replaced at runtime by accessing the attributes
of the processed objects.
 If an asynchronous method call is used for the task, the method does not return confirmation of
completion to the calling system.
The work item is also not completed.
An asynchronous method has to make the notification of completion known using an event.
This event has to be entered as a 'terminating event' for the task.
 Triggering events are only required if the task is to be started independently of the workflow
definition.
Such events can be found in R/3 in error handling of IDOCs, for example.
In customer-specific scenarios, SAP recommends that tasks are always included in workflows, even
if the whole business process could be modeled in a task.

© SAP AG BC601 6-8


© SAP AG BC601 6-9
0.9
Settings for a Task

 Background
 Based on the object method, the task can be flagged as a
background task.
 Confirm end of processing
 During runtime, the user can create an attachment after the
work item has been executed.
 The user explicitly explains that the work item does not have
to be processed any longer.
 SAPphone
 Form (SAPforms indicator)

 SAP AG 1999

 SAPphone Scenario customer service


- A customer service employee wants to call to a customer.
- The workflow dials the telephone number that is linked to the current customer object of the
workflow.
- After the connection is established, the customer service employee can talk to the customer while
viewing the important customer data on the screen.
 SAPphone Scenario customer service
- A customer is calling your enterprise. A telephone service tool asks the customer to enter the
customer contract number.
- The SAP System collects the important customer data and starts a workflow.
- The next available customer service employee starts the work item.
- Their telephone is now connected to the customer and the customer data is displayed on their
screen.
 SAPforms enables occasional users of the R/3 System and the SAPGUI to start workflows and
execute workflow tasks.
For example, a user can fill out a Visual Basic or Outlook form on their PC and then send it to an R/3
System. A workflow is then started in R/3. Conversely, a user can receive a work item in their mail
inbox. If they execute the work item, a form starts. For more information, see the SAPforms
documentation.
SAP Library -> Basis Components -> Business Management -> SAP Business Workflow ->
Reference Documentation -> Form Integration with SAPforms.

© SAP AG BC601 6-10


0.10
Work Item Text

 Work Item Text


 Title of work item in the Business Workplace
 First create the work item text and position the cursor to include a
variable
 Choose the 'Insert variable' icon under the work item text
 The object attributes from the task interface are then available

Example:
Process request from &_WI_Object_ID.CreatedBy&

 SAP AG 1999

 The long texts of tasks use the same concept for variables.
You maintain long texts in the task on the ‘Description’ tab page.
You include variables by choosing ‘Insert -> Expression’.
 Example of a task description for the "Approval step”
Employee &_WI_Object_ID.CreatedBy& created a notification of absence under the number
&_WI_Object_ID.Number& on &_WI_Object_ID.CreateDate&. Decide whether to approve.

© SAP AG BC601 6-11


0.11
Tasks with Terminating Events

 Tasks based on a synchronous method


can have terminating events
 Tasks based on an asynchronous
method must have at least one
terminating event
 The asynchronous method is only Single-step
Single-step
task
started by the workflow system
 The asynchronous method calls
a transaction of an SAP application Asynchronous
Asynchronous Terminating
object
object method
method event
 The application then activates the
terminating event
 The task is ended when the terminating
event is activated

 SAP AG 1999

 The terminating events are published events of the business object type on which the task is based.
 You have to assign terminating events to each asynchronous task. The system recognizes by the
triggering event that the method call is completed.
 Example 1: The asynchronous task "Delete leave request" has to have at least one terminating event,
usually the event "Deleted".
The application triggers the event in the context of the method "Delete leave request" and the
associated work item can be completed.
 Example 2: The synchronous task "Approve application" can have a terminating event. The event
may be an enterprise-wide recruitment freeze.
 Synchronous tasks need terminating events if it is not guaranteed that the processing on which the
work item is based is executed by the workflow system exclusively.
 If a task is to be able to be completed by a business event exclusively, this task has to contain an
asynchronous method.

© SAP AG BC601 6-12


0.12
Terminating Events

 Terminating event Element of the task


container, which refers to
the triggering object type
of the event.
Task container

_WI_Object_Id
_WI_Actual_Agent

Terminating events

Element Object type FORMABSENC


Object type Notification
Notification of
of absence
absence
_WI_Object_ID of Event
Event DELETED Deleted
Deleted
task container ... Element _WI_OBJECT_ID
Element

_WI_OBJECT_ID
_WI_OBJECT_ID
stands
stands for the
for the affected
affected work
work item
item
at runtime
at runtime
 SAP AG 1999

 A terminating event applies to one instance of a task only, that is, to one specific work item. The key
of the work item, therefore, has to be given to the terminating event.
 Example:
A head of department has four work items for leave request.
They have the work item numbers 1, 2, 3, 4.
The person making request number 3 deletes their request. The work item in the inbox is then no
longer needed and has to be deleted.
The terminating event "Request deleted" now has to be generated for work item 3.
The object reference is given to the terminating event for this purpose.
 The object reference for a task is always in the variable _WI_OBJECT_ID.
 A terminating event for a task is, therefore, specified as follows:
Object type for which the event is defined
Name of event
Container element _WI_OBJECT_ID

© SAP AG BC601 6-13


0.13
Task with Synchronous Method

 The task is completed


when the method returns
final confirmation
to the workflow system Terminating
Task
event
 The task is also completed
if the application
triggers the terminating event
Synchronous
Synchronous
object
object method
method
 Synchronous tasks can
have export parameters and results
parameters.
Data exchange occurs
in both directions.

 SAP AG 1999

 Since a synchronous method can return values to the calling system, synchronous methods can have
export parameters or results parameters.
 Example of results parameters:
The method ‘Approve leave request’ is to be completed with ‘Approved’ (A), ‘Rejected’ (R) and
‘New’ (N).
The values A, R and N are stored as fixed values in a domain.
The relevant value is transferred to the workflow in a special attribute.
 The definition of results parameters can be exemplified using the method ‘Approve notification of
absence’ (Formabsenc.Approve).
General definition: Results parameter flag set
Under Result type, you find the reference field for the respective value (= PROCSTATE) and the
reference table SWXFORMAB.
In the ABAP Dictionary, the field PROCSTATE is of the field type SWX_PROCST. This field type
is assigned a domain SWX_PROCST. The domain contains the fixed values A, R, N.
 If you incorporate a task that links to a method with results parameters into a workflow definition,
the Workflow Builder automatically generates outcomes corresponding to the defined fixed values.
 If a task is to be able to be completed by a business event exclusively, this task has to contain an
asynchronous method.

© SAP AG BC601 6-14


0.14
Object Type: Notification of Absence

Object type FORMABSENC

Key fields

Number
Number Number
Attributes

ApprovDate
ApprovDate Approval date
ApprovBy
ApprovBy Approved by
CreateDate
CreateDate Creation date
CreatedBy
CreatedBy Created by
Methods

Display
Display Display notification of absence Dialog Synchronous
Create
Create Create notification of absence Dialog Synchronous
Delete
Delete Delete notification of absence Asynchronous
Update
Update Update notification of absence Dialog Synchronous
Approve
Approve Approve notification of absence Dialog Synchronous Result

Events

Created
Created Notification of absence created
Deleted
Deleted Notification of absence deleted
 SAP AG 1999

 The object type “notification of absence” (FORMABSENC) is used as an example demonstrating the
attributes, methods, and events above.

© SAP AG BC601 6-15


0.15
Standard Task: Approve Notification of Absence

AF_approve

Object type FORMABSENC Notification of absence


Object method Approve Synchronous method; Method with dialog
Definition in task _WI_Result is created automatically
container
Relationship Position: Head of department
Terminating events Not applicable

Characteristics Confirm completion of processing

Work item text “Approve notification of absence from &”


Assign container elements Use &_WI_Object_Id.CreatedBy&

Long text

 SAP AG 1999

 A results parameter is defined for the method APPROVE. The results parameter refers to a result
type that references a table field (PROCSTATE in SWXFORMABS).
From the entries in the dictionary, it becomes clear that the result type refers to fixed values of the
domain SWX_PROCST. The fixed values are A (Approved), R (Rejected) and N (New).
If the method APPROVE is incorporated in a workflow step, the system always generates possible
outcomes for the 3 values automatically.

© SAP AG BC601 6-16


0.16
Standard Task: Delete Notification of Absence

AF_delete

Object type FORMABSENC Notification of absence


Object method Delete Asynchronous method
Definition in task container Not necessary

Relationship Not applicable

Terminating events Event: DELETED (Notification of absence deleted)


Container element _WI_OBJECT_ID

Characteristics Background processing

Work item text Not applicable


Assign container elements
Long text Not applicable

 SAP AG 1999

 Example of a background task.


There are no possible agents for this task and no agents are selected in the workflow step.
 Example of an asynchronous method. The existing work item is automatically completed if the event
‘Deleted’ is triggered in the system. The event has to refer to the object on which the work item is
based.
The object is specified in the element _WI_OBJECT_ID.

© SAP AG BC601 6-17


0.17
Integrating a Task in a Workflow

Call the Workflow Builder. "Activity" step type in a


Choose the ‘Activity’ step type. workflow

 In the workflow step, enter


... refers to a task
 A task abbreviation or
Activity 1
 A workflow abbreviation
 Specify names for the outcomes of the
step
(How does the task/workflow end)
Multiple outcomes
 Ensure binding for data exchange between
task container and workflow container
... refers to a workflow
 Define agents
 Draw up a deadline escalation when Activity 2
required

Multiple outcomes
 SAP AG 1999

 A step in a workflow can refer to an activity.


An activity with a single triangle links to a task
An activity with three triangles links to a workflow (the associated workflow is called a
"subworkflow")
 The binding defines the data exchange between the different containers in a workflow.
Every time you integrate a task into a workflow, you have to make sure that the correct data is
transported into the task container when the work item is started and back to the workflow
container when the work item is completed.
 You determine the work item recipients for this step in the section "Agents".
If they can execute the underlying tasks, these recipients receive the work item in their
Workplace.
On the "Notification" tab page, you can specify a recipient who receives a message when the
step is completed. The notification text is defined in the underlying task.
 There are two main deadline escalation procedures, “simple” and “modeled” deadlines.
You can define special recipients for the “simple” deadlines.

© SAP AG BC601 6-18


0.18
Task Groups

Task group 1

Workflow template 1 Only standard objects


...
(workflow templates
Workflow template n and standard tasks)
Standard task 1
...
Standard task n

Task group 2 It is possible to have


task groups within
Workflow template 1 task groups
...
Workflow template m

Standard task 1
...
Standard task m

Task group 3
 SAP AG 1999

 Logically connected tasks are grouped together in task groups. Note also that task groups can have a
description text. The use of the task group can therefore be precisely documented.
 Hence, it is possible, for example, to:
 Place workflow templates that only communicate with each other using events together in a task
group. As a result, you obtain a better overview.
 Bundle tasks (workflow templates and standard tasks) that belong to one work area in order to
increase reusability.
 Task groups are also useful for defining the search range for the Business Workflow Explorer. The
Business Workflow Explorer can then display the tasks in these task groups.
 Important note: Task groups can only contain the task types 'workflow template' and 'standard task'.
Workflow tasks and customer tasks are no longer supported.

© SAP AG BC601 6-19


0.19
Task Groups: Inheritance

Task group 1 USSCHMIDTPA (Patrick Smith)

Workflow template x
Forwards
Forwards to
to
USSCHMIDTPA (Patrick Smith) agent
agent
assigned
assigned
Standard task x USSCHMIDTPA
USSCHMIDTPA
USSCHMIDTPA (Patrick Smith)

Task group 2 USSCHMIDTPA (Patrick Smith)

Workflow template y

USSCHMIDTPA (Patrick Smith) Forwards


Forwards to
to
agent
agent
Standard task y assigned
assigned
USSCHMIDTPA
USSCHMIDTPA
USSCHMIDTPA (Patrick Smith)

Task group 3 USSCHMIDTPA (Patrick Smith)

 SAP AG 1999

 Tasks pass on their characteristics to the collected tasks and task groups.
 This inheritance also continues through any assigned task groups. As shown in the graphic, the tasks
in a task group also inherit the characteristics of the task group highest in the hierarchy.
 With very extensive inheritance hierarchies, undesired agent assignments can be made if an
organizational object is assigned to the highest task group. Therefore, ensure that the change of
responsibility for the task group is also desired for the assigned tasks and task groups.

© SAP AG BC601 6-20


0.20
BusinessWorkflowExplorer

Onemediumformanagingtasksandworkflows
Functionsavailableinclude...
Create
Change
Display
Copy
Agentassignment
Andsoon.
Nohelpvalu esreq uired.Allrelevanttasks
aredisplayeddirectly.

SAPAG1999

 The Business Workflow Explorer facilitates the management of workflow projects. All tasks can be
assigned to a task group. The relevant employees incorporate this task group into the search range of
the Business Workflow Explorer.
 The functions mentioned here can always be accessed from context menus (right mouse button). The
following functions are also possible:
 Display current workflows of task
 Quick overview of most important task attributes
 The Business Workflow Explorer always uses a defined search area. This area can be defined
interactively by the user. Note, however, that calling the Business Workflow Explorer takes longer
than accessing the largest chosen search range since all tasks have to be imported with their
attributes. Therefore, ensure that the chosen search range is not unnecessarily large.
 Parts of the Business Workflow Explorer can be used within the Workflow Builder.

© SAP AG BC601 6-21


0.21
Business Workflow Explorer: Use

Business Workflow Explorer


Task Edit Goto View System Help

Query

Task Abbreviation Name Task Abbreviation Name

All tasks for notifications of absence WS9990003 Notification of absence (productive)


Available objects
Multistep tasks TS9990003 Create notification of absence
WS9990000 Notification of absence (test) TS9990007 Approve notification of absence

WS9990003 Notification of absence (productive) TS9990012 Display notification of absence


TS9990003 Create notification of absence TS9990015 Delete notification of absence
TS9990007 Approve notification of absence
TS9990012 Display notification of absence
TS9990015 Delete notification of absence
Single-step tasks
All single-step tasks
TS9990003 Create notification of absence are displayed
TS9990007 Approve notification of absence
TS9990012 Display notification of absence
TS9990015 Delete notification of absence

Multistep tasks: All single-


step and multistep tasks
are displayed

 SAP AG 1999

 The search range of the Business Workflow Explorer can be defined with the following objects:
- Task groups
This is the preferred option since granularity is optimized. In principle, every workflow modeler
can create one or more task groups to organize their tasks.
Application components
This key is not a very precise sort key and is probably not relevant for customer projects.
- Other
SAPphone tasks
Tasks suitable for telephone integration (inbound calls and/or outbound calls).
Local objects
All local tasks in the system. Only your own local tasks (user-specific).
 The tasks used in a workflow definition can be displayed in more detail by choosing 'View->Details'.
The Explorer then displays more information about the tasks in additional columns (object type,
method, agent assignment, background task, and so on.).
 If you click on a multistep task in the left-hand tree, the most recent (and not the active) version is
read and displayed in detail in the right-hand tree.

© SAP AG BC601 6-22


0.22
Tasks: Unit Summary

 Two types of tasks: Single-


step tasks and workflows
 Single-step tasks refer to object
methods
 Workflows refer to single-step tasks
and/or other workflows
 Single-step tasks that are:
 synchronous: can have terminating events
 asynchronous: must have (at least one)
terminating event(s)
 You can create and maintain Task Groups
 You are now familiar with the Business
Workflow Explorer
 SAP AG 1999

© SAP AG BC601 6-23


Exercises

Unit: Tasks
Topic: Basics for Task Definition

At the conclusion of these exercises, you will be able to:


 Define standard tasks

Standard tasks are based on the methods of object types. These tasks can
be used as stand alone 'single-step tasks' or as steps in a workflow
definition.

1-1 Familiarize yourself with the different tasks in the SAP workflow concept.

1-1-1 List all the task types that you can create by default in Release 4.6, along
with their abbreviation and their usage method:
_________________________________________________________
_________________________________________________________
_________________________________________________________

1-1-2 Check the standard task 'AF_approve'.


What is the number of this task? __________________
Which object type method is used as a basis for this task?
___________________________________________

What is the shortest way to display that object type? _____________


What is the key field of that object type? ______________________
Check the "possible agents" of this task.
_________________________________________________________
_________________________________________________________
_________________________________________________________

© SAP AG BC601 6-24


What is the work item text of this task?
_________________________________________________________

How do you find the task description?


_________________________________________________________

1-2 Define the two tasks as standard tasks. Do not enter a work item text yet.

1-2-1 Create the first task.


In the "Task type" field, select the option "Standard task".
Abbr: "Z##_TS_1"
Name: "Change documents for material, group ##".
Object type: "Y##MARA"
Method: "Display_Changes"
Use the input help to find this entry.
Make a note of your task number: _________

You may be prompted to specify a development class. Enter the


development class Z001, and create a new Change request with the
title Group ##, do not transport. (## is your assigned group
number.)

Define the task as a "general" task.


Exit the window.

1-2-2 Create a second task.


In the "Task type" field, select "Standard task".
Abbr: "Z##_TS_2"
Name: "Display material master, group ##".
Object type: "Y##MARA"
Method: "Display"
Use the input help to find this entry.
Make a note of your task number: _________
Define the task as a "general" task.
Exit the window.

1-3 Test your two tasks "Change documents for material" and "Display material
master".
© SAP AG BC601 6-25
1-3-1 Update the organizational buffer.

Enter TS and the number of your "Change documents for material" task, for
example, "50012901".

Provide input data by choosing Task  Input data.

In the "Initialize Container" dialog box, use the input help in the "Value"
field to enter your material T-BBD##.

Go back and start the task "Change documents with material".

Repeat the test with the task "Display material master".


Do not forget to specify the material in the input data.

1-4 You have demonstrated the tasks to your users and they have asked for some
enhancements. They would like the completion of the task to be explicitly
confirmed and would like to add some meaning to the message text in the worklist.
Adjust the task "Change documents for material" to the user requirements.

1-4-1 Select "Confirm end of processing".


This changes the runtime behavior of the work item for this task.

1-4-2 Change the work item text for the task "Change documents for material".
The work item text appears in the worklist of the recipients.
On the "Basic data" tab page, enter your text, for example "Display changes
of material" in the "Work item text" field.
Position your cursor after "material" and insert the material number variable
by choosing the "Insert variables" button.
In the "Please Choose an Expression" dialog box, click on the plus sign next
to the object type "Y##MARA" (may also be displayed as
BUS1001_Groupnr_## or _WI_OBJECT_ID).
Double-click the "Material" field.
The work item text now contains the value
&_WI_OBJECT_ID.MATERIAL& after "material".
Save your task.
(Note: The & sign is a placeholder for the variable.)

Make sure that there is at least one space before the first '&' sign and one
space after the second '&' sign.

© SAP AG BC601 6-26


1-4-3 Create a task description for the task "Change documents for material".
This will send special help information to the recipient of this work item at
runtime.
Enter your text, for example, "Display changes of requested material …",
and insert the parameter value &_WI_OBJECT_ID.MATERIAL& after the
word "material".

Again, make sure that there is at least one space before the first '&' sign and
one space after the second '&' sign.

1-4-4 Save the task "Change documents for material" again.

1-4-5 Test your task again. Open another session and go to the Business
Workplace.
Write down your work item text:
________________________________________________

The task description of your work item is displayed in the lower part of the
screen. Afterwards end that session.
To complete this work item, click on the "Complete processing of step"
button in the "This Work Item Has To Be Completed Explicitly" dialog box.
Why was this additional dialog box displayed?
________________________________________________

1-5 Change your workflow.

1-5-1 Insert your task "Change documents for material" as the new first step in
your workflow.
Call the Workflow Builder.
Your workflow template is displayed.
Integrate the task directly after the step "Workflow started".
Accept the question about the workflow <-> task container binding. This
point will be covered later.
As the agent of this step, choose the "expression" &_WF_INITIATOR&.

On the "Outcomes" tab page for "Step executed", enter a text, for example
"Change documents displayed".
Exit the screen and activate your workflow again.

© SAP AG BC601 6-27


1-5-2 Change the task "Change documents for material" again.
Up to now, your workflow has been defined without import parameters. But
the task you have just inserted into the workflow requires an import. For test
purposes, you can specify an initial value.
Display your task z##_TS_1 and create an initial value in it. Use the F4
Help for the "Expression" and enter your material number in the
"BUS1001_Groupnr_##" window.
Exit the window and save your task again.

1-5-3 Test your workflow.


Why did the workflow not require you to enter a material?
1-6 Enter your tasks in your task group Z##_AG.

© SAP AG BC601 6-28


Solutions

Unit: Tasks
Topic: Basics for Task Definition

1-1 Familiarize yourself with the different tasks in the SAP workflow concept.
1-1-1 List all the task types that you can create by default in Release 4.6, along
with their abbreviation and their usage methods.
SAP EASY ACCESS -> Tools  Business Workflow  Development 
Definition Tools  Tasks/Task Groups.
Double-click "Create".
Choose the F4 Help for the "Task type" field:
TS Standard task, stand-alone or as a step in a workflow
WS Workflow template, stand-alone or as a subworkflow
TG Task group

1-1-2 Check the standard task "AF_approve".

SAP EASY ACCESS  Tools  Business Workflow  Development 


Definition Tools  Tasks/Task Groups.
On the “Task: Display” screen, enter the following information:

Field Name Input Data

Task type Standard task

Task AF_approve

Choose the "Display" button.

On the "Standard task" dialog box, double-click AF_approve.

What is the number of this task? 30000016.


Which object type method is used as a basis for this task?
FORMABSENC.APPROVE

© SAP AG BC601 6-29


What is the shortest way to display that object type?
Double-click on the object type.

What is the key field of that object type?

On the "Display Object Type ....." screen,

click on the plus sign next to "Key fields".


AbsenceForm.Number
Check the "possible agents" of this task.
Choose the "Back" button to return to the "Standard Task: Display"
screen.
On the "Standard Task: Display" screen, choose
Additional data  Agent assignment  Display.

What is the work item text of this task?


On the "Basic data" tab page, the work item text is displayed in the
"Work item text" field.

How do you find the task description?


On the "Standard Task: Display" screen, choose the "Description" tab
page.
The task description is displayed if you select the option "Task
description" in the "Text type" field.
Return to the SAP Easy Access menu by selecting the "Back" button
(green arrow).

1-2 Define the two tasks as standard tasks. Do not enter a work item text yet.

1-2-1 Create the first task.


In the SAP Easy Access menu, double-click "Create" in the "Tasks/Task
Groups" folder.
On the “Task: Maintain” screen, enter the following information:

Field Name Input Data

Task type Standard task

Task Blank

© SAP AG BC601 6-30


Choose the "Create" button.
On the "Basic data" tab page, enter the following information:

Field Name Input Data

Abbr: Z##_TS_1

Name Change documents for material,


group ##

Object type Y##MARA

Method Display_Changes

Choose the “Save” button.

You may be prompted to specify a development class. Enter the


development class Z001, and create a new Change request with the
title Group ##, do not transport. (## is your assigned group
number.)

Make a note of your task number: _________


Define the task as a "general" task by choosing:
Additional data  Agent assignment  Maintain.

Position your cursor on the task highlighted in light green and choose:

Edit  Attributes..., or the "Attributes" button.

In the "Task:..." window, select "General task" and choose the


"Transfer" button.

Exit the window and save your task again.

1-2-2 Create a second task.


In the SAP Easy Access menu, double-click "Create" in the "Tasks/Task
Groups" folder.
On the “Task: Maintain” screen, enter the following information:

© SAP AG BC601 6-31


Field Name Input Data

Task type Standard task

Task Blank
Choose the "Create" button.
On the "Basic data" tab page, enter the following information:

Field Name Input Data

Abbr: Z##_TS_2

Name Display material master, group ##

Object type Y##MARA

Method Display

Choose the “Save” button.

Answer "Yes" to the prompt "Transfer missing elements from the object
method?".

You may be prompted to specify a development class. Enter the


development class Z001, and create a new Change request with the
title Group ##, do not transport. (## is your assigned group
number.)

Make a note of your task number: _________


Define the task as a "general" task by choosing:
Additional data  Agent assignment  Maintain.

Position your cursor on the task highlighted in light green and choose:

Edit  Attributes..., or the "Attributes" button.

In the "Task:..." window, select "General task" and choose the


"Transfer" button.

Exit the window and save your task again.

© SAP AG BC601 6-32


1-3 Test your two tasks.
First test "Change documents for material".
In the SAP Easy Access menu, choose Tools -> Business Workflow ->
Development -> Runtime Tools.
Double-click "Start Workflow (Test Environment)".
On the "Start Workflow (Test Environment)" screen, execute the following steps.

Field Name Input Data

Task Blank

Press the "F4" key to start the search.

On the "Search and Find: Tasks" screen, enter your group number, for example
Z20*, and choose the "Find" button.

A list of all corresponding tasks is displayed. Transfer your standard task


"Change documents for material" by double-clicking on it.

Update the organizational buffer.


On the "Start Workflow (Test Environment)" screen, choose:
Environment  Refresh organizational environment, or the "Refresh
organizational environment" button.

Provide input data by choosing Task  Input data (or the "Input data" button).
In the "Initialize Container" dialog box, use the input help to enter your material T-
BBD##.

Choose "Back" and start the task by choosing:


Task  Execute, or the "Execute" button.
On the "View Selection" screen, choose "Basic data 1", followed by the
"Continue Enter" button.
The changes of material T-BBD## are displayed.

Repeat this procedure with the task "Display material master".

© SAP AG BC601 6-33


1-4 You have demonstrated the tasks to your users and they have asked for some
enhancements. They would like the completion of the task to be explicitly
confirmed and would like to add some meaning to the message text in the worklist.
Adjust the task "Change documents for material" to the user requirements.

In the SAP Easy Access menu, choose Tools -> Business Workflow ->
Development -> Definition Tools -> Tasks/Task Groups.
Double-click "Change".
On the "Task: Maintain" screen, enter your task number and choose Task ->
Change, or the "Change" button.

1-4-1 In the "Execution" frame, set the "Confirm end of processing" flag. This
changes the runtime behavior of the work item for this task.

1-4-2 Change the work item text. The work item text appears in the recipient's
worklist.
On the "Basic data" tab page, enter your text, for example "Group##:
Display changes of material", in the "Work item text" field.
Position your cursor after the word "material" and choose the "Insert
variables" button.
In the "Please Choose an Expression" dialog box, choose the "Switch
display: Technical name/Description" button to display the description of
the expression.
Click on the plus sign next to your object type. It is displayed as
Y##MARA or as BUS1001_Groupnr_## or it is after _WI__OBJECT_ID.
Double-click the "Material" field.
The value &_WI_OBJECT_ID.MATERIAL& has been inserted after your
work item text "Display changes of material".
(Note: The & sign is a placeholder for the variable.)

Make sure that there is at least one space before the first '&' sign and one
space after the second '&' sign.

1-4-3 Create a task description for the task "Display changes".


This sends special help information to the agent of this work item at
runtime.
On the "Standard Task: Change" screen, choose the "Description" tab
page.
Choose "Task description" as the task type and click the "Change text"
button.

© SAP AG BC601 6-34


Enter your text, for example "Display changes for requested material...".
Position the cursor after "material" and choose:
Insert  Expression.
Click on the plus sign next to your object type Y##MARA (displayed as
BUS1001_Group_##).
Double-click the "Material" field.
The parameter value &_WI_OBJECT_ID.MATERIAL& has been
inserted after your description text.
Choose the "Back" button to return to the "Standard Task: Change"
screen.

Again, make sure that there is at least one space before the first '&' sign and
one space after the second '&' sign.

1-4-4 Save the task again by choosing:


Standard task  Save, or the "Save" button.

1.4.5 Test the task "Change documents for material" again. Open another session
and go to the Business Workplace.
Write down your work item text:
________________________________________________

The task description of your work item is displayed in the lower part of the
screen. Afterwards end that session.
To complete this work item, click on the "Complete processing of step"
button in the "This Work Item Has To Be Completed Explicitly" dialog box.
Why was this additional dialog box displayed?
You have set the "Confirm end of processing" flag.

Return to the SAP Easy Access menu by choosing the "Back" button
(green arrow).

1-5 Change your workflow.

1-5-1 Insert your task "Display changes" as the new first step into your workflow.
In the SAP Easy Access menu , choose:
Tools -> Business Workflow -> Development -> Definition Tools ->
Workflow Builder.
Your workflow template is displayed.
On the "Workflow Builder - Change" screen, select the event "Workflow
started".

© SAP AG BC601 6-35


Then choose Edit  Create, or the "Create" button.
Choose the "Activity" button and enter your task number, for example
"TS 50012901", in the "Task" field.

As the responsible agent of this step, choose the "expression"


&_WF_INITIATOR&.
In the "Agent" field, select the workflow initiator using the F4 Help.

On the "Outcomes" tab page, enter a text for "Step executed".


On the "Workflow Builder - Create Step: Activity" screen, choose the
"Outcomes" tab page.
If prompted, accept the check question about the workflow<-> task
container binding by choosing the "Continue Enter" button. This point
will be covered later.

Enter the following information:

Field Names

Outcome Name

Input Data Step executed Changes displayed

Exit the screen and activate your workflow again.


On the "Workflow Builder - Change" screen, choose the "Generate and
activate runtime version" button (match symbol).

1-5-2 Change the task "Display changes" again.


Up to now, your workflow has been defined without import parameters.
But the task you have just inserted into the workflow requires an import.
For test purposes, we specify an initial value.
Call the task Z##_TS_1:
In the Workflow Builder, click on the step "Display changes", which
contains the task for displaying change documents.

Double-click on the task ID, for example TS99600056, to go to the


standard task.
On the "Standard Task: Change" screen, choose Goto  Assign initial
values.
Use the F4 Help for "Expression" and enter your material number T-
BBD## in the " BUS1001_Groupnr_## " window.

© SAP AG BC601 6-36


Exit the window and save your task again.

Return to the basic screen of the Workflow Builder.

1-5-3 Test your workflow.


In the Workflow Builder, choose the "Test" icon, which takes you to the
workflow test environment.
The number of your workflow template has been entered automatically.

Choose the "Start workflow" button.


The change documents for your material are displayed.
Exit the material display by choosing the "Back" button.

Why did the workflow not require you to enter a material?

The material number was already provided as an initial value at the task
level.

1-6 Enter your tasks in your task group.

Path: Tools -> Business Workflow -> Development -> Definition Tools ->
Tasks/Task Groups.

Double-click "Change".

Task type: Task Group

Choose the "Change" button.

Search for the task group with the abbreviation: Z##_AG

Choose the "Standard tasks" tab page and specify your standard tasks using the
F4 Help.

Save your task group.

© SAP AG BC601 6-37

You might also like