0% found this document useful (0 votes)
89 views27 pages

Exp 0008

SAP Workflow 8

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)
89 views27 pages

Exp 0008

SAP Workflow 8

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/ 27

0

Containers

Contents:

 Containers
 Container bindings

 SAP AG 1999

© SAP AG BC601 8-1


0.2
Containers: Unit Objectives

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

 Create a workflow container element


 Create a task container element
 Understand and check container bindings
 Create container bindings by demand

 SAP AG 1999
 SAP AG

© SAP AG BC601 8-2


0.3
C
o
ur
seO
ve
r
vi
ewD
i
agr
am(
8)

C
o
ur
seO
ve
r
vi
ew C
o
nt
ai
ner
s 8

I
ntr
odu
ct
i
on R
o
ut
i
ng

C
u
st
omi
zin
g D
e
ad
li
nes

W
o
rk
f
lo
wDe
f
in
it
i
on E
v
en
ts

B
u
si
nes
sOb
j
ect
B u
i
lde
r W
o
rk
f
lo
wWi
zar
ds

T
as
ks W
o
rk
f
lo
wa
nd
th
eI
nte
rn
et

M
o
ni
tor
i
nga
nd
An
al
ysi
s A
p
pe
nd
i
x

SA
PA
G1
99
9

© SAP AG BC601 8-3


0.4
Containers: Business Scenario

 The ‘material’ business process you want to support


with workflowhas dialog steps
 Information passed into a task is imported at the
beginning of the workflowor produced by prior steps
 You want to knowhowdata is stored in containers
and can be used in later steps

 SAPAG1999
 SAPAG

© SAP AG BC601 8-4


0.5
Changing Workflow Material Master - Container

A change to the material master triggers


event "old_material_changed" Data transferred to event container
Material object: P-100
Last changed by: User Jones
starts
Workflow: Process change to material master data
Event container
Jones =_EVT_CREATOR
P-100 = _EVT_OBJECT

Task1 Container task1 Workflow container


Display change Material master:
documents _WI_OBJECT_ID Material master
ZBUS1001
Method container

Task2 Container task2


Display material Material master:
master _WI_OBJECT_ID

Role container
Org. object _WF_INITIATOR
 SAP AG 1999

 User Jones changes the material master P-100 and therefore triggers the event
‘old_material_changed’.
The event triggers the workflow "Change material master".
 In the event container, the object reference and the person who triggered the event are transferred
from the event.
The variable for the person who triggered the event is _EVT_CREATOR, the variable for the object
reference is _EVT_OBJECT.
 Both values are transferred from the event container into the workflow container.
The person who triggered the event becomes the workflow initiator (_WF_INITIATOR).
The object reference variable depends on the object used.
 The workflow container variables are available throughout the workflow runtime.
 The task containers are created from the workflow container.
Caution: The task containers do not know your variables
Each task container must be provided from the workflow container.
 In each task container there is a variable _WI_OBJECT_ID for the object reference.
The task recognizes the object reference, because the object type must be specified when defining
the task.
 The changed material master flows from container to container as follows:
First it is an event object, then it is stored as ZBUS1001 in the workflow container, and from there
enters the different task containers.

© SAP AG BC601 8-5


0.6
Binding

 Question at definition time:


What data has to be
 Definition of modeling and
transferred to support the
assignment rules which are
process?
implemented at runtime for
 Transferring data from
one container to another
container Workflow Task
container container
 Assigning (initial) values
to some container
elements
 Runtime
 Binding definition is executed at
runtime
 This means data is moved
from one container to
another

 SAP AG 1999

 Binding definition - Definition of modeling and assignment rules introduced at runtime for
- Transferring the data from one container to another container
- Assigning values to container elements.
 The workflow container is on the left hand side in the Workflow Builder.
 When defining the tasks, choose the "Container" button for the task definition.
 The binding definition is always executed with reference to the elements of a container. This means
that an expression is assigned to the container element or the container element is assigned to an
expression.
 At definition time the system automatically generates a proposal for the required bindings.
Each binding generated must be checked for correctness.
 When entering the task, choose the "Binding" buttton to find the binding between the workflow and
task containers in the workflow step.
For the binding to the role container, choose the button "Binding" in the box "Agent".
In the workflow basic screen, the binding from the event to the workflow container is on the
"Triggering events" tab page.

© SAP AG BC601 8-6


0.7
Container: Definition/Runtime

 Table-like data structure used for


 Field values
 Object references Runtime: Object reference to object type
in accordance with data type reference

Element Description Data type reference Value


Object type Table field
Form Notification of
absence FORMABSENC
Agent Agent in WFSYST-AGENT
workflow

Data type reference to field Runtime: Value has data type


in ABAP Dictionary in accordance with
data type reference
Data type reference to object type
in Object Repository
Definition Runtime
 SAP AG 1999

 Containers are table-like data structures.


 Containers are exclusively used for accepting attribute values, constants, and object references for
control and monitoring, for the workflow process and the execution of work items.
 Container definitions are created by the workflow system as standard.
The tasks and methods used in the workflow are the basis for the defined fields.
 As a customer, you can enhance container definitions at any time.
In the Workflow Builder, you can process the container definition using the context menu.
 Container definition in the workflow:
- Description of elements to be stored in the container, with element name,
description, and data type reference
- The description can refer to a field in the ABAP Dictionary, to an object type,
or can represent any field with a known data type
 Container instance
- Table-like runtime structure from the container definition.
- The name of an element is entered in a line together with its value.
- The data type of this value must agree with the data type reference established at definition.

© SAP AG BC601 8-7


0.8
Processing Binding in the Workflow Builder

WS30000015: Binding in workflow step "Approve notification of absence"

Display of all possible variables


using "Show lines"

Task
Task Workflow
Workflow

Standard screen in change mode

 SAP AG 1999

 The upper part of the screen shows the binding from the workflow container into the task container.
The lower part of the screen shows the binding from the task container back into the workflow
container.
 Not all container elements are visible by default. You can use the "Show lines" icon to make them
visible for processing.
 Use the input help (F4) for values.

© SAP AG BC601 8-8


0.9
Container and Binding Directions

Workflow task

Workflow Event container


container Task container

Role Event Method

Role Event Method


parameter parameter parameter
container container container
 SAP AG 1999

 The task container always contains an element that can store the reference to the object to be
processed in the respective single-step task (_WI_Object_ID). It also contains the element
"_WI_Actual_Agent". This is the agent who actually executed the work item. For synchronous tasks
with a defined result parameter, the ‘_WI_Result' element can store
the result of the underlying object method.
 The workflow container always contains an element that can store the user name of the “initiator”
of the current workflow (_WF_Initiator). For most workflows you have to create a new element in
the workflow container. To do this you can either go along with the SAP proposals, or you can create
your own element. For example, you have to provide a storage element for the main object of your
process.
 The event container always contains an element that can store the (object) reference to the object
whose change of status is announced using the event '_EVT_Object'. It also always contains an
element with the name of the user responsible for changing the status of the object ('_EVT_Creator').
 The role container contains the elements required as input in connection with the role resolution to
be run at runtime.
If a default role is defined for the entry, the binding can also begin from the entry in the role.
 The method container contains elements which are import parameters in connection with the
method execution.

© SAP AG BC601 8-9


0.10
Demo Example: Binding Definition

Submit notification of absence

Notification of
absence created

“notification of absence”
Reference to object type
Approve notification
of absence

approved rejected
Change notification
of absence ?
Send mail
No Yes
Delete notification
mail sent of absence
deleted revised
Yes
Re-submit
for
No approval ?
Workflow
Complete
container
workflow

Workflow
completed
 SAP AG 1999

 Element in the workflow container: Object notification of absence


The element is created with a data type reference to the object type FORMABSENC.
 The event "Notification of absence created" triggers the workflow "Notification of absence".

© SAP AG BC601 8-10


0.11
Demo Example: Binding Definition
Submit notification of absence

Notification of
absence created

“notification of absence”
Reference to object type
Change notification
of absence

approved rejected
Change notification
of absence ?
Send mail
No Yes
Delete notification
mail sent of absence
deleted revised
Yes
Re-submit
for
No approval ?
Complete
workflow
Workflow
Workflow container
completed
 SAP AG 1999

 The binding is always at the appropriate place in the workflow definition.


The system generates bindings automatically. You must check the definition
 The binding Event -> Workflow container is on the "Triggering Event" tab page in the workflow
template.
 When entering a task, the binding Workflow container - Task container is on the "Control" tab page.
 The binding Workflow container - Role container in the workflow step is on the "Control" tab page
and is shown if the routing should occur using a role.
 To find the binding to the method container choose Goto - Binding - Object method in the task
definition
 Binding
Event -> Workflow container
&_EVT_CREATOR& -> &_WF_INITIATOR&
&_EVT_OBJECT& -> &Vacation request&
 Binding
Workflow container -> Task container
&Vacation request& -> &_WI_OBJECT_ID&
 Each task must be individually provided from the workflow container.

© SAP AG BC601 8-11


0.12
Demo Example: Binding Definition

Submit notification of absence

Notification of
absence created

Person submitting notification of absence


Change notification

“notification of absence”
Reference to object type
of absence

approved rejected
Change notification
of absence ?
Send mail
No Yes
Delete notification
mail sent of absence
deleted revised
Yes
Re-submit
for
No approval ?
Complete
workflow
Workflow
Workflow container
completed
 SAP AG 1999

 If the role resolution of a workflow step requires an import parameter, then those values have to be
provided from the workflow container.
 Binding
Workflow container -> Role container
&_WF_INITIATOR& -> &ORG_OBJECT&

© SAP AG BC601 8-12


0.13
Binding and Containers
Event container

_EVT_CREATOR
_EVT_OBJECT
Workflow
container ‘CHANGE’ Task
container

Event _WF_Initiator _WI_Object_Id

_WI_Actual_Agent
Change MATERIAL
material
Role container
Material changed Changed_by
Superior Display ORG_OBJECT
of.. material
Material displayed ‘DISPLAY’ Task
container

_WI_Object_Id
Z_changed_by
 SAP AG 1999

 The workflow container contains two customer-defined elements:


- The material based on Business Object BUS1001
- "Changed-By" is based on the ABAP Dictionary field WFSYST-AGENT.
 The event transfers the material reference and the initiator to the workflow container.
 The "CHANGE" task is provided from the workflow container with the object reference (Binding
Workflow container -> Task container), and returns the actual agent of the work item from the
variable &_WI_ACTUAL_AGENT& into the variable &CHANGEDBY& of the workflow
container (Binding Task container -> Workflow container).
 The task "DISPLAY" is transferred to the object reference and to the variable "Changed_by". The
"Z_changed_by" can now, for example, be used as a variable in the work item text of the display
task.
"Z_changed_by" can also be used as a new agent.
 The workflow initiator is entered in the "find supervisor" role. It is assumed that the supervisor of the
initiator processes the step "Display material".

© SAP AG BC601 8-13


0.14
Example of a Container Operation:
Supplying a Customer Object Reference

Scenario: In a workflow for processing orders, you want to provide an object


reference that refers to the sold-to party (the customer)

Value from
Self- order
defined; transferred
object from the
reference event
to customer

 SAP AG 1999

 Container elements can also be specifically provided by a workflow step. This involves the container
operation step.
Container operations are necessary, for example, if you want to execute a secondary method in
addition to the main method.
 The binding entered in the workflow step usually only provides the main method.
Secondary methods must be provided using a container operation with valid values.
 If it does not already exist, you must first create the object reference in the workflow container.
For example, you can create an element CUSTOMER in the workflow container that refers to the
object type KNA1 (customer).
 You must then insert the container operation step into the workflow.
Your workflow processes a customer order.
 In the container operation you provide the Customer element with the ordering party value
(ORDERINGPARTY) from the order (Element CUSTOMERORDER) in the workflow container
 Caution:
The customer number (database key field) must not be transferred.
You must enter the reference to the whole object "ordering party" (object reference).

© SAP AG BC601 8-14


0.15
How Does Data Reach the Containers?

 Workflow container
 From the container elements of the triggering event
 From the export parameters or results of a task
 From a container operation step
 By entering initial values

 Task container
 From a terminating event
 From method parameters
 By entering initial values

 SAP AG 1999

 How containers are assigned values at runtime is shown in workflow runtime reporting.
 Task container:
Display work item (type W) that belongs to the task
Goto ,Technical work item display
Extras Container
 Workflow container:
Display work item (Type F), that represents the whole workflow to which the task belongs
Goto - Technical work item display
Extras Container
 The simplest way to view the type F work item (workflow work item):
From the work item display, go to the log and double click the highest level.
The workflow work item is displayed.

© SAP AG BC601 8-15


0.16
Where Container Elements Are Used

 Work item text


 Task description
 Missed deadline texts
(deadline, latest start, desired end)
 Notification text
 Export interface to the object method
 Export interface to the task
 Export interface to the role
 Container operations
 Secondary methods
 Condition Editor
 Start conditions for events
 SAP AG 1999

© SAP AG BC601 8-16


0.17
Containers: Unit Summary

 Containers are table-like data


structures
 Containers contain control
information for the workflow system
 Containers are used for field values
and object references
 During runtime the different
containers provide each other
with necessary information
(binding definition transfers
data from one container to another)

 SAP AG 1999

© SAP AG BC601 8-17


Exercises

Unit: Containers

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


 Understand the containers concept

When you create your own workflow, you also have to think about the
data flow. Within a workflow, data is transferred from one container to
the next. You prepare this data flow by defining the binding between
different containers.

1-1 Familiarize yourself with containers in the SAP Workflow system at runtime.

1-1-1 Which workflow components have their own containers?


____________________________________________
____________________________________________
____________________________________________
____________________________________________
____________________________________________
____________________________________________

1-1-2 Name at least 2 possible ways to reach the starting point for a runtime
evaluation of a workflow or a task container?
____________________________________________
____________________________________________

1-1-3 You have a work item in your worklist. How do you display the associated
task container?
____________________________________________

© SAP AG BC601 8-18


1-1-4 How can you use the “Work item selection” report to display the workflow
container?
____________________________________________
____________________________________________
____________________________________________
____________________________________________

1-1-5 You see a particular workflow container. Who is the initiator of this
workflow?
____________________________________________

1-1-6 Looking at the work item for your "Z##_T_1" task, where could you have
used an imported container element?
____________________________________________
____________________________________________
____________________________________________
____________________________________________
____________________________________________

© SAP AG BC601 8-19


Unit: Containers - Part 2

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


 Check the binding in the workflow after inserting a single step task

When you create your own workflow, you also have to think about the
data flow. Within a workflow, data is transferred from one container to
the next. You prepare this data flow by defining the binding between
different containers.

1.1 Call your material master workflow in the workflow editor

1.2 After the “Display material change documents” task, insert the “Display material
master” task

1.3 Name the manager of your organizational unit as the agent for this step.
Choose this person using their position.

1.4 Check the binding between the two tasks.

1-4-1 How does the first task know which material to work with?

1-4-2 How is the object transferred to the second task?

1.5 Activate the workflow and choose the “Test” button in the Workflow Builder.
In the first step, the change documents are displayed to the workflow initiator.
After the first step has been processed, the manager BC601-MGR## receives a
work item to display.
If you are executing the test as a manager, you will immediately see the material
displayed.
Otherwise, change to a mode in which you are registered as a manager, and execute
the work item to be sure that your material was correctly transferred. If you have
problems executing the work item, use “Refresh” in the inbox of your
organizational chart.

© SAP AG BC601 8-20


Unit: Containers (Additional exercise)
Topic: Using a document template in
workflow

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


– Create a document template in the workflow template
– Insert a step in your workflow for displaying or changing a
document.

Until now you have created and tested a workflow. You now want to edit,
save, and release some of the workflow runtime data and additional user
data in your own document. The SAP Workflow development
environment provides the following document processing functions for
doing this.

1.1 Make a copy of your material display workflow

1-1-1 In your copied workflow, create a document template in the form of a


Word document
1-1-2 Enter the following text:
Material workflow group ##
Person triggering the workflow: <variable workflow initiator>
Material: <variable material number>
Save the template under 'ZDOC_##'.

1.2 Processing the document template

1-2-1 After the step “Display material changes”,


enter a new step “Document from template”.
The agent for the step should be the workflow initiator.

Enter a new step description for each of the starting points “Step
executed” or “Document could not be created”.

1-2-3 Which element was created from new in the Workflow Container?

1-2-4 Insert a new activity after the starting point “Step executed”
This involves the activity “Edit document”, task
TS71007944.
All tasks for processing document templates can be found in
the task group TG71000004.
Check the binding in both directions.
The agent is the user BC601-MGR##.
1.3 Activate and test your workflow

© SAP AG BC601 8-21


Solutions

Unit: Containers

1-1 Familiarize yourself with containers in the SAP Workflow system at runtime.
1-1-1 The workflow components with their own containers are:
 Workflow
 Task
 Event
 Role
 Object method

1-1-2 To get to the starting point for a runtime evaluation of a workflow or a


task within the workflow development area, you can use the following
different reports:
In the SAP Easy Access menu , choose:
Tools  Business Workflow  Development 
Runtime Tools  Business Workplace  Outbox
Runtime Tools  Business Workplace  Inbox
Reporting  Double-click "Work Item Analysis"
Utilities  Double-click "Work Item Selection"
Utilities  Double-click "Diagnosis"

1-1-3 From a work item in your worklist you can choose


“Display”, then select Goto  Technical work item display  Extras
Container
to see a runtime snap shot of the associated task container.

1-1-4 After you have started the “Work item selection” report, select Type 'F'
on the “Selection Report for Work Items” screen. Then choose
Program  Execute, or choose the “Execute” button
to start the report. Finally, position the cursor on your type F work item,
and choose
Goto  Container.

© SAP AG BC601 8-22


1-1-5 You see a workflow container. Who is the initiator of this workflow?

Check the value in the variable _WF_initiator.

1-1-6 Looking at the work item for your "Z##_T_1" task, where could you
have used an imported container element?

Work item text

Task description

Missed deadline texts

Notification text

Export interface for object method, for task, for role

Condition Editor

Secondary methods

Start conditions for events

Container operation

© SAP AG BC601 8-23


Unit: Containers - Part 2
Checking Binding

1.6 Call your material master workflow in the workflow editor

SAP EASY ACCESS -> Tools -> Business Workflow -> Development ->
Definition Tools -> Workflow Builder
Your workflow template is displayed.

1.7 After the “Display change documents of material” task, insert the task “Display
material master”

Double-click the undecided task after your task “Change documents for
material”, and choose the “Activity” button
Enter TS as the task and the number of your single step task “Display material
master”. Use the input help (F4) if you no longer know the number

1.8 Name the manager of your organizational unit as the agent for this step.
Choose this person using their position.

You are still in the task step “Display material”


Choose “Position” in the “Agents” box and use the input help to search for the
manager position of your organizational unit

1-9 Check the binding between the two tasks.


1-4-1 How does the first task know which material to work with?

The task “Display change documents” knows the material from the initial value
entered in the single-step task.
It does not know it from the workflow container

1-4-2 How is the object transferred to the second task?


Display the binding by double clicking the icon “Binding (exists)”
The second task must have the material in the task container in the variable
_WI_OBJECT_ID. This variable must be filled during binding in the step from
the workflow container.
(Binding workflow container -> Task container)

In the workflow container, you must select the variable for the material object. It
can be the variable &MATERIAL_GROUP_##&
or &Zmara##&

© SAP AG BC601 8-24


Normally, a workflow is started using events, and the object is transferred into
the workflow container by the event manager.

Because the workflow is not yet started with events, you must ensure that the
workflow container variable is filled correctly from the first task onwards.

Return to the screen “Workflow Builder zwf_test_## change”


Double-click to display the workflow step “Change documents for material”
Display the binding by double clicking the icon “Binding” (exists)
Check the binding Task container -> Workflow container in the lower part of the
screen.
You must ensure that, on the workflow container side, a variable is specified that
can include the entry in WI_OBJECT_ID.
Use the input help (F4) for this, and select your material variable.

1.10 Activate the workflow and choose the “Test” button in the Workflow Builder.
Return to the screen “Workflow Builder zwf_test_## change”, and choose the
icon “Create and activate runtime version”
Then choose the “Test” icon
Execute the workflow template
In the first step, the change documents are displayed to the workflow initiator.
After the first step has been processed, the manager BC601-MGR## receives a
work item to display.
If you are executing the test as a manager, you will immediately see the material
displayed.
Otherwise, change to a mode in which you are registered as a manager, and execute
the work item to be sure that your material was correctly transferred.

If you have problems executing the work item, use “Refresh” in the inbox of your
organizational environment.
To do this, choose the following in the “Business Workplace” screen:
Settings -> Workflow settings -> Refresh organizational environment

© SAP AG BC601 8-25


Unit: Containers (additional exercise)
Topic: Using a document template in workflow

1-1 Make a copy of your material workflow

SAP EASY ACCESS - Tools - Business Workflow - Development –


Definition Tools - Tasks/Task Groups - Copy

Enter the number of your material workflow. If necessary, use the input help
(F4) to find this number.
Under “Copy”, enter the abbreviation “Zdocu_##”, Description “Document
template Group 20”.
1-1-1 Create a new document template
Return to the task menu and choose
“Change task”.
The workflow number has already been entered.
Choose the “Change” icon and start the Workflow Builder using the
“Workflow Builder” icon .

In the navigation area, click the “Document templates” bar


Double-click on the area “Double click to create”.
Select the Word document by double-clicking.
A Word document is shown in the Workflow Builder.

1.1.2 Enter the following text:


Material workflow Group ##

Person triggering the workflow: <variable workflow initiator>


Material: <variable material number>

To insert the variables, position the cursor in the desired place and select
the appropriate variable from the variable display on the left hand side of
the Workflow Builder.
1.1.3 Save the template
Return to the Workflow Builder standard display.
The system will ask if you want to save the template.
Save it under 'ZDOC_##'.
The document template is visible in the navigation area under document
templates.

1-2 Insert a new step “Document as template”


1-2-1 Process the document template.
Select the outcome of the step “Display material change documents”
Choose the “Create” icon and select the “Document as template” step.

© SAP AG BC601 8-26


In the workflow step displayed, click in the empty field “Document
templates” next to the “Create” icon.
An input help button appears.
Use the input help to select your document template.

Enter the workflow initiator as agent


1.2.2 Enter a step description on the “Outcomes” tab page.

Choose the “Outcomes” tab page and assign names.

1.2.3 Which element was created from new in the Workflow Container?

In the navigation area, click on the “Workflow container” bar.


You will see the element WF_Document_0001 that was used in the
workflow step under “Element for document”.
1.2.4 Insert a new activity in the outcome “Step executed”

Select the outcome “Step executed” for the activity you have just created.
Choose the “Create” button and then choose “Activity”.
Enter the task TS71007944 (Edit document).
All tasks for document templates are in the task group TG71000004.
Check the binding in both directions. The workflow container variable is
&WF_DOCUMENT_0001&

Choose the user BC601-MGR## as the agent.


1.3 Activate and test the workflow

In the Workflow Builder, choose the icon “Create and activate runtime version”

Choose the “Test” icon in the Workflow Builder.

© SAP AG BC601 8-27

You might also like