SAP Workflow Bit601 en Col10

432
(-l' - LaLo *tV, :-,r - rl\n p ^r PARTICIPANT HANDBOOK INSTRUCTOR-LED TRAINING Course Version: 10 Course Duration: 5 Day(s) Material Number: 50110600 ,,t4 \ 'fr.1 ['\.-

description

SAP Workflow Training

Transcript of SAP Workflow Bit601 en Col10

Page 1: SAP Workflow Bit601 en Col10

(-l' - LaLo *tV, :-,r - rl\n p ^r

PARTICIPANT HANDBOOKINSTRUCTOR-LED TRAINING

Course Version: 10

Course Duration: 5 Day(s)Material Number: 50110600

,,t4\

'fr.1 ['\.-

Page 2: SAP Workflow Bit601 en Col10

o 2012 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purposewithout the express permission of SAP AG. The information contained herein may bechanged without prior notice.

Some software products marketed bySAP AG and its distributors contain proprietarysoftware components of other software vendors.

. Mrcrosoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of

Microsoft Corporation.

. lBM, DB2,DBz Universal Database, System i, System i5, System p, System p5, System

x, System z, System 210, System z9,zIO,29, iSeries, pSeries, xSeries, zSertes, eServer,

z/YM, z/OS, i5lOS, 5/390, OS,/390, OS/400, AS,/400, 5./390 Parallel Enterprise

Server, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5,

POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS,

HACMP, RETAIN, D82 Connect, RACF, Redbooks, OS,/2, Parallel Sysplex, MVS/ESA,

AlX, lntelligent Miner, WebSphere, Netfinity, Tivoli and lnformix are trademarks or

registered trademarks of IBM Corporation.

. Linux is the registered trademark of Linus Torvalds in the U,S. and other countries.

. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or

registered trademarks of Adobe Systems lncorporated in the United States and./or

other countries.

. Oracle is a registered trademark of Oracle Corporation

. UNIX, X,/Open, OSF,z1, and Motif are registered trademarks of the Open Group,

. Citrix, lCA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin

are trademarks or registered trademarks of Citrix Systems, Inc,

. HTN/L, XML, XHTN/L and W3C are trademarks or registered trademarks of W3C', World

Wide Web Consortium, Massachusetts lnstitute of Technology.

. Java is a registered trademark of Sun Microsystems, lnc.

. JavaScript is a registered trademark of Sun Microsystems, lnc,, used under license for

technology invented and implemented by Netscape,

. SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects

Explorer, StreamWork, and other SAP products and services mentioned herein as well

as their respective logos are trademarks or registered trademarks of SAP AG in

Germany and other countries.

. Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports,

Crystal Decisions, Web lntelligence, Xcelsius, and other Business Objects products and

services mentioned herein as well as their respective logos are trademarks or

registered trademarks of Business Objects Software Ltd. Business Objects is an SAP

company,

. Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase

products and services mentioned herein as well as their respective logos are

trademarks or registered trademarks of Sybase, Inc. Sybase is an SAP company.

Page 3: SAP Workflow Bit601 en Col10

All other product and service names mentioned are the trademarks of their respectivecompanies, Data contained rn thrs document serves informational purposes only. Nationalproduct specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AGand its affiliated companies ("SAP Group") for informational purposes only, withoutrepresentation or warranty of any kind, and SAP Group shall not be liable for errors oromissions with respect to the materials. The only warranties for SAP Group products andservices are those that are set forth in the express warranty statements accompanying suchproducts and services, if any. Nothing herein should be construed as constituting an additionalwarranty.

@ Copyright , All rights reserved. It

Page 4: SAP Workflow Bit601 en Col10

IV O Copyright . All rights reserved.

Page 5: SAP Workflow Bit601 en Col10

This handbook is intended to complement the instructor-led presentation of this course, and serve as a

source of reference. lt is not suitable for self-study.

Typographic Conventions

American English is the standard used in this handbook.

The following typographic conventions are also used.

This in{ormation is displayed in the instructor's presentation

Demonstration

Procedure

Warning or Caution

Hint

Related or Additional Information

Facil itated Discussion

User interface control

Window title

Example text

Example text

O Copyright . All rights reserved.

Page 6: SAP Workflow Bit601 en Col10

About This Handbook

This handbook provides you with basic rnformation for attending your virtual live classroom session.

Adobe Connect Support lnformation

Web and audio support is available by:

. Pressing x0 from within the audio-conferencing

. Calling the support hotline numbers listed below

. Emailing the PGI support hotline below

Global PGI Support Hotline for SAP Education (24/7)

Tel: +1800-368-1945

Tel: +1719-234-7975

Note: After dialing in, press option 2 for technical support. You will then be presented with two options -press l for Audio support, or press 2 for Web support.

Email: [email protected]

Setting up your Learning Environment

ldeally you want to be in a private room when participating in a synchronous (live) event. ln reality, youmay not be able to arrange that. Here are some tips for maximizing your learning environment:

. Create an inspirational office,/studio to work in

. Use a comfortable chair

. Use well designed and functional computer peripherals

. Keep a log or journal of notes and ideas you can use for future sessions

Before your online class:. Tell co-workers you will be in class (send e-mail)

. Post a sign indicating when you will be free again (when class is over)

. Use a headset instead of your computer speakers to minimize disruption of others

. lgnore people who try to get your attention

. Turn off the ringers / alerts on telephone, pager, and cell phone

. Turn off e-mail and instant message alerts

. Remove other distractions lying on your desktop

. Keep a glass of water at your desk

Teleconferencing ground rules:. Use the mute button or press "6

. Do not place call on hold

O Copyright , All rights reserved.

Page 7: SAP Workflow Bit601 en Col10

. Use the "Raise hand" icon in the Attendee List: My Status to indicate you want to ask a question

. ldentify yourself before speaking, when not called on

. Charge the batteries for your cordless handset

. lf possible use a land line instead of your cell phone

Minimum Hardware Requirements

. PC with l GHz processor or higher. Minimum 1 GHz processor recommended for screen sharing. Youmay be asked to share their screen during hands-on exercise portion of virtual class.

. 17 inch or larger monitor is recommended, set aIIO24 X 768. Larger monitor andIO24 X 768 settingwill make presentation and system screens easier to read.

. Phone wiih Headset/Microphone or Speakerphone feature - to maximize student listening andcomfort during presentation and demonstration portions of the course,

Software Requirement

A complete list of supported Operating Sysiems, browsers and additional requirements for Adobe'Acrobat' Connect" can be found at: www.adobe.com/products/acrobatconnectpro,/systemreqs

Sample Emailto Notify Others You Are in a Virtual Class

This is a sample of an email you can send to your colleagues and manager when you are taking an onlinecourse.

Dear colleagues,

Today I will be participating in an online class from my desk. I will be online from approximately 9:30 a.m.

to 5:30 a.m. EST. I would appreciate it if you would not disturb me during this time. lf you have animmediate question, please contact Joe Smith at extension I23.lf it can wait until after 11:00 a.m.,please send me an email and I will follow up with you before the end of the business day. I appreciateyour consideration.

Best regards,

Getting the Most Out of Your Session

Session Guidelines

. Turn off email, phones, instant messaging tools, and clear other distractions away from your trainingarea.

. Participate and prepare to be called on by name.

. Use the " Raise Hand" icon if you have an immediate question or comment.

. Be patient waiting for a response to your chat messages.

. lf you leave the program, please use the "Step Away" status icon in the Attendee List pod to let yourinstructor know when you leave and remember to clear it when you return.

O Copyright . All rights reserved

Page 8: SAP Workflow Bit601 en Col10

vilt @ Copyright, All rights reserved

Page 9: SAP Workflow Bit601 en Col10

xiii Course Overview

I Unit 1: Workflow Architecture and Organizational Management

2 Lesson: lntroducing Workflow Architecture Components and theDesign of SAP Business Workflows

11 ' Exercise 1; Explain the Components of a Workffow , ,

17 Lesson: lntroducing Organizational Management and its Use in SAP

: Business Wqrkflows

25 Exercise 2:Create anOrganizationalUnit

37 Unit 2: The Workflow Builder

Lesson: Defining Workflow Templates

Exercise 3: Create a Workflow and a Workflow Definition .' ,' i

20J9

49

O Copyright. All rights reserved.

Page 10: SAP Workflow Bit601 en Col10

186 . Lessdn: Determining the Recipients of Work ltems ' i,,

192 Lesson: Defining a Rule with Rule Type Responsibilities

797 Exercise 14: Create a Rule of Type Responsibilities

2O7 Lesson: Error Handling, ihe lnteraction Between Possible and',.I rResponsibleAgents,, :. : . .,, l

215 Unit 7: Ad Hoc Processing Options

185 Unit 6: Agents

216

22r27823r

239 Unit 8: Options for Simple and Modeled Deadline Monitoring

244243249255

Lesson: Defining Agents and Tasks Dynamically

Exercise 15: Use the Wizard - Select Agents

Lesson: Enhancing Workflows Using the Step Type Ad Hoc AnchorExercise 16: Enhance Workflows Using the Step Type Ad Hoc

Anchor

Lesson: Using Simple Deadline Monitoring

Exercise 17: Create a Simple Deadline

Lesson: Using Modeled Deadline MonitoringExercise LB: Create a Modeled Deadline using a Wizard

268 Lesson: Linking the Workflow and the Triggering Event

27I Exercise 19: Link a Triggering Event to the workflow

275 Lesson: Triggering Events in the Application

283 Exercise 20: Trigger an Event using Change Documents

2BB Lesson: Defining Additional Start Conditions and Using the Event

Queue

295' ,,' ,, ',", ' iiercise 2t: Define an Acoitional'Start Condition , ,

lmplementation

313 Unit 10: Special Step Types and Methods of Processing

314 Lesson: Using Step Type Fork and Multiline Attributes

32I Exercise ZZ:Usethe Step Type Fork

326 Lesson: Using.S^t.O Type Loop, Form Processing, Document from

333,,, .:..;.:' f, Exercise23; Ugethe,,StepTypefofLoopg34L347.

35r357

, ,r Exercise 24: Ute the Step Type DocUmentJrorn,:Template

, ,: Lesgon; US.lng Step Type Block,and Switqh, 1 ,,l1,,;r , r,

, ' Exerciae 25:l'Use the,Step,Type Block ,,

' :::: Exe[Cile 26:, Use'the Step,Type Multiple Condition , ,

@ Copyright , All rights reserved.

Page 11: SAP Workflow Bit601 en Col10

369 Unit 11: Wizards

370374

381 Unit 1.2: Tutorial

Lesson: Using Wizards for the Definition of Workflow Temptates

Lesson: Using Wizards to Define Steps in a Process

382333399403407

Lesson: Creating the Notification of Absence Workflow

Exeriise 27: Create the "Notification of Absence" workflow

Exercise 28: Extend the "Notification of Absence" workflow

Exercise 29: Revise the "Notification of Absence" workflowExercise 30: Complete the "Notification of Absence'' workflow

@ Copyright , All rights reserved.

Page 12: SAP Workflow Bit601 en Col10

@ Copyright. All rights reserved

Page 13: SAP Workflow Bit601 en Col10

TARGET AUDIENCEThis course is intended for the following audiences:

. ApplicationConsultant

. DevelopmentConsultant

. lndustry./ Business Analyst Consultant

. Support Consultant

. TechnologyConsultant

. Systems Architect

. Developer

. System Administrator

. Super / Key / Power User

O Copyright. All rights reservedtrwrdwr

xiii L*f .l "*fhfrffiguv'0

Page 14: SAP Workflow Bit601 en Col10

O Copyright , All rights reserved.

Page 15: SAP Workflow Bit601 en Col10

Lesson 1

lntroducing Workflow Architecture Components and the Design of SAP Business Workflows

Lesson 2

lntroducing Organizational Management and its Use in SAP Business Workflows

Exercise 2: Create an Organizational Unit

a

11

17

25

UNIT OBJECTIVES

. Explain the workflow architecture and the design and implementation procedure of aworkflow

. Create an organizalional unit to define possible and responsible agents in workf low tasks

O Copyright. All rights reserved.

Page 16: SAP Workflow Bit601 en Col10

I ntroduci ng Workflow ArchitectureComponents and the Design of SAP BusinessWorkflows

LESSON OVERVIEWThis lesson reinforces your knowledge of the underlying architecture of the Workf low Engine,

and the associated terminology. lt also introduces an example workf low that you will create

during the course.

Business Example

You want to use the SAP Workflow Engine in your company to be able to control and monitoryour business processes effectively.

You want the first business process to be a Materials Management process that starts when

changes are made to a material master.

The system first displays the change documents to an assigned user (these documents are

for the material master that was changed), the user then decides whether the change is okay.

lf the assigned user accepts the change, another user receives a work item that displays the

material master. lf this user does not accept the change, a mail is sent to the person who

made the change.

The workflow should use the organizational plan of the company. For this reason, you require

the fol lowing knowledge:

. An understanding of the workflow architecture

. An understanding of the steps involved in a workflow project

. An understanding of the general procedure for design and implementation

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Explain the workflow architecture and the design and implementation procedure of a

workf low

Workflow Benefits

The following are some characteristics of SAP Workflow:. A tool for automating business processes locally within an SAP System

. Can use the WF-XML interface to call workflows in other systems and exchange data with

these systems

. ls not tied to any particular application and can be tailored to meet customer requirements

@ Copyright. All rights reserved

Page 17: SAP Workflow Bit601 en Col10

Lesson: lntroducing Workflow Architecture Components and the Design of SAP Business Workflows

. Operates uniformly across all applications

. Coordinates all of the tasks involved and provides users with active support

SAP Workflow supports your business processes that run in an SAP system. lt also supportscommunication between business processes that are running on different systems. For

communication between systems, SAP Workflow uses the WF-XML interface.

The SAP Workflow can combine different component steps into a single process.

SAP Workflow supplies the end user with all of the information required for the step to beprocessed.

SAP standard delivery contains workflow templates that map business processes. You cangenerate your own workflow templates or adapt those workflow templates provided by SAP

to meet your requirements.

Workflow Architecture

Who executes theprocess steps?(OrganizationalManagement)

Which sleps does theprocess coltain?(Workflow Builder)

Business object typelevel(Business ObjectRepository)

What is start€d?The ABAPof differentapplications is started.

Broadly, a workflow can be defined as a means to get the right work to the right user at theright time.

The right work is whatever you want to achieve by using the workflow, implemented as

methods of business object types in the Business Object Repository (BOR).

You can implement methods as BAPls. You can ihen call them from outside the system.BAPIs have an established static interface. The tool for maintaining business object types isthe BOR. You can implement methods as BAPls. You can then call them from outside thesystem. BAPIs have an established static interface. The tool for maintaining business objecttypes is the BOR.

ln SAP ERP, the ABAP-OO interface is also available for defining the right work. As of SAP

ERP, you can also call methods from ABAP-OO classes in a process step,

'\,,,. Note:,S',"'' Course 8lT611 provides further information about the ABAP-OO interface.

Figure 1: Workflow Arch tecture

@ Copyright. All rights reserved.

Page 18: SAP Workflow Bit601 en Col10

Unit 1: Workflow Architecture and Organizational Management

; ls there an SAP \,,---t-\ ./ workflow in the \ €l./'9 t/ standard system \W{ already? \

Figure 2: Steps in a Workf low Prolect

The process level describes the business process in a sequence of individual steps. Together,

these steps form the workflow definition. An individual step can refer to a method in the BOR,

however it can also be used to control the process, for example, to allow loop processes, toquery conditions, or to fill the interface or the container with values. The tool used formaintaining the process level is the Workflow Builder.

The organizational level creates the link to the organizational structure. A task that can be

executed within a workflow has a group of possible agents. You can specify the agent in theworkflow step to restrict this group.

At runtime, selected agents receive a work item in their Business Workplace. lf they execute

the work item, the system starts the relevant method of the business object type.

Workflow Scenario

lf you want to use the SAP Workflow Engine to map a business process in your company, you

should first ascertain whether SAP supplies a workflow template for this process.The process

of finding a workflow template and adapting it for execution is covered in course B|T6O0. As

of R./3 Enterprise, you can find which applications provide workflows astemplates by

consulting the documentation for the relevant application.

lf you find a template, you may still have to adapt the process logic.To do this, you require the

knowledge from this course. You can use the templateas a model after you have created a

copy. Only if you do not find a suitable template, do you have to plan and implement theworkflow yourself from start to f inish.

Create a Workflow Design

To create a workflow design, perform the following steps:

1.. Determine the business steps in the process.

2. Define each step as a method of an object type.

3, Determine the agents responsible for the steps.

4. Determine any additional control steps in the workflow, for example, loops, container

operations, and conditions.

5. Determine when the workflow should start, for example, the triggering event or start form.

@ Copyright . All rights reserved,

Page 19: SAP Workflow Bit601 en Col10

Lesson: lntroducing Workflow Architecture Components and the Design of SAP Business Workflows

6, Def ine possible additional functions, for example, deadline monitoring and conditions

when steps are completed.

Process StepsAfter selecting a business process that you want to control using the Workflow Engine, divide

the process into individual steps that can be executed in the workflow. A step that executes

business functions must refer to an object type method.

you must also determine the organizational responsibility for these business steps, that is,

you are required to define which of your employees are responsible for a specif ic function.you can map the responsibilities in the workflow by referring lo organizalional objects' An

agent can be an SAP user, organizalional unit, position, job, or HR work center. You can also

assign an activity grouP,

you may find the relevant objects in your customized organizational plan again. ln addition to

your organizational plan, you may also have to create special organizational units only for

your workflow scenario, or you may need to refer to the existing objects of your organizational

level during agent determination.

you can assign activity groups if you do not want to refer to the organizational model.

ln addition to the business steps, a workflow also contains control steps, for example, loops or

condition queries.

The following figure displays an example:

The required business steps in the process are:

. Approve request

. Delete request

. Review request

. User decision on how to continue if the superior has rejected the request.

Process:Whenever an employee createsa notification of absence, ...

... the head of department should decidewhether or not to approve the request. ..'

... lf approved, the creator of the notificationof absence receives a message'

;, ;;. tf not approved, thal ciiatoi of,tlri, ll, :;':'::':t::::"':':':"':'

' 'hotificalion of absencC is askeo wh'eitrer I '

' the request should be lvithdrawn orctrangeO. ...

... if the request is to be changed, the creatorreceives the request again for changes ..-.

... The scenario should then be repeatedif changes are made.

Figure 3: Example: Designlng a workf low for "Approving Vacation

-

What, Who, When?

- l$ Event

Approve qrequest

Sends

* w X"r',lll *

*& Resubmitrequest

@ Copyright. All rights reserved.

Page 20: SAP Workflow Bit601 en Col10

Unit 1: Workflow Architecture and Organizational Management

. Send a mail if the superior approves the request.

For each step you should ask yourself:

. What work has to be done? (This establishes which object type and which method youneed.)

. For dialog steps: Who is doing the work? (This establishes who the responsible agentsare.)

. Which text should be displayed in the workplace of the work item recipient? (This text is

maintained when the step is created as a task.)

. lnclude your answers in the design. The process requires a loop because anew request hasto be resubmitted each time. (The loop is a controlling step that has to be implementedwith a terminationcondition.)

The process is then triggered if a user creates a vacation request using a special transaction.The system triggers the Request created event and starts theworkf low.

For each event you should ask yourself:

When is this event generated, and using which application?

,1,,,.....,, To lmplement a workflow

:i tl,..,rr To implement a workflow, perform the following steps:

L. ln the BOR, check whether a suitable object type exists and whether it has all of thenecessary attributes, methods, and events.

2. CreaIe the necessary tasks (TSxxxxxxxx).

3, Generate the workflow template and define the necessary steps using the tasks created.

4. lmplement any additional controlling steps, such as loops, conditions, and containeroperations.

5. Without using the application, test the link between the workf low and the triggering eventusing transaction swus.

6, Trigger the event in the required application.

@ Copyright. All rights reserved

Page 21: SAP Workflow Bit601 en Col10

Lesson: Introducing Workflow Archiiecture Components and the Design of SAP Business Workflows

Basic Customizing for the Workflow Engine

Tools ) Business Workflow ) Development ) Utilities ) Automat. Workflow Customizing

', Mdfi ain Rldim. gnvironm.fr

a! r,rnr*.!.n!m!d rbi! 5*dL.nt.{e 64fttftr[,[email protected]

612\J.1.^.t3' Att'4 atund ltu{& *94.r!.rd€d lfir$bart

th. n.(!rg d*re. ! 16 re ndlrr.d .dor*kt*

. t.d )r' e kl a tP,.rr:ftt ^

r' rinb,i lndrkiil 9.bno!

i.i*6

Figure 4. Workf lcw Engrne Customizing

To customize settings for the Workflow Engine, on the SAP Easy Access screen, choose lools--+ Buslness Workflow ---+ Development --+ Utilities --+ Automatic Workflow Customizing( swu:).

You may need to carry out a number of client-specific system settings and activities for theWorkflow Engine. For a description of the Customizing activities and their functions, see theonline documentation or online help.

The Perform Automatic Workflow Customizing pushbutton enables you to maintain thestandard settings for the Workflow Engine. You can then use the Start Verification workflowpushbutton to start a f irst test workflow to check the Customizing settings.

ln the Workflow Runtime System section, ensure that the green checkmarks are set. ln theWorkflow Development environment section, you can ignore an entry with errors in Numberrange for customer tasks,

Automatic Workflow Customizing does not include maintenance of the organizational plan ortask-specific Customizing, that is, assignment between tasks and possible agents

@ Copyright , All rights reserved.

Page 22: SAP Workflow Bit601 en Col10

Unit 1: Workflow Architecture and Organizational Management

ii:* f igure 5: Overv ew of Customizing Activ ties

Suitable Object Types in the BOR

You have selected a business process and divided it into individual steps that can be executed

in a workflow. Next, find the suitable object types in the BOR. Check that all the required

methods, attributes, and events are available. lf they are not available, you must enhance the

object type to suit your requirements.

Check whether the system already contains tasks for your required steps. lf not, you have to

define new tasks.

You can define the tasks explicitly, however you can also create them directly from the

Workflow Builder.

In your workflow definition, always create the steps that refer to an object method first (these

are the business steps). This allows the system to generate the necessary container

elements.

Call the transaction swus from the Workflow Builder and use it to test the workflow.

lf you have defined a triggering event for test purposes, you can use transaction swun to

trigger the event directly in the system.

Notification Using Enhancements in the Standard Mailbox

It is possible to deliver Workflow notifications into the email inbox.

Aim:

Every time a work item is stored in the Business Workplace of the SAPSystem, the relevant

user should receive an e-mail.

Procedure:

. SApNet Note 627397 contains an ABAP program and describes the procedure in the

context of notif ications.

. The user for whom the report is scheduled must have maintained an lnternet address in

the user data under further communication. This becomes the sender of the e-mail.

. A SendMail process must be active.

Aclivity Automatic Always requirod? Default enlry used

l\,laintain an active dan version 01

Check entries i'om the HR contrd taues

l\raintain preflx numbers

Check numberranges

Confgure RFC destination User WF-BATCH

l\raintain a system admtnisfator fot worldow SY-UNAIVE

Generdly dassfy decision tasks :'our own user lD

Maintain a standard domain for Internet mal

Aclivate sending to objects and HRobjects

l\,laintain demo and veriication environment

Schedule background iob for missed deadine

Schedule background Job for work items wth errors

Schedule background rob for condtton evduation

Schedule background ,ob for evenl queue

Schedule backaround iob for clean up tasks

O Copyright . All rights reserved.

Page 23: SAP Workflow Bit601 en Col10

Lesson: lntroducing Workflow Architecture Components and the Design of SAP Business Workflows

. An lnternet Gateway must be active in the SAP system.

The e-mail text is formed from the description text for the underlying task of the work item.The program enables you to add executable attachments to the email. The e-mail recipientcan then either:

. Using transaction SCOT, determining whether the necessary processes are running in thesystem

. Trigger, sending specifically from this transaction.

The send process is called RSCONN01.

For sending missed deadline work items, read Note 200996.

@ Copyright. All rights reserved.

Page 24: SAP Workflow Bit601 en Col10

Unit 1: Workflow Archrtecture and Organizational Management

10 @ Copyright. All rights reserved.

Page 25: SAP Workflow Bit601 en Col10

Explain the Components of a Workflow

Business Example

you want to use a workflow in your company to automate business processes. Your goal is to

support a business process in Materials Management. To understand the terminology used,

first review the basics from the introductory workflow course'

You are invited to attend a meeting about workflows. Many of the people present do not know

anything about the SAP Workflow Engine. They are relying on you to answer their questions

and concerns.

Many workf low terms were used in the meeting. Some of the people present did not know the

meanings of these terms. As a workflow expert, define these terms for everyone.

Using the terminology list provided, ensure that everyone knows the appropriate term for

each statement about the workflow.

is a generic description of an object. lt includes the definition of1, Ankey fields, methods, attributes, and events.

2. Any type of related information that can be accessed uniquely under an identifying key is

called an

3. An is a predefined workflow definition supplied by SAP that defines

a specific business scenario.

4, A system workf low defined by the user or supplied by SAP is called a

5. Workflows are started bY

6, The is a tool used to def ine, access, and modify workflow definitions

in a graphical format.

7. The technical implementation of a business process is referred to as a

, which consists of a sequence of connected steps.

8. From an organizalional perspecttve, are the central element in the

workflow system. They form the business steps of a business process.

9. lnteraction between the runtime execution of workflows and users responsible for

carryingout specific work to be done is managed by various

SAP Workflow Tasks Workflow Template

Events Jobs Positions

Object Method Object type

lnbox/Workplace Workflow def inition Workflow Builder

11@ Copyright. All rights reserved,

Page 26: SAP Workflow Bit601 en Col10

Unit 1: Workflow Architecture and Organizational Management

10.

11.

12.

a workf low.

An employee occupies a

and can be used to assign agents to a step in

. Employees are not assigned directly to

model functions that are executed when the workflow is running.

12 @ Copyright. All rights reserved.

Page 27: SAP Workflow Bit601 en Col10

Explain the Components of a Workflow

Business Example

You want to use a workflow in your company to automate business processes. Your goal is tosupport a business process in Materials Management. To understand the terminology used,first review the basics from the introductory workflow course.

You are invited to attend a meeting about workflows. Many of the people present do not knowanything about the SAP Workflow Engine. They are relying on you to answer their questionsand concerns.

Many workf low terms were used in the meeting. Some of the people present did not know themeanings of these terms. As a workflow expert, define these terms for everyone.

Using the terminology list provided, ensure that everyone knows the appropriate term foreach statement about the workf low,

1, An is a generic description of an object. lt includes the definition ofkey fields, methods, attributes, and events.

a) Answer: object type

2. Any type of related information that can be accessed uniquely under an identifying key iscalled an

a) Answer: object

3, An is a predefined workflow definition supplied by SAP that definesa specific business scenario.

a) Answer: SAP Workflow

4, A system workf low defined by the user or supplied by SAP is called a

a) Answer: workflow template

Workflows are started by

a) Answer: events

The is a tool used to define, access, and modify workflow definitionsin a graphical format.

a) Answer: Workflow Builder

5,

6.

SAP Workflow Tasks Workflow Template

Events Jobs Positions

Object Method Object type

lnbox,/Workplace Workflow def inition Workflow Builder

@ Copyright , All rights reserved,

Page 28: SAP Workflow Bit601 en Col10

Unit 1: Workflow Architecture and Organizational Management

7. The technical implementation of a business process is referred to as a

, which consists of a sequence of connected steps.

a) Answer: workf low definition

8. From an organizational perspective, are the central element in the

10,

workflow system. They form the business steps of a business process.

a) Answer: tasks

9. lnteraction between the runtime execution of workflows and users responsible forcarrying out specific work to be done is managed by various

a) Answer: inboxes

and can be used to assign agents to a step ina workflow.

a) Answer: Jobs, position

11. An employee occupies a Employees are not assigned directly to

a) Answer: position, jobs

model functions that are executed when the workflow is running.

a) Answer: Methods

t2.

L4 @ Copyright All rights reserved.

Page 29: SAP Workflow Bit601 en Col10

Lesson: lntroducing Workflow Architecture Components and the Design of SAP Business Workflows

Use of the Data Sheet

The data sheet can be used by you to enter the names of the objects that have been used inthe exercises of the course BlT601.

The following objects have been used:

Object Type Object Name

Users BlT601-## (employee), where ## is yourgroup number

BlT601-mgr## (manager of theemployee)

Organizational unit

Position 1

Position 2

a;. Note:;tf r The organizational model used

here includes one org unit andtwo positions.

ZWF-ORG_##

zpos_empl_## - Position Employee

zpos_head_## - Position Manager

. Exercise workflow ZWF_TEST1_## Exercise 1, user decision,group ##

Standard tasks Z##_TS_I Change documents formaterial, group ##

Z##_IS_2 Display material master, groupl+t+

Task group Z##_AG

Object types Y##MARA - Material SU PERTYPE

YMARA## - Material SUBTYPE

Test material . T-BBD##

Rule . Z##_Matgroup Rule for responsibility

@ Copyright. All rights reserved.

Page 30: SAP Workflow Bit601 en Col10

Unit 1: Workflow Architecture and Organizational Management

.lr"'] ,,,' ,, 1, . . . :

tt,;;;;;t,1 .,1 LESSON SUMMARY1:r You should now be able to:

. Explain the workflow architecture and the design and implementation procedure of a

workflow

16 @ Copyright . All rights reserved.

Page 31: SAP Workflow Bit601 en Col10

lntroducing Organizational Management andits Use in SAP Business Workflows

LESSON OVERVIEWThis lesson describes the options available for using Organizational Management within aworkf low, and how you can create a link between Organizationai Management and workf low.

Business Example

You want to use the SAP Workflow Engine in your company to be able to control and monitoryour business processes effectively. You want the first business process to be a MaterialsManagement process that starts when changes are made to a material master. The systemfirst displays the change documents to an assigned user (these documents are for thematerial master that was changed), the user then decides whether the change is okay.

lf the assigned user accepts the change, another user receives a work item that displays thematerial master. lf this user does not accept the change, a mail is sent to the person whomade the change. The workflow should use the organizational plan of the company. For thisreason, you require the following knowledge:

. An understanding of the different options for using Organizational Management in aworkflow

. An understanding of an organizational unit with positions

. An understanding of the different ways of assigning possible agents to units in theorganizational model

,,rr,.:irrrlr LESSON OBJECTIVES'r,r,:,,,, After completing this lesson, you will be able to:

. Create an organizational unit to define possible and responsible agents in workflow tasks

@ Copyright. All rights reserved

Page 32: SAP Workflow Bit601 en Col10

Unit 1: Workflow Architecture and Organizational l\,4anagement

Connect existingorganizational structure

to workflow

Organizalional structureavailable -Additional

workflow structure

There is only oneworkflow-oriented

organizational structurein the company

l- Fl departmentI l-4,""-c!nt5"payableI I l::tu""". i

I Lo""ounr" receivable

| 't'.t::i jL controtl ing department

Enterprise Structure

l-qi,.-tr:gA,I Positions

i

Lo,"rr,", "i",elil::t"J

Special group far thebusiness process

,a!e::*:-13:1919*i Pasition Approvat

E

ir:r:::ots.1**iI Position Approval I

*.::fr:-'-:i*--.i

.,.rrirr: Figure 6: UslngOrgan zalonal Structures

Special group forthe businessprocess Controlling

ONTRPurchaserequisition

Organizational Management

lf you must determine the agents of the individual workf low steps using the customer-specificorganizational chart, your agent assignment in the workflow remains flexible to change.

The following are a few examples of how workflows may be linked to the SAP

organizational plan:

. There is only one organizational chart for the whole company. All the workflows are to be

connected to the organizational objects from this structure. This option does not have any

specific structures for the workf low alone.

. HR manages the general structure for all the employees in the company, To support theworkf low, there is a small and specific structure for each business process.

. Your company does not yet have a general HR structure for all the employees. To support

the workflows, there is one small structure for each process.

1B @ Copyright. All rights reserved

Page 33: SAP Workflow Bit601 en Col10

Lesson: Introducing Organizational Management and its Use in SAP Business Workflows

Basic Organizational Unit Maintenance

3 Main Functions

*$ Figure 7: Features of Simp e Maintenance

Maintenance of SAP Organizational Management is available as a basis component. On the

SAP Easy Access screen, choose Iools -+ Business

Workftow ---+ Developmaflt ---+ Environment ---, Organizational Management -'-+ Simple

Maintenance. Create Organization and Staffing (Workflow) comprises one main window and

three main functions. Each function is determined for a particular group of maintenance

activities.

The following are the main functions when creating an organizational structure:. The Create Organizationat lJnit function enables you to create and maintain the

organizational structure for your organizational plan.

. The Create Position function enables you to create the positions again as part of your

organizational structu re.

. The lasks function allows you to create, maintain, and view assignments for jobs,

positions, and users.

Caution:The HR component recognizes both SAP system users and individual persons as

holders of positions. Workflow only recognizes SAP system users as valid agents.

lf you want to use the existing H R organizational structure for the workf low, enter

the infotype 105 and communication type 0001 (sAP system user) for each

person in the master record.

This infotype is used to assign an SAP system user to an HR person. You create

these users by maintaining the HR master record. On the SAP EasyAccess

Screen, choose Human Resources ---+ PersonnelManagement ---+ Administration'-'+ HR Master Data --- Maintain.

@ Copyright . All rights reserved, 19

Page 34: SAP Workflow Bit601 en Col10

Unit 1: Workflow Archrtecture and Organizational Management

Task: Approve leave request

/l\Positions are specific to yourorganization.

Multiple positions mayperform similar tasks.

Each position usuallyrepresents one employee, butmay be partially filled by morethan one employee.

Manager -Europe

Position:Manager -

Eastern Region

Posilion:Manager -

Western Region

,,:,;S Figure B: lnteraction of Tasks w th Positions and Jobs

lnteraction of Tasks with Positions and Jobs

A task can be assigned to one or more jobs. Jobs are general activity descriptions.

Jobs are not designed to be held by employees. lt is the positions in your company that areheld by individuals.

lf a position is assigned to a job, the position inherits the tasks of the job, but it can also haveadditional tasks related to the specific task area for that position.

One position may also be shared by several employees, each working less than full time. Forexample, two employees can occupy 600lo and 4Oo/o of a position. The workf low regards bothemployees as valid agents and ignores the percentage division of the job.

20 @ Copyright . All rights reserved.

Page 35: SAP Workflow Bit601 en Col10

Lesson: lntroducing Organizational Management and its Use in SAP Business Workflows

The Organizational Unit Creation Process

The first step in simple maintenance is to create the root organizational unit. After creatingthis organizational unit, create the appropriate lower-level organizational units. You maycreate organizational units and jobs in any order, however they must exist before you createthe related positions.

Jobs may exist in the job index, or you may create them once the model contains anorganizational unit. Create positions after creating the corresponding jobs in the job index.

Caution:ln SAP R,/3 Release 4.68, you must define a position first. You can then createthe job with reference to the position.

Holders are assigned to positions, not to jobs.

Mk|F*M*i*l

Create orderCreate invoiceChange customer masler

Create additional

Administratoragent

O Copyright. All rights reserved 2t Whrd-r6

Page 36: SAP Workflow Bit601 en Col10

Unit 1: Workflow Architecture and Organizational Management

Agent Assignment Between Tasks and Organizational Objects

You create all the required tasks, such as approve request, create purchase order, and updatecustomer master as part of the workflow definition.

Users are authorized to process the corresponding work items at runtime only if they are

def ined as possible agents for the task.

As listed below, the figure shows all the basic options available for creating theconnection:. Task 1: User 1 (assigned by job)

. Task 2: User 1, user 2 (assigned by jobs)

. Task 3: User 1, user 2, user 3, user 4 (assigned by organizalional unit)

. Task 4: User 1, user 3, user 4 (assigned by position or by job)

. Task 5: User 2 (assigned by job)

. Task 6: User 3, user 4 (assigned by jobs)

The assignment of a workflow task to an organizalional object is best performed using taskmaintenance available by choosing Additional data ---+ Maintain Agent Assignment. After you

create an agent assignment, generate the index for that agent assignment again using theGenerate lndex pushbutton within task maintenance.

Substitution in the SAP Business WorkflowThe substitution is maintained in the Business Workplace.

You can maintain substitution in two ways:. Personal substitute (for an SAP user)

. Position substitute

The following are important features of substitutes:

Organizational Unit: Fl department

ffiTask:3

Task: 4I .. " ::l:ll

Position: Secretary

Tasks:2,5

'Position:

Tasks:4,6

Figure 10: Agent Assignment Opt ons Betvreen Tasks and Organizattonal Oblects

22 @ Copyright , All rights reserved.

Page 37: SAP Workflow Bit601 en Col10

Lesson: lntroducing Organizational Management and its Use in SAP Business Workflows

. May be created and activated at the same time:

- From the time of activation, the substitute automatically receives not only their own

work items, but also the substitution work items

. May be created and not activated:

- The substitute can take active control of the substitution function at any time

Until the substitute actively ends the substitution, their Workplace displays only the

substitution work items.

,: ..:,.. Hint::..,, ,-a As of SAP ERP 6.0, in the basic Customizing of the Workf low Engine, you can set: rir'rii:ii:

a substitute to see not only the work items of the absent user, but also their own

work items. This substitution is feasible if the user explicitly executes the

su bstitution themselves.

The maintenance is available under transaction spRo, choose SAP Reference

IMG --- SAP NetWeaver --+ Application Server --+ Buslness Managemenf -+ SAP

Buslness Workflow ---+ Basic Setfings (Workflow System) --+ Change Presettings

f o r Pe rson al W orkf low Settings.

Perform the following steps to manage substitutes:

L. Choose SAP Busines s Workplace. Alternatively, choose Off ice --- Workplace. The Business

Workplace screen aPPears.

2. To create and activate the substitution, choose Settings ---+ Workflow Settings -+ Maintain

S u b stit ute / Act i v ate Substitute.

3. To adopt or end a substitution, choose Settlngs -+ Workflow Settings --'+ Adopt

Substitutlon / End Substituti on.

ln many workflows since the agent is not determined from positions, using the position

substitute might cause Problems.

It is to be used only if you are sure that positions are used to determine the agent in all

workflows used throughout the system.

For example, the task step in the workflow on which a work item is based, has assigned the

position. The substitute for the position receives the work item,

ln another example, the task step on which a work item is based has assigned a role and this

role determines a user. The substitute does not receive the work item.

Every user should maintain a personal substitute. They can transfer the substitution as

required.

O Copyright. All rights reserved,

Page 38: SAP Workflow Bit601 en Col10

Unit 1: Workflow Architecture and Organizational Management

The Workflow Scenario - Changing the Material Master

ln the figure, the user changes the material master 100-300 and enters the new value,New_Part, in the old material number field. This change generates a change document. The

Material changed event is then published in the system. This event forms part of theZBUSlOOl object type.

The published event triggers a workflow. ln the first task, the workflow displays the changedocument for the changed material to the superior of the agent who changed the materialmaster. ln the second step, the material master is shown to all those responsible for materialgroup 001.

This organizational responsibility is determined within the design process of a rule definition.ln this case, it comprises the members of an organizational unit.

in'Change Documents' table

triggers*}Qrii*,,|.i:t!**ir::it'l';.1r:*

lmport parametersfor rules

Organizatlonal unitProductionOrganizaiional unitProduct ManagementProduct manager position

Holder: JonesAgent position

Holder: Bjiirn

Rule "ldentify agent responsible for material group 001"

r'111111 Figure 11: Example Workf low - Changing the Material Master

5li*,*,, r*0ld,Material,changed

workflow

'mined

of the

24 @ Copyright . All rights reserved

Page 39: SAP Workflow Bit601 en Col10

Create an Organizational Unit

Business Example

You want to use the components of Organizational Management for agent determination, andare required to create an organizational unit that suits your requirements.

The agents of a workflow step may be organizational units for the entire organization or forthe jobs or positions within an organization. Assigned users receive and process work itemsgenerated when a workflow def inition is executed.

Create an organizational structure with two positions that are to be held by your two agentsBlT601-## and BlT601-MGR##.

1. Create an organizational structure. Assign the following values:

Field Name Entry

Abbreviation f or organizational unit zwF oRe ##

Name Organizational unit group *#

## is your group number.

ln the organizational unit, create a position for the chief. Assign the following values:

Field Name Entry

Abbreviation Zpos head ##

Name Position departnent head ##

3. ln the organizational unit, create a position for the employee. Assign the following values:

Field Name Entry

Abbreviation Zpos_ernpl_#*

Name Position empJ-oyee ##

4. Assign users to the positions as follows:

Field Name Entry

Department head position BIT6O1-MGR##

Employee position Brt601-#*

5. Define Position department head ## as the chief position.

2.

@ Copyright . All rights reserved 25

Page 40: SAP Workflow Bit601 en Col10

Create an Organizational Unit

Business Example

You want to use the components of Organizational Management for agent determination, andare required to create an organizational unit ihat suits your requirements.

The agents of a workflow step may be organizational units for the entire organization or forthe jobs or positions within an organizalion. Assigned users receive and process work itemsgenerated when a workflow definition is executed.

Create an organizational structure with two positions that are to be held by your two agentsBlT601-## and BlT601-MG R##.

1.. Create an organizalional structure. Assign the following values:

Field Name Entry

Abbreviation f or organizational unit zwF oRc ##

Name Organizational unit group ##

## is your group number.

a) On the SAP EasyAccess screen, choose Tools --+ BuslnessWorkflow -+ Development ---+ Environment -- Organizational Management -+ SimpleMaintenance ---+ Organizational Plan Basic Data -+ Create.

b) ln the Create root organizational object dialog box, enter the following data:

c) On Ihe Organization and Staff ing (Workf low) Create screen, in the Details forOrganizational unit pane, enter the following data:

d) Choose Save.

2. ln the organizational unit, create a position for the chief. Assign the following values:

Field Name Entry

Abbreviation Zpos_head_#*

Field Name Entry

Valid from 04.04.20L2

To 31.L2.9999

Field Name Entry

Abbreviation f or organizational unit zwF oRG #*

Name Organizalional unit group *#

26 @ Copyright. All rights reserved

Page 41: SAP Workflow Bit601 en Col10

Lesson: Introducing Organizational Management and its Use in SAP Business Workflows

Field Name , Entry

Name Position department head ##

a) On the SAP Easy Access screen, choose fools --+ Buslness

Workflow --+ Development --+ Environment --+ Organizational Management --+ Simple

Maintenance -- Organizational Plan Basic Data.

b) Choose the Change pushbutton.

c) Choose Organizational Unit Group ##.

d) Choose the Create pushbutton.

e) ln the Choose Retationship dialog box, double- click lncorporates Position.

f) ln the Details for Position New position pane, enter the following data:

Field Name Entry

Abbreviation for position Zpos_hea.l-_*#

Name Position department head ##

g) Choose Save.

3. ln the organizational unit, create a position for the employee. Assign the following values:

Field Name Entry

Abbreviation zpos_enpl_##

Name Position employee ##

a) Choose Organizational Unit Group ##.

b) Choose the Create pushbutton.

c) lntheChooseRelationshipdialogbox,double-clicklncorporatesPosition.

d) ln the Details for Position New position, enter the following data:

4.

e) Choose Save.

Assign users to the positions as follows:

a) Choose Users in the search area on the left side of the screen.

Field Name

Abbreviation for position Zpos_enpl_#*

Name Position employee ##

Field Name Entry

Department head position BIT6O1-MGR##

Employee position Brr601-*#

@ Copyright. All rights reserved 27

Page 42: SAP Workflow Bit601 en Col10

Unit 1: Workflow Architecture and Organizational Management

b) ln the Find tJser dialog box, enter 811'601-MGR## in the With name field.

c) Choose Find. The user appears in the selection area.

d) Drag and drop the user in the selection area to Posltion department head ## inthemain window.

e) ln the DelimitVacancy dialog box, choose Yes'

f) Choose Users in the search area on the left side of the screen.

g) ln the Find LJser dialog box, enter 811601-## in the With name field.

h) Choose Flnd. The user appears in the selection area.

i) Drag and drop the user in the selection area to Positlon department head ## inlhemain window.

j) ln the DelimitVacancy dialog box, choose Yes.

5. Define Position department head ## as the chief position.

a) Choose Position department head ##.

b) ln the Details for Position department head ## pane, select lhe Head of own

orga ni zati on a I u n it checkbox.

c) Choose Save.

28 @ Copyright . All rights reserved,

Page 43: SAP Workflow Bit601 en Col10

Lesson: Introducing Organizational Management and its Use in SAP Business Workflows

LESSON SUMMARYYou should now be able to:

. Create an organizational unit to define possible and responsible agents in workflow tasks

@ Copyright. All rights reserved

Page 44: SAP Workflow Bit601 en Col10

Unit 1: Workflow Architecture and Organizational Management

30 O Copyright . All rights reserved

Page 45: SAP Workflow Bit601 en Col10

Learning Assessment

1. The Workflow Engine is a tool for automating business processes, which is not tied to anyparticular application and operates uniformly across different applications.

Determine whether this stateme nt is true or false.

True

False

2. The Workflow Engine coordinates all of the tasks involved and provides the user withactive support.

Determine whether this statement is true or false.

True

False

SAP provides several workf low templates that you can use for your specific businessrequirements.

Determine whether this statement is true or false.

True

False

4. lf there is no template that represents your business requirements, contact SAP todevelop the required business scenario.

Determine whether thls stateme nt is true or f alse.

True

False

5. The Workflow Engine provides runtime tools for user interaction, process modeling, andcontrol.

Determine whether this statement is true or false.

True

False

.{lt

T

4I

I|Z

dT

@ Copyright , All rights reserved. 31

Page 46: SAP Workflow Bit601 en Col10

Unit 1: Learning Assessment

ft fhe Workflow Engine uses the SAP Object Builder as a tool for modeling processes and1 creating workflow def initions.

Determine whether this statement is true or false.

7. SAP Workflow supports business processes that run in an SAP system.

Determine whether this sfafeme nt is true or f alse.

True

False

is the tool used to model processes.

Choose the correct answer.

/T

B Workflow Engine

C Workflow design

\ 9. You can maintain substitutes in two ways, that is, a personal substitute or a position\ substitute.

Determine whether this statement is true or false.

True --(J1- vr t-

False

10. Standard tasks call methods of an object type.

Determine whether this stateme nt is true or false

True

False

True ft^,t*

False

o

fi n Workflow Builder

Tn

Tw

d!

32 @ Copyright . All rights reserved

Page 47: SAP Workflow Bit601 en Col10

Learning Assessment - Answers

1. The Workflow Engine is a tool for automating business processes, which is not tied to anyparticular application and operates uniformly across different applications.

Determine whether fhls stafeme nt is true or f alse.

True

False

2. The Workflow Engine coordinates all of the tasks involved and provides the user withactive support.

Determine whether this statement is true or false.

True

False

3. SAP provides several workf low templates that you can use for your specif ic businessrequirements.

Determine whether this statement is true or false.

True

False

4. lf there is no template that represents your business requirements, contact SAP todevelop the required business scenario.

Determine whether this statement is true or false.

True

False

En

ET

ET

TE

@ Copyright , All rights reserved. 33

Page 48: SAP Workflow Bit601 en Col10

Unit 1: Learning Assessment - Answers

5. The Workflow Engine provides runtime tools for user interaction, process modeling, and

control.

Determine whether thls stateme nt is true or false.

True

False

6. The Workflow Engine uses the SAP Object Builder as a tool for modeling processes and

creating workf low def initions.

Determine whether this statement is true or false.

True

False

7. SAP Workflow supports business processes that run in an SAP system.

Determine whether this stateme nt is true or false.

True

False

is the tool used to model processes.

Choose the correct answer.

A Workflow Builder

En

TE

ET

o.

n B Workflow Engine

I C Workflow design

9. You can maintain substitutes in two ways, that is, a personal substitute or a position

substitute.

Determine whether this statement is true or false.

True

False

E!

34 @ Copyright . All rights reserved

Page 49: SAP Workflow Bit601 en Col10

Unit 1: Learning Assessment - Answers

10. Standard tasks call methods of an object type.

Determine whether this statement is true or false.

True

False

En

@ Copyright. All rights reserved.

Page 50: SAP Workflow Bit601 en Col10

Unit 1: Learning Assessment - Answers

36 @ Copyright. All rights reserved

Page 51: SAP Workflow Bit601 en Col10

Lesson L

Def ining Workf low Templatesi Exercise 3: Create a Workflow and a Workflow Definition

3B

49

UNIT OBJECTIVES

. Find workflow templates and tasks in the system

. Create a workflow in the Workflow Builder

. Explain special functions of the Workflow Builder

. Start a workflow

O Copyright, All rights reserved. 37

Page 52: SAP Workflow Bit601 en Col10

Defi ni ng Workflow Templates

LESSON OVERVIEW

This lesson shows you how to define a workflow template.

Business Example

You have designed a workflow template for your business process. To implement theworkflow, you are required to learn about the Workflow Builder and how you can use it tocreate your workflows. For this reason, you require the following knowledge:

. How to find workflow templates and tasks in the system

. How to create a workf low in the Workflow Builder

. How to use special functions of the Workflow Builder

. How to start a workflow

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Find workflow templates and tasks in the system

. Create a workflow in the Workflow Builder

. Explain special functions of the Workflow Builder

. Start a workflow

38 @ Copyright . All rights reserved.

Page 53: SAP Workflow Bit601 en Col10

Lesson: Def i ning Workf low Templates

Workflow Templates and Tasks

F igur e 12: Workf I ow Te m plates

Workflow templates have an internal key with the following structure:. Task abbreviation WS for workflow templates

. A sequentialB-figure number

The system recognizes from the structure of the B-character number whether the template is

a standard template delivered by SAP, or a template that a customer has created'

Customer-def ined templaies start with a prefix defined in Customizing for the system and

client.

Transaction code swu3 contains basic customization options for the SAP Workflow Engine.

@ Copyright. All rights reserved.

Page 54: SAP Workflow Bit601 en Col10

Unit 2: The Workflow Builder

Terminology

Terminology lmplemented in the system

Release>= 4.5

Workflow{business process)

Workflow template (WS)contains referenceto the workflow definition

Task(step in a workflow)

Standard task (TS)enters the workflow definition

Release< 4.5

Multistep task(business process)

WS - Workflow template(cross-clienUtim e-i ndepe ndent)

WF - Workflow task(client-specif ic/tim e-depende nt)

Task(step in a multistep task)

TS - Standard task(cross-client/time-indepe nde nt)

T - Customer task(client-specif icltime-depende nt)

Workflow-controlled business processes are called workflows as of Release 4.5, and multisteptasks before Release 4.5. A single step in a business process that refers to a method of a

business object type is called a single-step task before Release 4.5, and simply a task as ofRelease 4.5.

As of Release 4.5, workflows are created in the system only as workflow templates. BeforeRelease 4.5,you can create workflow templates or workflow tasks.

As of Release 4.5, create individual steps for the SAP R/3 component as standard tasks.Before Release 4.5, you can also create customer tasks.

Workflow templates and standard tasks are cross-client and time-independent. Workflowtasks and customer tasks are client-specific and time-dependent.

Existing workflow tasks can still be executed, but they are no longer being further developed(for more information, see SAP Note 114811).

Figure 13: Termrnology

40 @ Copyright. All rights reserved.

Page 55: SAP Workflow Bit601 en Col10

Lesson: Defining Workflow Templates

Workflow Template and Definition

A workflow template contains the following:. Basic data for the workflow, including instructions for buffering reporting data and

automatic forwarding.

. Specification of triggering events if the specified event occurs in the system. The workflowstarts if the event is actively linked to the workflow.

. lnitial values.

. lnterface specifications (workflow container and event container).

. A link to the corresponding workflow definition, that is, the specification of the individualworkflow steps that are to be executed.

The binding identifies the relevant data required to execute the workflow. lt establishes theconnection between the input data required to execute a task and the output data as theresult of the task, which has to be transferred to the next step in the workflow.

Workf'ow Templates and Wo.kflow Detin tions

@ Copyright. All rights reserved, 4L

Page 56: SAP Workflow Bit601 en Col10

Unit 2: The Workflow Builder

Workflow-Definition - Workflow Builder

Areas wf the t{$*rrkftr*rwr ffiuitdor

AbbreviationVersionslqtus;

Navigationwth st€pgi

Step types;Container; .

Myworktlolvs; .

Documenttemplates; rr

Wizards;Workflowsof thisdeRnition;Note itlleam workrng

Wolkllsw O€finition

D)E{-------l

w+

w

Overview

Messages

Figure 15: Workf ow-Deflnition - Workf ow Builder

The workflow definition is created in the Workflow Builder and displayed graphically in a

network.

The Workflow Builder is subdivided into the following areas:. Display

Display of the abbreviation, version, and the status of the currently displayed workflowdef inition.

. Navigation area with steps

Tree structure showing the sequence of workflow steps, Double-clicking on a step displaysthe corresponding step definition.

. Step types

All available step types for Drag and Drop into the workflow def inition.

. Container

Variables of the workflow interface. Using the context menu, it is possible to create,change, display, delete, and rename container elements.

. My Workflows and Tasks

ln the tasks area, you can display all tasks and workflows that are relevant for yourworkf low, and double-click to transfer them into your workflow def inition.

. Document templates

Here you can create and display existing document templates.

. Workflow Wizards

Displays wizards for modeling steps and workflows.

. Workflows of this Definition

42 @ Copyright. All rights reserved.

Page 57: SAP Workflow Bit601 en Col10

Lesson: Defi ning Workf low Templates

Displays the current runtime instances.

. Team working

Searching for steps according to certain criteria (created or changed by user, created orchanged in release, and created or changed in the period).

. Overview

Displays the whole workflow definition.

. Message

All messages generated in where-used lists and workflow tests are displayed here.

Search Help in the Context of WorkflowThe search help occurs when you enter complete object abbreviations or parts of the objectabbreviations.

The system displays all objects whose abbreviations correspond to the search. When youenter a complete abbreviation, there may also be more than one object. The abbreviationdoes not have to be unique. The uniqueness of an object is implemented by a unique internalkey generated by the Workflow Engine (WS30000015, TS30000016, and so on).

The search help evaluates Customizing. Table f77BL contains the languages that the HR-PDsupports. ln the table T77S0, in the field group SEARK, sm. abbr. LMODE field containsentries, which define the language for the search function.

The LMODE field can contain one of the following entries:. Entry O

The system searches only in the logon language.

. Entry 1

The system f irst searches in the logon language and then in the f irst language from thetableTTTBL, and so on. The search ends as soon as objects are available in the relevantlanguages.

. Entry 2

The system searches for objects in all of the languages from the table f77BL.

Value 1 is the standard delivery.

@ Copyright. All rights reserved 43

Page 58: SAP Workflow Bit601 en Col10

Unit 2: The Workflow Builder

Arrangemenl of steps inseries or in parallelprocessing.

Choose and name thecorresponding outcomefor each step.

lf desired or required:Maintain settings on tabpages for the workflowstep {deadlinemonitoring, conditions,notification, and so on).

Figure 16: Workflow-Definltlon - Steps

The Workflow Definition Process

A workflow definition is made up of individual modular steps. When you create a step in a

workf low definition, specify the step type f irst.

The following step types exist:. Steps that refer to business activities, such as activity, user decision, document from

template, web activity, send mail, and form.

. Steps that are used for internal process control and monitoring, such as condition,multiple condition, loop, fork, container operation, event creator, wait for event, ad-hocanchor, block, and localworkflow.

The steps can be arranged in series or in parallel processing (fork).

The processing sequence of the steps depends on the result of each preceding step,

The possible results of a step are derived from the relevant business function and arespecified in the workflow step on the Oufcomes tab. The system adds another branch to theprocessing chain for each possible outcome.

Depending on their type, all steps and events have certain symbols in the graphical display.

44 @ Copyright . All rights reserved.

Page 59: SAP Workflow Bit601 en Col10

Lesson : Defining Workflow Templates

Functions of the Workflow Builder

Workflow Builder

) Navigation and display area) Block-oriented modeling4 Top-down modeling is possibleI Special functions such as cut,

paste, move, and copy) Print* Check and activate* Drag and Drop function

l._*r er'.]7, Vlork'ow Def i^rL o^ - Funct o^s ol the Wo'nr ow Bu'roer

The Workflow Builder works in blocks.

Each step is the determining element of its block.

Operations in the individual steps always affect the whole block, that is, you can only delete,cut, and paste in blocks.

A block has a start and includes all actions until a common outcome is found.

For example, the stepApprove vacation request can end with the result approved or rejected.Both results have follow-up actions. The follow-up actions still belong to the Approve vacationrequest block and are therefore included in the block operations.

As of SAP ERP 6.0, the step type block exists. Customers can use this step type to define theirown block logic.

ln addition to the general workflow administrator set in Workf low Customizing, anadministrator can also be assigned to each individual workf low in the basic data. To do thisassignment, on the Workf low Builder, choose Goto --- Basic Data ---+ Version-lndependent tabpage ---+ Agents tab page.ln Release 4.6, the assignment is made on the Responsibilities tabpage.

Special Functions in the Workflow Builder

You can use the My Workflows and Tasks view on the left of the object areain the Workf lowBuilder to display task groups. From here, you can double-click to transfer tasks to theworkf low definition.

ln the Workflow Builder, choose Extras -+ Options ---+ View to display or hide certain areas ofthe Workflow Builder in the object area,

Steps types displayed on the left of the screen can be transferred to the navigation area usingdrag and drop. These steps automatically appear in the graphical definition.

O Copyright. All rights reserved.

Page 60: SAP Workflow Bit601 en Col10

Unit 2: The Workflow Builder

Steps types that are rarely used or not used at all can be hidden from the step type display onthe left of the screen. To hide these step types, choose Extras --+ Options --+ Hidden StepTypes.

You can reset the standard settings at any time.

lf a team of people is developing your workf low and you want to obtain an overview of who hasdeveloped what quickly, you can display the Team working views function in the object areaon the left of the screen. Among other things, this function allows you to f ind steps thatbelong to other users.

Workf low modelers can already be viewed in the graphical display using either user-specific orcustomer-specific block views. ln the Workflow Builder, chooseExtras--- Options --+ View ---+ Block Display-* User-Specific/Customer-Specific View.

Enable Top-Down Modeling

You use the following settings for top-down modeling:. Use Extras---, Options --+ Default Seftlngs to activate top-down modeling in the Workf low

Builder,

. The settings allow you to perform top-down modeling without specifying particular tasks.

. The steps are filled with placeholders that you have to replace in succession.

. You cannot perform a real runtime test with placeholders.

Top-down modeling, which you have to explicitly activate, allows you to use your workflowchart to implement the workflow steps without having to create tasks. To do this, on theWorkf low Builder, choose Extras ---+ Options ---+ Default Settlngs -- Use Top-Down Modelling.

Here you can define the process and fill the individual steps with specific values.

The task that you must use for this is TS3O1OO074, WF_MODTASK.

Starting a Workflow

You can start a workflow in the following ways:. For test purposes

" Iest (FB) pushbutton in the Workflow Builder.

- On the SAP EasyAccess screen, choose lools --+ BuslnessWorkflow --+ Development --+ Runtime Tools --, Test Workflow to call the test transactionswus directly.

. Using events

- Applications trigger events.

- Workflows are actively linked to events.

. Using a start form based on a DDIC structure

. Using function modules

. Using transaction code swur (workflow toolbox)

ln test transaction swus, you .un ,uu" input test data for a workflow as of Workflow Release

6.10 and reload this data for another test. You can also supply ad hoc agents directly.

46 @ Copyright. All rights reserved.

Page 61: SAP Workflow Bit601 en Col10

Lesson: Defining Workflow Templates

ln Release 4.6, you can also create start transactions. You can enter the generated start

transaction in your favorites and then use it to start the corresponding workflow. As of

Workflow Release 6.20, you can no longer create a start transaction. Start transactions are

being replaced with start forms. Existing start transactions are displayed on the Start Forms

tab in the basic data of the Workf low Builder.

Workflows are started using application events by default. For example, a material is changed

in transaction MMo2. The application triggers the event Material changed, A vacation request

is created. The application triggers the event Vacation request created.

Workflow Toolbox

The transaction code swur displays a list of small sample workflows (toolbox principle).

You can start the workflows and test them live.

Call the Workflow Builder and view the technical details for the workflow.

ln contrast to the transaction code swus, which displays all the workflows in the system to

any authorized user, the transaction code swur displays only the workflows in which the

current user is explicitly named as a possible agent or that have been created as general

tasks. ln the basic data of a workflow, you can choose the Ageni Assignment for Task

pushbutton to maintain the possible users of a workflow.

tlrrife* c*!;r ;f 3***r lt&:re

Figure 18: Workflow Too box

O Copyright . All rights reserved. 47

Page 62: SAP Workflow Bit601 en Col10

Unit 2: The Workflow Builder

.fut- tg 'rriirJ' a{t,rck

,, i.. ?i'-t ''ffrr.{ 1 r',1( 4

,^1,r 4 w wwo ,llLu

f'^ \' 1"

iutt

k,-vtw 'D 1 r' "'r r''i \

{t^,r|. t)-a

IU.P ia rF | |

I

I

I

'U.- / .')'\ r?l u

I\/.A.,(kY 7i lr I /

'1-

U( i'o^ i)r'J r V/v ''

"-\ ''I:t']r {

. v,*r1 v":{,1ry:)' TAo' 1L-

^ ),i\-i\\A,l ,. ' -1 \' \ ,^ d{ -r x{.ie Z)4V,^l

@:4,'Cr''sf t Y- 1

,i i' iNrcsd(tlLtf fi+ tt

g\tz\ 'U

'.j Jt' 6".\

;.^ ri ^^\

, ,-,4 p ,tgh"-r'w- liru rrf'1 hle'

jv't"tY

LJI ;<i4,t'-,

t

\ ,- -=-"

! L"[l?, tri\tr Sth'tt'i1-, {- |

n^r.f*)l

), ="^\/--='

\r,'"n,'Ptt tiP-^het"'

() v' \' l)- ;).'&t

S1ng Llv-',1. ,t bo

.1,. ^ .**,^a*,i'.t.t'* L\\.vl J

lr/n-n A 1,.q/Fs + \onr'

?(icllrts'"-" --.

{I

"'\!elv1 tryn '"-'!- ,)^,

@ Copyright . All rights reserved,

nA r jv #oo. lo .t+t

\.

t,t \

'tru n"t tilji,4'ric

'wl

)1ag

n+;tl"J

cr- L

Page 63: SAP Workflow Bit601 en Col10

Create a Workflow and a Workflow Definition

Business Example

You have designed a workflow scenario and now want to use the Workf low Builder to create a

workflow template.

Task Ilmplement a workflow-controlled business process.

When editing a workflow template, you create the workflow definition, which is processed

when the workflow is executed. While the basic data of the workflow represents the external

relationship (triggering events, for example), the workf low definition describes a business

scenario as a sequence of linked steps.

ln the following, create a workflow template for your workf low, which starts as soon as

changes are made to a material. Since you have not yet def ined the required tasks, but you

want to tesi the workflow template, integrate two user decisions into your workflow def inition

1. As user BlT601-## (where ## isyour group number), create a workflow template.

Enter the f o I lowi ng abbreviation : zwF_TEsr1-# #

Enterthefollowingname:workftow material master change group ##

Place the object into package zOOt and when prompted by the system, create a new

request with erre or-## as the short description.

Task 2

Create a user decision.

Since no tasks are available yet, you

workflow definition.

At the beginning, the Workflow Builder displays an initial workflow definition with a default

structure.

The default structure consists of the following:

. Two symbols indicating the start and end of the workflow definition

. One undefined step

1. Create the user decision as the first step in the workflow definition after the workflow is

started.

Enter the following data:

Field Name Entry

Title t'lateria1 master change ok?

should now incorporate a user decision into your

@ Copyright. All rights reserved 49

Page 64: SAP Workflow Bit601 en Col10

Unit 2: The Workflow Builder

Field Name Entry

Decision Texts Change ok

Change not ok

Outcome Name okay

not_okay

2. Determine the agent responsible for the step. Use the F4 help to choose the position forthe employee BlT601-## as a responsible agent.

3. Check the change that you made in the Workflow Builder.

4. Activate your workflow definition.

Task 3

Test your workflow.

Display the work item in a parallel session in the Business Workplace. To do this, open another

session and go to the Business Workplace.

Arrange the windows so you can see both at the same time.

1. Start the workf low to test it and open a second session.

Task 4

After you start the workflow template, you are asked to make one of the following decisions:

Change ok, Change not ok, or Cancel and keep work item in inbox.

You defined lhe Change ok and Change not ok decisions in the User Decision step. The system

automatically generates the Cancel and keep work item in inbox decision'

Do not specify any other decision.

1. Call the Business Workplace of the user in a second session.

2, Return to the decision step in the first session and specify that it is not okay to change.

3. Switch to the second session and check the worklist of the Business Workplace. lf it

contains a work item, do not execute the work item. Refresh the inbox'

Task 5

Go from the test environment back to the Workflow Builder in change mode to add anotheruser decision to your workf low def inition. lf you choos e Change not ok, a work item is sent to

the manager. The work item contains a user decision again.

1, Enter a second user decision into your workflow definition. This step is to be specified for

the undefined step immediately after the not- okay event following the first user decision.

Field Name Entry

Title l"tateria]- master change not okay

Decision Texts Back to changer

50

Enter the following data:

@ Copyright. All rights reserved

Page 65: SAP Workflow Bit601 en Col10

Lesson: Def ining Workf low Templates

Field Name Entry

Terminate workflow

Outcome Narne Back

End

2. The agent for the user decision should be the position of your manager, BlT601-fMGR##.

Task 6

Activate and test your workflow def inition.

1. Activate your workflow def inition.

2. Start your workflow and test your modified workf low definition. After you select Change

not okay in the f irst decision step, call the Business Workplace of the manager. Execute

the work item and choose Backto changer.

Task 7

Check the workflow log for your workflow and check the execution steps of your workflow.

1. Callihe workflow log.

@ Copyright . All rights reserved, 51

Page 66: SAP Workflow Bit601 en Col10

Unrt 2: The Workflow Builder

Hint:The Workflow Log screen contains the following tab pages:

. Workflow Chronicle View

. Workflow Agents View

- Workflow Objects View

Workflow Chronicle View

This view shows all the steps in a workflow that have already been processedor are currently pending, as well as subworkflows.

By choosing the Details function for a step, you can find out the following:

. Who carried out which detailed actions on this work item and the result ofthe action

. When this action was executed

. Which objects were affected

This view is used to determine which activities were carried out. The Agentsfunction displays the possible agents and selected agents for a step. TheGraphic function displays the graphical workflow log.

Workflow Agents View

This view shows the employees that were involved in this workflow up to now.

A list is displayed for each employee indicating the following:

. Which action was carried out for which step

. When this action was executed

. Which objects were affected

This view mainly indicates the role an employee has played in executing a

workflow.

Workflow Objects View

This view lists the objects that are related to the workflow or that have beencalled up to now when the workflow was executed.

These objects are:

. The first object of the workflow.

52 @ Copyright. All rights reserved

Page 67: SAP Workflow Bit601 en Col10

Lesson: Def ining Workflow Templates

Attachments and objects that have been added to individual steps within aworkflow.

list is displayed for each object indicating the following:

Who carried out which detailed action for which task

. When this action was executed

This view indicates which information has been generated as how it

was generated and processed.

Select these tabs and functions to check the details of your workflow.

@ Copyright, AII rights reserved 53

Page 68: SAP Workflow Bit601 en Col10

Create a Workflow and a Workflow Definition

Business Example

You have designed a workflow scenario and now want to use the Workf low Builder to create a

workflow template.

Task Ilmplement a workflow-controlled business process,

When editing a workflow template, you create the workf low definition, which is processedwhen the workflow is executed. While the basic data of the workflow represents the externalrelationship (triggering events, for example), the workflow definition describes a businessscenario as a sequence of linked steps.

ln the following, create a workflow template for your workflow, which starts as soon as

changes are made to a material. Since you have not yet defined the required tasks, but youwant to test the workflow template, integrate two user decisions into your workflow definition.

L. As user 8lT601-## (where ## is your group number), create a workflow template.

Enter the fo I lowi ng abbreviation : zwF_TEsr1_##

Enterthefollowingname: workflow material master change group ##

Place the object into package zoot and when prompted by the system, create a new

request with Brr601-## as the short description.

a) On the SAP EasyAccess screen, choose fools -* BusinessWorkflow ---+ Development --> Definition too/s --+ Workflow Builder ---+ Workflow Builder:CreateWorkflow (transaction swoe) to callthe Workflow Builder.

b) On lhe Workf low Builder - Create 'Unnamed' screen, save the data.

c) ln the Give your new workflow template a name here dialog box, enter the followingdata:

Field Name Entry

Abbr. Z}IF TEST1 #*

Name Workflow rnaterial- master changegroup #*

Choose Ihe Continue pushbutton.

ln the Creafe Object Directory Entry dialog box, enter zool in the Package field.

Save the data.

ln the Prompt for transportable Workbench request dialog box, choose the CreafeRequest pushbutton.

d)

e)

0

s)

54 @ Copyright , All rights reserved.

Page 69: SAP Workflow Bit601 en Col10

Lesson: Defining Workflow Templates

h) ln the Create Request dialog box, enter 811601-## in the Short Description field.

i) Save the data.

j) ln the Prompt for transportable Workbench request dialog box, choose the Continuepushbutton.

Task 2

Create a user decision.

Since no tasks are available yet, you should now incorporate a user decision into yourworkflow definition,

At the beginning, the Workflow Builder displays an initial workflow definition with a defaultstructure.

The default structure consists of the following:

. Two symbols indicating the start and end of the workf low definition

. One undef ined step

1, Create the user decision as the f irst step in the workflow def inition after the workflow isstarted.

Enter the following data:

a) Double-click the first undefined step in the basic screen of the Workflow Builder.

b) ln the Sfep Se/ectlon dialog box, double-click User Decision.

c) On the Workflow Builder - Change 'ZWF_TESTI_##' screen, enter the following data:

Determine the agent responsible for the step. Use the F4 help to choose the position forthe employee BlT601-## as a responsible agent.

a) ln the Agents section, choose Position.

2.

Field Name Entry

Title Material master change ok?

Decision Texts Change ok

Change not ok

Outcome Name okay

not_okay

Field Name Entry

Title Material master change ok?

Decision lexts Changre ok

Change not ok

Outcome Name okay

not_okay

@ Copyright . All rights reserved 55

Page 70: SAP Workflow Bit601 en Col10

Unit 2: The Workflow Builder

b) ln the field beside Position, enter zpos empl ##.

Note:

Since there is only one position with this abbreviation, it is transferredautomatically.

c) Go back to Ihe Workflow Builder - Change 'ZWF_TESTI_##' screen.

3. Check the change that you made in the Workflow Builder.

a) The Materialmaster change ok? is the first step in the workflow. This step is followedby an exclusive OR, leading to two events okay and not_okay. Depending on thedecision of the user, the workf low continues in lhe okay or not_okay branch.

4, Activate your workflow definition.

a) On lhe Workflow Builder - Change 'ZWF_TESTI_##'screen, choose lhe Generate andactivate runti me version pushbutton.

b) You should receivethemessageWorkfl-ow defj-nition saved and activatedsuccessfully.

Task 3

Test your workflow.

Display the work item in a parallel session in the Business Workplace. To do this, open anothersession and go to the Business Workplace.

Arrange the windows so you can see both at the same time.

1.. Start the workflow to test it and open a second session.

a) On IheWorkflow Builder - Change'ZWF_TESTI_##'screen, choose the festpushbutton.

b) On the fest Workflow screen, in the menu bar, choose Sysfem --+ Create Session.

c) Arrange the windows so that you can see both at the same time.

d) Switch back to the f irst session.

e) ln the menu bar, choose Environment ---+ Refresh Organizational Environment or youcan choose the Refresh arganizational Environment pushbutton.

Note:

The number of your workflow template should be displayed inlhe Workflowfield.

f) ln the menu bar, choose Workflow --+ Execute or you can choose the Executepushbutton.

Task 4

After you start the workflow template, you are asked to make one of the following decisions:Change ok, Change not ok, or Cancel and keep work item in inbox.

56 @ Copyright . All rights reserved

Page 71: SAP Workflow Bit601 en Col10

Lesson: Def i ning Workf low Templates

You def ined lhe Change ok and Change not ok decisions in the User Decision step. The system

automatically generates the Cancel and keep work item in inbox decision.

Do not specify any other decision.

1. Call the Business Workplace of the user in a second session.

a) Switch back to the second session.

b) On the SAP Easy Access screen, choose Office -- Workplace or you can choose theSAP Busines s Workplace pushbutton.

c) On the Buslness Workplace of 8lT60l-## screen, choose lnbox -- Workflow.

A work item is displayed.

2. Return to the decision step in the first session and specify that it is not okay to change.

a) Switch back to the first session.

b) On the Declsion Sfep in Workflow screen, choose lhe Change not ok pushbutton.

3. Switch to the second session and check the worklist of the Business Workplace. lf itcontains a work item, do not execute the work item. Refresh the inbox.

a) Switch back to the second session.

b) lf the work item is still displayed, choose Folder ---+ Ref resh from the menu of theBusiness Workplace to refresh the inbox.

Task 5

Go from the test environment back to the Workflow Builder in change mode to add anotheruser decision to your workflow definition, lf you choose Change not ok, a work item is sent to

the manager. The work item contains a user decision again.

1. Enter a second user decision into your workflow definition. This step is to be specified forthe undef ined step immediately after the not- okay event following the f irst user decision.

Enter the following data:

Field Name Entry

Title t'Iaterial master change not okay

Decision Texts Back to changer

Terninate workflow

Outcome Name Back

End

a) Switch back to the first session.

b) Go back to the Workflow Builder - Change 'ZWF-TESTL-##'screen.

c) Choose the not-okay outcome.

d) Choose theCreate step pushbutton.

e) ln the Step Se/ection dialog box, double-click User Decision'

f) On the Workftow Builder - Change'ZWF-TESTI-##'screen, enter the following data:

O Copyright . All rights reserved. 57

Page 72: SAP Workflow Bit601 en Col10

Unit 2: The Workflow Builder

Field Name Entry

Title Material master change not okay

Declslon fexts Back to changer

Terminate workflow

Outcome Name Back

End

2. The agent for the user decision should be the position of your manager, BlT60i-MGR##.

a) ln the Agents section, choose Position.

b) ln the field beside Position enter, zpos head ##.

fu,, Note:

Ff' ' Since there is only one position with this abbreviation, it is transferredautomatically.

c) Go back lolheWorkflow Builder - Change'ZWF-TESTL-##'screen.

Task 6

Activate and test your workflow definition.

1. Activate your workflow definition.

a) On the Workf low Buitder - Change 'ZWF_TESTI-##' screen, choose lhe Generate and

activate runti me version pushbutton.

2, Start your workflow and test your modified workflow definition. After you select Change

not okay in the f irst decision step, call the Business Workplace of the manager. Execute

the work item and choose Back to changer.

a) On theWorkflow Builder - Change'ZWF-TESTI-##'screen, choose the lestpushbutton.

&.:r', Note:The number of your workflow template should be displayed inlhe Workflowfield.

b) ln the menu bar, choose Workflow -+ Execute or you can choose the Execute

pushbutton.

c) On the Decision Step ln Workflow screen, choose lhe Change not ok pushbutton.

d) Log on as managerBrr6ol-MGR##.

e) On the SAP EasyAccess screen, choose Office -+ Workplace or you can choose the

SAP Buslnes s Workplace pushbutton.

f) On the Buslness Workplace of 8IT601-## screen, choose Inbox -+ Workflow.

58 @ Copyright. All rights reserved

Page 73: SAP Workflow Bit601 en Col10

Lesson: Defining Workflow Templates

g) Double-click to execute the work item or select the work item and choose the Executepushbutton.

h) On the Declslon Sfep in Workflow screen, choose the Back to changer pushbutton.

Task 7

Check the workflow log for your workflow and check the execution steps of your workflow.

1. Call the workflow log.

@ Copyright . All rights reserved. 59

Page 74: SAP Workflow Bit601 en Col10

Unit 2: The Workflow Builder

Hint:The Workflow Log screen contains the following tab pages:

. Workflow Chronicle View

. Workflow Agents View

. Workflow Objects View

Workflow Ghronicle View

This view shows all the steps in a workflow that have already been processedor are currently pending, as well as subworkflows.

By choosing the Details function for a step, you can find out the following:

. Who carried out which detailed actions on this work iiem and the result ofthe action

. When this action was executed

. Which objects were affected

This view is used to determine which activities were carried out. The Agentsfunction displays the possible agents and selected agents for a step. The

Graphic function displays the graphical workflow log.

Workflow Agents View

This view shows the employees that were involved in this workflow up to now.

A list is displayed for each employee indicating the following:

. Which action was carried out for which step

. When this action was executed

. Which objects were affected

This view mainly indicates the role an employee has played in executing a

workflow.

Workflow Objects View

This view lists the objects that are related to the workflow or that have beencalled up to now when the workflow was executed.

These objects are:

. The first object of the workflow.

60 @ Copyright . All rights reserved.

Page 75: SAP Workflow Bit601 en Col10

Lesson: Defining Workflow Templates

Attachments and objects that have been added to individual steps within a

A list is displayed for each object indicating the following:

. Who carried out which detailed action for which task

. When this aciion was executed

This view indicates which information has been generated as well as I

was generated and processed.

select these tabs and functions to check the details of your workflow.

a)

b)

Switch back to user BlT601-##.

On the Test Workflow screen, choose Ihe Workflow Log pushbutton'

@ Copyright . All rights reserved. 61

Page 76: SAP Workflow Bit601 en Col10

Unit 2: The Workflow Builder

,, . ,. ,.,, .i:l.rrrili'

.,,::,.i,; LESSON SUMMARY' ,'l:,.'- you should now be able to:

. Find workflow templates and tasks in the system

. Create a workflow in the Workflow Builder

. Explain special functions of the Workflow Builder

. Start a workflow

62 @ Copyright. All rights reserved

Page 77: SAP Workflow Bit601 en Col10

Learning Assessment

Choose the correct answers.

Cross-client

Time-independent

1. Which of the following options are true regarding workflow templates and standard tasks?

{nffa

vv) t\

I C Client-specific

I D Time-dependent

Which of the following statements are true regarding steps?

Choose the correct answers.

f n Steps can only be arranged in sequential processing. x

ff a The processing sequence of steps depends on the result of each preceding step.

C Depending on the type, all step types have different symbols in the graphical

display.

\. yo, can use the Teamworking area in the Workflow Builder to find steps according to the

,t user who created or changed them'

Determine whether this stateme nt is true or false'

{u*.

4. You can start a workflow using which of the following techniques?

Choose the correct answers.

ff n Using the Test pushbutton

Using the Agent Assignment for Task pushbutton

Using events triggered by the application

Using function modules

2.

f rrue

Q/rutt"

!Bffcffo

@ Copyright , All rights reserved

Page 78: SAP Workflow Bit601 en Col10

Learning Assessment - Answers

Which of the following options are true regarding workflow templates and standard tasks?

Choose the correct answers.

Cross-client

Time-independent

Client-specif ic

Time-dependent

2. Which of the following statements are true regarding steps?

Choose the correct answers.

! n Steps can only be arranged in sequential processing.

EEnT

B

c

D

E B The processing sequence of steps depends on the result of each preceding step.

C Depending on the type, all step types have different symbols in the graphical

display.

3. you can use the Teamworkingarea in the Workflow Builder to find steps according to the

user who created or changed them.

Determine whether thls stateme nt is true or false.

True

False

Ef

64 @ Copyright. All rights reserved.

Page 79: SAP Workflow Bit601 en Col10

Unit 2: Learning Assessment - Answers

4. You can start a workf low using which of the following techniques?

Choose the correct answers.

f n Using the Test pushbutton

I B Using the Agent Assignment for Task pushbutton

E C Using events triggered by the application

E D Usingfunctionmodules

O Copyright. All rights reserved,

Page 80: SAP Workflow Bit601 en Col10

Unit 2: Learning Assessment - Answers

66 O Copyright . All rights reserved

Page 81: SAP Workflow Bit601 en Col10

.ll

Lesson 1

Explaining the Structure and Use of the Business Object Repository and Business Object TypesExercise 4: Use the Business Object Builder

Lesson 2

Adjusting Standard Object Types to Suit Customer Requirements

Exercise 5: Create and Extend a Subtype and Define a Delegation

UNIT OBJECTIVES

. Evaluate business objects in the BOR and use them in an SAP business workflow

. Adjust standard object types to suit customer requirements

6B

77

B1

93

@ Copyright . All rights reserved. 67

Page 82: SAP Workflow Bit601 en Col10

Explaining the Structure and Use of theBusiness Object Repository and BusinessObject Types

LESSON OVERVIEWThis lesson explains the structure and the use of the Business Object Repository (BOR) andthe business object types.

Business Example

During your initial workflow design activities, you discover that SAP does not support all therequired functional steps with standard tasks. To create your own task, you want to knowmore about the basic components of a task. For the Workflow Engine, an object type is thebasis for all the standard tasks. For this reason, you require the following knowledge:

. An understanding of the use of the BOR

. An understanding of the difference between an object and an object type

. An understanding of the use of object types in workflow

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Evaluate business objects in the BOR and use them in an SAP business workflow

68 @ Copyright . All rights reserved

Page 83: SAP Workflow Bit601 en Col10

Lesson: Explaining the Structure and Use of the Business Object Repository and Business Object Types

Structure and use of Business object Types in sAP Applications

Business objects enable access to object data over a standardized interface. The internal

structure of the data remains hidden in the database'

A business object is described by the following elements:

lnformation about the various ways to access data in SAP systems is covered in the overview

course BlT100.

Elernent Description

Object lD Unique lD of the object tYPe

Key field Unique identifier of the object at runtime

Object name Unique name of the object tYPe

Components Differentiated internal structure elements of

the object

Aitribute Property of an object

Methods Operations that are to be performed on an

object, which enable editing of an object

Events The states that an object can adopt. For

example, created, deleted, and changed

@ Copyright , All rights reserved 69

Page 84: SAP Workflow Bit601 en Col10

Unit 3: Business Obiects and the Business Object Repositiory

Business Object Repository (BOR)

%*

The ArchiveLink lnterface

The BOR is a central repository within the SAP system that contains all the SAP businessobject types and SAP interface types together with their definitions and methods.

Application developers develop object types and store these business objects in the BOR. Usethe Business Object Builder to edit these objects.

BAPls, which are used to call external funciions from the SAP system, are methods of abusiness object type.

ln the SAP Workflow, you access the data of an object using the corresponding methods ofthe obtect type.

SAP Archive Link, the component used for storing documents in an archive system and

linking them to business objects, it also uses business object types.

To display the Business Object Builder, on the SAP Easy Access screen, chooseIools -* Buslness Workflow --+ Developmefit ---+ Definition too/s -- Applicationlntegration --+ Buslness Object Builder.

The Business Obiect Repository pushbutton enables you to search for a specific componentbased on an application component to which it belongs.

Each business object type is implemented using an ABAP program. Use the Programpushbutton in the BOR maintenanc e area to call the implementation program for the object

type.

While displaying a business object type, choose Utilities ---+ Color legend to understand thevarious symbols and colors that appear when you display an object type in the Business

Object Builder.

'jl-gF---------rrm

Business tl TWorkflow ffi ffi IJllt-i

ffilffi

\\6D\

"o,,@9 6;!--\-{9{BAPI]

@Modeling

Figure 20: Business Oblect Repository (BOR)

70 @ Copyright. All rights reserved

Page 85: SAP Workflow Bit601 en Col10

Lesson: Explaining the Structure and Use of the Business Object Repository and Business Object Types

Examples of Object Types

The SAP Workf low Engine is modeled around an object-oriented approach.

The object type notification of absence, for example, is implemented as follows:

. Key

Number of the notification of absence

. Attributes

Created by, entered on, and status

. Methods

Create, approve, edii, and delete

. Events

Created and deleted

Objects are specif ic instances of an object type that can be identified by a unique key, for

example, the notification of absence using the key 2000, or the notification of absence using

the key 2010.

Object types and their components are each assigned one of the following four statuses:

SAP object types

r lnvoice

r Sales order

r Deliiery notg,

r Material

r Bill of material

External documents ' ..

r Archived documents:''.

r Purchase order lDoc

(BSEG*MMrV)

{8U52032)

(LrKP)

{8US1001}

tBUSloo2)

..............

;,,{roAvo)

{rDocoRDERS)

,.::,* Figure 21: Examples of Object Types

Status Description

Modeled There is not yet a program for the objecttype.

lmplemented The program of the object type can be called,

but the implementation cannot be

considered yet to be fully completed'

Released The program of the object type can be called

by anyone.

O Copyright . All rights reserved.

Page 86: SAP Workflow Bit601 en Col10

Unit 3: Business Objects and the Business Object Repositiory

Status Description

Obsolete The object type or the component has beenpermanently replaced by a different objecttype or another component. ln this case,read the documentation for the object toascertain which object type or componentyou should use in future.

IClass I Specialization

I lnstances

Objec!,

l:,ga,9.srEri,i!:liliiil]r:rllli?ildtiir,2r:rrltltl]iitriiitilr|ir:l rl

Pasieng6is:'.5Fieight:.20okg

it.l,:: f ,grt. 22: Oblect Type and Instance

Object Type and Object lnstance

Object types or classes describe an abstract business object, including its characteristics or

attributes, methods, and events. The figure displays the Aircraft object type.

Specific objects are instances of the object type.

You can derive subtypes from object types. Subtypes inherit all the characteristics orattributes, methods, and events of the original object type. You can add attributes, methods,and events to subtypes. ln the figure object type and instance, Cargo plane and Passengerplane are subtypes of the Aircraft object type.

At present, SAP business objects do not directly support multiple inheritance. However, SAP

provides general interfaces. An object type can implement any number of these interfaces.

Business object instances contain actual data, for example, a sales order. An object type can

have any number of instances. The lower part of the figure displays specific instances of theCargo plane and Passenger plane object types, whose keys may be used for uniqueassignment.

72 @ Copyright. All rights reserved

Page 87: SAP Workflow Bit601 en Col10

Lesson: Explaining the Structure and Use of the Business Object Repository and Business Object Types

Addressing lnstances in the Workflow

When a workflow is executed, each object in the workflow has a specific instance, which canbe used to access the attributes (for example, material number, material description, andmaterial type in the figure) and object methods (for example, create, display, change, anddelete in this figure) in the workf low.

ln the interface of the task currently being executed (a step in the workflow, which executesmethods); the object instance is always addressed using the _Wl_OBJ ECT_ID variable.

The interface of the workflow currently being executed does not have a unique name for theobject instance. As soon as you create a workflow task in the Workflow Builder, the systemcreates an element automatically in the workflow interface. This element represents theobject reference. The name refers to the object type in the BOR. You assign the name if youcreate an element in the interface.

The current object is always addressed in the interface using this element, and not using thekey fields of the object type.

At runtime, object references contain the pointer to the specificobject currently being processed in the workflow.

Object being processedfor example, materialwith number P-100

Material number: P-100Material descriptionMaterial typeMaterial group

DisplayGhangeDelete

,,,111 p gxr" 23: Addressing lnstances in the Workflow

Workflow instance

lnterlaceContains the objectreference

Object reference name:

Assigned by lhe system<Object nam€> oftheobjecttype in BOR

Assigned by theWorkflow Designer:

<user.defined name>

Workflow step{task)

lnterfaceContains the objectreference

Object reference name:

*wLoBJECT_rD

@ Copyright. All rights reserved, 73

Page 88: SAP Workflow Bit601 en Col10

Unit 3: Business Objects and the Business Object Repositiory

Business Objects in a Workflow

Usually, events start workflows. The events defined in the BOR can act as triggering events,but events can also complete workflow steps. These events are known as terminating events.

Tasks call the object type methods and therefore determine the function executed at runtime.

You can use attributes in steps (for example, conditions and loops) and also in texts (forexample, work item text and the long texts for a task).

You can change the definition of objects without having to modify workflow definitions.

Material Workf low BlT6OL

r. Event ' t'\D)rrigserinn 7g-q\ event ,'1H\-ffinffiil;:-*

&t\l\ I Workflow manaoer

.., i TerminatinS +

ry3'// \event ffi*:%effi-i ---.>ffi Work item tl_,_lg{ I Ft B!t(i.-w\= ] lWorkitem

mFG\ *l*K8;manaser\ ffoji " ffi1^n lj.+q ' ilrv H -,' Fl executed ki*,,,,,4 / t&*,**-*a}='7>'-- I

Figure 24. Objects in the Workflow

of change documents

Check tableTO24L

lmport parameterfor role

Ev€ntzBus100't,Old Material

triggers

'*_changed

Orq-PlanEngineering unilFioductManagementunit ::::-::::'

Product Manager Position ;ffiffit;the

Workflow

Holder: Jones Task 1: Display:Change Documenls

Task 2: Display,,Mateiial':

AgentHolder: Randol

Rule "ldentify agent responsible for material group 001 "

Figure 25: Material Workflow BlT6Ol

74 @ Copyright. All rights reserved

Page 89: SAP Workflow Bit601 en Col10

Lesson: Explaining the Structure and Use of the Business Object Repository and Business Object Types

To implement your business process using a workflow, perform the following steps to

first check that you have all the required business objects:

L. First use the structure search using the Buslness Object Repository pushbutton in the

transaction swol to find a standard object type for material.

2. Check the attributes, methods, and events of the standard object type to see whether all

the required comPonents exist.

3. The dummy workflow in course BlT601 uses a Display change documents method and a

Material change event. None of these exists in your standard Y##MARA (## represent the

group number) object type. Since your workf low requires components in addition to the

ones provided by SAP, you need to create a subtype.

@ Copyright. All rights reserved. 75

Page 90: SAP Workflow Bit601 en Col10

Unit 3: Business Objects and the Business Object Repositiory

/6 O Copyright , All rights reserved.

Page 91: SAP Workflow Bit601 en Col10

Use the Business Object Builder

Business Example

During your f irst workflow design activities, you establish that SAP does not support all ofyour required functional steps with predefined standard tasks. To create your own task, youneed to know more about the basic components of a task. ln workf low, an object type is thebasis for all tasks.

ln this scenario, check the material master business object type y##MARA (derived fromBU51001).

The BOR contains all the object types defined in the SAP system. These object types are animportant basis for workflow modeling. Therefore, f amiliarize yourself with navigating in theBusiness Object Builder.

1. Find the Y**!4ARA business. object type for your group. What is the current status of thisobject type? *pWy.,l

2, Test the Edit method for your r-eeo*# material (## represents your group number).Change the values in the O/d Material Number (View: Basic Data -1) and Lab/Office (View:Basic Data 2) fields. Enter any value for the O/d material number field. Enter e## in theLab/Office tield.

@ Copyright . All rights reserved

Page 92: SAP Workflow Bit601 en Col10

Use the Business Object Builder

Business Example

During your first workflow design activities, you establish that SAP does not support all ofyour required functional steps with predefined standard tasks. To create your own task, you

need to know more about the basic components of a task. ln workflow, an object type is the

basis for all tasks.

ln this scenario, check the material master business object type v##uana (derived from

BUS1001).

The BOR contains all the object types defined in the SAP system. These object types are an

important basis for workflow modeling. Therefore, familiarize yourself with navigating in the

Business Object Builder.

1.. Find the v*#uana business object type for your group. What is the current status of this

object type?

a) On the SAP EasyAccess screen, choose Iools --+ Business

Workflow --+ Development ---+ Definition fools --+ Application lntegration ---+ Business

Object Builder.

b) On the Buslness Object Builder: !nitiat Screen, enter Y**I4ARA inlhe Obiect/lnterface

Type field.

c) Choose the Display pushbutton.

d) On the Display Object Type Y##MARA screen, choose the Basic Dafa pushbutton.

e) On the Oblect Type Y##MARA: Disptay Basic Data screen, display the current status o{

the object type in the Obi. type status field.

f) Choose Back lo return to the Dlsp/a y Obiect Type Y##MARA screen,

2. Test the Edit method for your T-BBD## material (## represents your group number).

Change the values in the O/d Material Number (View: Basic Data 1) and Lab/Office (View:

Basic Data2) f ields. Enter any value for the O/d material number field. Enter e## in the

Lab/Office field.

a) on the Display object Type Y##MARA screen, choose Edit ---, Test/Execute.

b) On the fest Object Type Y##MARA; NO Instance screen, choose Ihe Create instance

pushbutton.

c) ln the BUS|OO|_Groupnr_## dialog box, enter r-eep#* inthe Material field.

d) Choose Continue.

e) On the fest Obiect Type Y##MARA screen, choose the ED|I node.

f) Choose the Execute Method pushbutton.

78 @ Copyright. All rights reserved.

Page 93: SAP Workflow Bit601 en Col10

Lesson: Explaining the Structure and Use of the Business Object Repository and Business Object Types

g) On the fest Method EDIT: Maintain Input Parameters screen, choose the Execufe

pushbutton.

h) On lhe Change Material (tnitial Screen), choose the Se/ect view(s) pushbutton.

i) ln the Se/ect View(s) dialog box, choose the row with Basic Data l in the View f ield.

j) Choose Continue.

k) On the Change Material T-BBD## (Semi-finished product) screen, enter the following

data on the Baslc data ltab page.

Field Name Entry

Old materialnumber Any value

Lab/Office c##

l) Choose Save.

@ Copyright. All rights reserved

Page 94: SAP Workflow Bit601 en Col10

Unit 3: Business Objects and the Business Object Repositiory

i lt,ill,.: LESSON SUMMARY''r'r;; ' You should now be able to:

. Evaluate business objects in the BOR and use them in an SAP business workflow

80 O Copyright . All rights reserved,

Page 95: SAP Workflow Bit601 en Col10

Adjusting Standard Object Types to SuitCustomer Requirements

LESSON OVERVIEWThis lesson explains the different components of object types and the creation and use of a

subtype in standard applications using delegation.

Business Example

During your initial workflow design activities, you discover that SAP does not support all therequired functional steps with standard tasks. To create your own task, you want to know

more about the basic components of a task. For the Workflow Engine, an object type is the

basis for all standard tasks. You can enhance the standard object types available in SAP to

suit your requirements. For this reason, you require the following knowledge:

. An understanding of subtypes and delegation

. An understanding of the elements and basic data of an object type

. An understanding of attributes of objects

. An understanding of methods

. An understanding of event

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Adjust standard object types to suit customer requirements

@ Copyright , All rights reserved

Page 96: SAP Workflow Bit601 en Col10

Unit 3: Business Objects and the Business Object Repositiory

Subtype and Delegation

The analysis of an existing object type resulted in a need for additional attributes, methods,

and events. You can use a subtype definition to adjust the object type in the customer

namespace.

The subtype inherits all the attributes, methods, and events of the supertype and can acquire

new customer-specific attributes, methods, and events. The key fields of the supertype and

subtype, however, must be identical.

You can only make changes directly in an object type that SAP provides if an SAPNet note

describes this modification.

.:. . CreateaSubtype

. , ,,1,"" To create a subtype, perform the following steps:

L. On the SAP Easy Access screen, choose fools -+ Business

Workftow --+ Development --+ Definition too/s-- Application Integration --+ Business Obiect

Builder ( swor).

2. On the Buslness Object Builder: lnitiat Screen, enter the name of the supertype in the

Obj ect/ I nterf ace Ty Pe tield.

3. Choose Create SubtYPe.

4. On the Create Object Iype screen, enter values for all the mandatory fields. By defining a

subtype, you create a new ABAP program. The program name reflects this subtype. When

assigning a name, use the customer namespace.

5. On the Create Object Directory Entry screen, enter the package name in the Package field.

A subtype must appear in a package for it to be released.

6, ChooseSave.

Supertype

BUSlOOlMaterial

Subtype

zBUS1001My_Material

;

Key Fields j

--rI-LJ

Attributes j

r*Events

i,,. *YIsfllI:*."J

Display

Created

Key Fields i,

l-llrlAttrlbutes

Material No.

Material Type

Material GroupDivision

Old Material

Basic Material

Methods

i '*.1r-1!-,, Changed i

Figure 26. Oblect Type - Def in tlon of a Subtype

82 @ Copyright , All rights reserved

Page 97: SAP Workflow Bit601 en Col10

Lesson: Adjusting Standard Object Types to Suit Customer Requirements

7, lf prompted, provide a short description and create a request.

8. Enhance the object type to suit your requirements. Create attributes, methods, and

events to suit your requirements.

9. Set the status of the object type to implemented and then to released and ensure that thestatus of each new component is set lo implemented (at least).

Delegation of Subtypes

To enhance an existing object type, perform the following steps:

1, Create a subtype.

2. Extend the object type.

3. Set up delegation from the supertype to the subtype.

Sample scenario:Using the SAPArchivelink interface, a paper document for object type EKKO(purchasing documenl) is to be stored subsequently in an external archive.ln this scenario, SAP ArchiveLink calls the CONFIRM method in the object type.

To meet customer requirements, the method is added to EKKO (with subtype ZEKKO).

No delegation

The SAP Archivelink application only recognizes the EKKO object type'EKKO does not have the CONFIRM method.Subsequent sloring fails at runtime with the error message:Method CONFIRM is not implemented

I Figure 27: Delegat on (1)

@ Copyright. All rights reserved

Page 98: SAP Workflow Bit601 en Col10

Unit 3: Business Objects and the Business Object Repositiory

Sample scenario:Using the SAPArchivelink interface, a paper document for object type EKKO(purchasing document) is to be stored subsequently in an external archive.ln this scenario, SAP Archivelink calls the CONFIRM method in the object type.

To meet customer requirements, the method is added to EKKO

{with subtype ZEKKO).

Delegation set up

The SAF Archivelink application only recognizes the EKKO object type EKKO doesnot have the CONFIRM method.There exists a delegation between EKKO and ZEKKO, which means the ZEKKOmethods are used at runtime.EKKO recognizes the CONFIRM method.Subsequent storing is possible.

After Delegation

i,:titiii Figure 28: Delegation (2)

To set up a delegation, perform the following steps:

1. On the SAP Easy Access screen, choose fools -- EusinessWorkflow --+ Developmant -+ Definition tools --- Application Integration --+ Business ObjectBuilder ( swor).

2. On the Buslness Object Builder: Initial Screen, choose Settings ", Delegate.

3. On the Display View "Customizing Object Types": Overview screen, chooseDisplay --+ Change.

4. Choose the New Entries pushbutton.

5. On the New Entries: Details of Added Entries screen, enter the following data:

Field Name Entry

Object type Supertype

Person responsible The name of the person responsible formaintaining the delegation

Delegation type Subtype

Caution:The GUl-Specific field must remain empty.

You can create any number of subtypes for one supertype. However, it is possible toselect only one of these subtypes as a delegation type.

84 @ Copyright, All rights reserved

Page 99: SAP Workflow Bit601 en Col10

Lesson: Adjusting Standard Object Types to Suit Customer Requirements

Testing Delegations

Before making a delegation, if you display the supertype in the Buslness Object Builder andchoose lest, no attributes, events, or methods defined for the subtype display.

After making a delegation, if you display the supertype in the Business Object Builder andchoose fest, all the attributes, events, and methods defined for the subtype also display, andyou can test the elements.

Elements and Basic Data of an Object Type

,G@III

A,1';Key Fields t

attr;outes EJ

*.,',,Events i ::,':i

-t:--*-l

Exporuimportparameters

Result

Functlonmodule

i

ABAP coding j

The following are the elements of an object type:. Key fields

Key fields uniquely identify a particular object. The key fields of supertypes and subtypesmust be identical.

. Attributes

Attributes can refer to fields in the ABAP dictionary and, therefore, to a database table, aswell as to other object types. For example, the purchase order attribute in the Materialobject type refers to the purchase order object type (8U52012). At runtime, for example,all the purchase orders are available for the P-100 material, and it is possible to evaluatetheir attributes, You can also access the methods of the purchase order object type.

. Methods

Methods can refer to all the functions defined in the SAP system. A method can call a

report, transaction, function module, or any defined or customized ABAP code.

. Events

Events define possible status changes to an object type. For example, the materialchanged event should occur if a material master is changed using transaction 1ru02.

Objectreference

..:* Figure 29. Oblect Type - Elements

@ Copyright . All rights reserved B5

Page 100: SAP Workflow Bit601 en Col10

Unit 3: Business Objects and the Business Object Repositiory

Creating an event for an object type in the Business Object Repository (BOR) does notmean that it triggers automatically at the appropriate time. The application must publishthe event specifically in the system.

Object Type Definition

To access the basic data of an object type, perform the following steps:1.. On the SAP Easy Access screen, choose fools --+ Business

Workf low -+ Development ---+ Definition too/s -+ Application lntegration -+ Buslness ObjectBuilder ( swor).

2, On the Euslness Object Builder: lnitial Screen, enter the name of the object type in theObject/lnterf ace Type field.

3. Choose Display

4. Choose BasicData.

5. To check whether a supertype exists, see the Generaltab in the basic data.

6. To check whether a delegation type has been created, see the Customizing lab,

7. To access information about the person who last changed the basic data, see lhe ChangeData tab.

The default method under the Default tabs is selected if no further specifications are madewhen an object of this object type is accessed. For example, the default method might becalled when an object is accessed when you double-click the display list.

Attributes of Objects

The following are features of attributes:. Attributes describe the characteristics of an object type.

. While creating attributes, specify the following:

Description texts

Object Type Def inition

86 @ Copyright , All rights reserved.

Page 101: SAP Workflow Bit601 en Col10

Lesson: Adjusting Standard Object Types to Suit Customer Requirements

- Source - The attribute value is determined at runtime by:

. Database field

. Virtual

. Data Type Reference - An attribute can refer to:

- ABAP Dictionary field

Object type

. Attribute properties, if required

Attributes are available as interface elements and it is possible to incorporate them into

workf low texts. Workflow definitions also use attributes, for example, when formulating

conditions, that is, they are used within the process control.

An attribute can have the following sources:. ABAP Dictionary field

At runtime, the attribute value is taken from a f ield in a database table in the SAP system.

For example, the Material short text for BU51001 references the MAKTX field in the MAKT

table.

. Virtual

The value of the attribuie is determined dynamically at runtime based on the values of the

object type. For example, all the existing orders for a material.

An attribute can have the following datatype references:. Reference to a dictionarY field

. Reference to an object type

lf an attribute refers to another object type, its attributes and methods are also available in

the program at runtime.

For virtual attributes, implement the customer-specific source code in the program of the

object type.

Attributes may be mandatory (must always have a value), have multiple lines (for example, all

purchase orders), or be instance-independent (the value of the attribute does not depend on

a particular object, for example, all lDoc message types in the sAP system).

Attribute Def inition OPtions

The following are the options for determining the values of attributes at runtime:

@ Copyright. All rights reserved 87

Page 102: SAP Workflow Bit601 en Col10

Unit 3: Business Objects and the Business Object Repositiory

Table 1: Attribute Definition Options

Source or Data Origin Data Type ReferenceDictionary '

Data Type Reference ObjectType

Database field The value of the attribute atruntime corresponds to thecontents of the field of thedatabase table specif ied atdefinition time.

Examples:

. Materialtype in the MARAtable

. Material short text forBUS1001 references theMAKTX field in the MAKTtable

The system prepares theobject reference. At runtime,it is possible to access themethods and attributes ofthe object.

Example:

Sold-to party in order

Virtual You specify a data typeaccording to the dictionarY.The system calculates theattribute value at runtimebased on the definedprogram source code.

For example, time remaininguntil the delivery date in theorder

For virtual attributes,implement customer-sPecif ic

source code in the programof the object type.

The system prepares objectreferences.

At runtime, it is possible toaccess the methods andattributes of the object.

For example, all purchaseorders for a material.

Methods-Def initionMethods define the permitted functions for an object.

The following are some characteristics of methods:. Methods are permitted functions for an object

. Dialog methods, for example, the Change Material method, generate a detailed work item

for the selected agents.

. No dialog methods, for example, the Delete Request background method, generate a work

item and the system executes it automatically.

. Methods provide reference to SAP functions.

. Synchronous methods can have a specified result or export parameters.

. Synchronous methods can define exceptions for error handling.

. lt is possible to transfer parameters to all methods when called'

BB@ Copyright , All rights reserved

Page 103: SAP Workflow Bit601 en Col10

Lesson: Adjusting Standard Object Types to Suit Customer Requirements

Methods incorporate the permitted functions available for an object. For methods to workcorrectly, you may have to enter values for the import parameters at runtime. These inputparameters are defined in the interface for the method.

Synchronous methods can return values to the calling program in the form of thefollowing parameters:. Export parameters

These are def ined in the interface of the method.

. Result parameters

A check table stores the possible values of the result. The workf low then recognizes thesevalues automatically as possible outcomes of the workf low step that the method calls. For

example, the APPROVE method of the FORMABSENC object type.

Asynchronous methods are the opposite of synchronous methods. Asynchronous methodscan have import parameters but not export parameters or result parameters. The reason

being that asynchronous methods do not send a response to the calling program.

lmplementing Methods in Object Types

To implement a method in an object type, perform the following steps:

1. On the SAP Easy Access screen, choose Iools --+ Business

Workflow ---+ Development -+ Definition too/s ---+ Application lntegration ---+ Buslness ObiectBuilder.

2. On the Buslness Object Buitder: Initiat Screen, enter the name of the object type in theObject/lnterface Type field and choose Ihe Change pushbutton.

3. Position the cursor on the Methods component name and choose Create'

4. ln the Create Method dialog box, choose No to answer the question, " Create with function

module as template?' if you don't want to call a function module. lf you want to call a

function module in the method, answer with Yes.

5. Enter the basic data for the method.

6. Select the new method, and choose the Program pushbutton to implement the method.

lf required, the system implements the method in the program as far as possible.

@ Copyright. All rights reserved. 89

Page 104: SAP Workflow Bit601 en Col10

Unit 3: Business Objects and the Business Object Repositiory

a

a

Tasks can have terminating events.

Synchronous method:

r The method is called, assumesprocess control, and sends aconfirmation to the calling programafter processing.

r Optional: lmport parameters

r Optional: Result,export parameter, exceptions

Asynchronous method:

r The method is called, executedwithout a connection to the callingprogram, and does not send aconfirmation after processing.

r Optional: lmpofi parameters

Figure 31: Synchronous and Asynchronous Methods

ffiNTast< t) Terminatingaient . .'.r,'

:.

Synchronous and Asynchronous Methods

Synchronous methods return control to the calling program when the method is complete.The system then completes the work item that forms the basis for the method.

Asynchronous methods do not return a confirmation after executing a task. The generatedwork item remains in the inbox of the agent because it is not known when the called method iscompleted. To terminate work items for asynchronous methods, the application thatexecutes the method must trigger a terminating event.

You specify the terminating event when you def ine the standard task. On the SAP Easy Access

screen, choose fools --- Business Workflow --+ Developme fit --+ Definition tools ---+ Tasks/Taskgroups. You can choose either Create or Change, and then enter and edit the task to specify a

terminating event on lhe Terminating Events tab page.

A terminating event always refers to exactly one work item. This means that the work item lDmust be identified when you define the terminating event. This is performed using the_Wl_OBJECT_ID variable and is entered under ELEMENT.

You can also have terminating events for methods. The system then completes a

corresponding work item using the terminating event or the method returns control to theworkflow runtime system.

90 @ Copyright All rights reserved

Page 105: SAP Workflow Bit601 en Col10

Lesson: Adjusting Standard Object Types to Suit Customer Requirements

Event-Definition

..',:,:i Figure 32: Object Type Definition - Event

A published event represents cross-system notification of a change in the status of an object.

The following are examples of events:. Customer order created

. Material master changed

. lnvoice posted

. Materialdeleted

ln the Business Object Repository, events are only defined for object types. For the publishing

of the event, and for the Workflow Engine to be able to work with it, the relevant application

must trigger the event at the appropriate place at runtime.

Events have parameters for transferring information from an event creator to an event

receiver. For example, event parameters enable the system to transfer an object type and theparticular object referring to the event to the workflow.

@ Copyright. All rights reserved, 91

Page 106: SAP Workflow Bit601 en Col10

Unit 3: Business Objects and the Business Object Repositiory

92 @ Copyright . All rights reserved

Page 107: SAP Workflow Bit601 en Col10

Create and Extend a Subtype and Define aDelegation

Business Example

You need to make a customer-specif ic enhancement to your standard object type for thematerial master Y##N/ARA. You require a display change documents method and a Materialchanged event for your workflow. ln your program, however, you only want to work with thesupertype, that is, Y##MARA.

You would need to create a subtype and add the necessary components to this subtype.Creating a delegation from the supertype to the subtype ensures that the supertype alsorecognizes all the components you have created in the subtype.

Task 1

Create a subtype YMARA## for your standard object type Y##MARA.

Since you require a Display change documents method and a Material changed event for yourworkf low, create a subtype for your standard object type and add the necessary componentsto this subtype.

;..r'rrl'ir Hint:

,'l'l , ,:,,, A subtype must appear in a package (formerly a development class) for itsrelease.

Use package 2001 and, if necessary, create a new Change request called BlT601,group ## (## represents the assigned group number).

Call the Business Object Builder to display and maintain the BOR.

Create subtype YMARA## for your standard object type Y##MARA.

Enter the following data:

1.

2.

Field Name Value

Supertype Y##I\,IARA

Object Type wena**

Object name Material_Group_##

Name I'taterial , group lf #

Description Material, group ##

Program YI4ARA##

O Copyright. All rights reserved.

Page 108: SAP Workflow Bit601 en Col10

Unit 3: Business Objects and the Business Object Repositiory

Field Name Value

Application s

The Obiect Type and Program fields for the subtype must be in the customer namespace.

Task 2

Adapt your YMARA## subtype to meet your requirements.

You can now change the subtype in the customer namespace so that it fulfills customer-specif ic requ irements.

1. Create an event that is triggered as soon as changes are made to a material.

The workflow requires a material changed event as a triggering event. Define the newevent, Old_Material_Changed, for your YMARA## object type.

2. Create a new attribute that displays the basic material from the MARA table.

Allow access to the Basic materlal field from Basic data2 in the material master. Create anew BasicMaterial attribute based on the ABAP Dictionary table MARA, field WRKST.

ln the Create Attribute dialog box, answer the question " Create with ABAP Dictionary fieldproposals?" with Yes. Then, enter the table name MARA and select the WRKSf field. Use

Create to define the attribute.

The attribute already has the implemented status after you create it.

3. Define a method to display the change documents. ln the first workflow step, a userdisplays the change documents of the material master that was changed. Create a newDisplay_Changes method.

The method should calltransaction yuoa as a function. ln the Create Method dialog box,answer the question , " Create with function module as template?" with uo.

Then, define the method as both a synchronous method and a method with dialog. Themethod does not return any results parameter. The definition alone is not enough. Youmust then implement the corresponding program code for this method. The systemgenerates a suggestion. Do not change the suggestion. Simply choose Saye.

Task 3

Change the status of ihe YMARA## object type to implemented and then to released.

1. Change the status of your object type to implemented and then to released.

lgnore any warnings that may appear.

Hint:Set the status of an objectimplemented -> released.modeled to released.

type and its components in this order, modeled ->

You cannot directly change the status from

Task 4

Change the status of the new components of the YMARA## object type to released.

94 @ Copyright . All rights reserved.

Page 109: SAP Workflow Bit601 en Col10

Lesson: Adjusting Standard Object Types to Suit Customer Requirements

1.

2.

Change the status of all of your new events, attributes, and methods to released.

Generate your object type again.

Task 5

Test your Y##MARA supertype before you create a delegation.

Without delegation, the supertype does not recognize any of the components that you have

created in the subtype. You can use the test environment to check system behavior beforeand after delegation.

1. Display the object type Y##MARA.

Choose Iesf.

Create an instance for the material T-BBD##.

The attributes and methods of the Y##MARA object type are now displayed.

Can you see your new attribute and new method?

Task 6

Define a cross-system delegation for your Y##MARA supertype in the BOR.

1. Enter your Y##t'lARA supertype in the Obiect/interface Type field.

Enter your current user name in the Person responslb/e field.

Enter your rMARA## subtype in the Delegation type field.

lf necessary, create a change request with erte or, group ## as the description.

Task 7

Display your Y##MARA supertype again and choose fest.

1. Create an instance with your T-BBD## material.

Since delegation catches the subtype and accesses it during the test, you now see the newmethod and new attribute that you defined.

Test the Display_Changes method.

Why don't you see your new attribute and method when you display the components ofthe Y##MARA object type directly?

2.

3.

@ Copyright. All rights reserved. 95

Page 110: SAP Workflow Bit601 en Col10

Create and Extend a Subtype and Define aDelegation

Business Example

You need to make a customer-specific enhancement to your siandard object type for thematerial master Y##MARA. You require a display change documents method and a Materialchanged event for your workflow. ln your program, however, you only want to work with thesupertype, that is, Y##MARA.

You would need to create a subtype and add the necessary components to this subtype.

Creating a delegation from ihe supertype to the subtype ensures that the supertype also

recognizes all the components you have created in the subtype.

Task 1

Create a subtype YMARA## for your standard object type Y##MARA.

Since you require a Display change documents method and a Material changed event for your

workflow, create a subtype for your standard object type and add the necessary componentsto this subtype.

" ';, Hint:

'ir''ri rrlr:r: A subtype must appea r in a package (formerly a development class) for its

' :: release.

Use package ZOO1 and, if necessary, create anew Change request called BlT601,

group ## (## represents the assigned group number).

Call the Business Object Builder to display and maintain the BOR.

a) On the SAP EasyAccess screen, choose Tools ---, BusinessWorkflow --+ Development ---+ Definition too/s -+ Application lntegration ---+ Euslness

Object Builder ( swor),

Create subtype YMARA## for your standard object type Y##MARA.

Enter the following data:

2.

Field Name Value

Supertype Y##r'rARA

Object Type Y},IARA**

Object name Material_Group_##

Name Material, group ##

Description Materiaf, group ##

96 O Copyright . All rights reserved.

Page 111: SAP Workflow Bit601 en Col10

Lesson: Adjustlng Standard Object Types to Suit Customer Requirements

Field Name Value

Program N'ARA#*

Application s

The Oblect Type and Program fields for the subtype must be in the customer namespace.

a) On the Business Object Builder: Initial Screen, enter y#*I!4ARA inlhe Object/lnterfaceType field.

b) Choose Subtype.

c) On the Create Object lype screen, enter the following data:

Field Name Value

Supertype r##uana

Object Type YMARA##

Object name t'laterial_Group_##

Name t'laterial , group ##

Description Material, group ##

Program Y!4ARA##

Application s

d) Choose Continue.

e) On the Create Object Directory Entry screen, enter 2001 in the Package field.

f) Choose Save.

g) lfthesystemasksyouforarequest,createarequestwitherr0or-##astheshortdescription.

h) Choose Save.

i) Choose Continue.

Task 2

Adapt your YMARA## subtype to meet your requirements.

You can now change the subtype in the customer namespace so that it fulfills customer-specif ic requ irements.

1. Create an event that is triggered as soon as changes are made to a material.

The workflow requires a material changed event as a triggering event. Define the newevent, Old_Material_Changed, for your YMARA## object type.

a) On the Change Object Type YMARA## screen, position the cursor on the componentname Events and choose Edit - Create. Alternatively, choose Create.

b) Enter the following data:

O Copyright . All rights reserved. 97

Page 112: SAP Workflow Bit601 en Col10

Unit 3: Business Objects and the Business Object Repositiory

Field Name Entry

Event OId Material Changed

Name O1d Material Changed

Description Material Changed

c) Choose Continue.

d) Choose Save.

You can now see your new event appended to the list of events for YMARA##.

2. Create a new attribute that displays the basic material from the MARA table.

Allow access to the Baslc materialfield from Basic data 2 in the material master. Create a

new BasicMaterial attribute based on the ABAP Dictionary table MARA, field WRKST.

ln the Create Attribute dialog box, answer the question " Create with ABAP Dictionary field

proposals?" with Yes. Then, enter the table name MARA and select the WRKSf f ield. Use

Create to define the attribute.

The attribute already has the implemented status after you create it.

a) On theChangeObjectTypeYMARA##screen, positionthecursoronthe Attributes

component name.

b) Choose Edit --+ Create. Alternatively, choose Create'

c) ln the Create Attribute dialog box, choose Yes to answer the question , " Create with

ABAP Dictionary field proposals?" .

d) ln the Create with Data Dictionary Field Proposals dialog box, enter the table name

uana and select the WRKST row.

e) Choose Continue.

f) Do not change anything on the screen that appears and select Create to create the

BasicMaterial new attribute.

The attribute already has the implemented status.

You can now see your new attribute appended to the list of attributes for YMARA##.

3. Define a method to display the change documents. ln the first workflow step, a user

displays the change documents of the material master that was changed. Create a new

Display_Changes method.

The method should calltransaction yuoa as a function. ln the Create Method dialog box,

answer the question ," create with function module as template?' with uo.

Then, define the method as both a synchronous method and a method with dialog' The

method does not return any results parameter. The definition alone is not enough. You

must then implement the corresponding program code for this method. The system

generates a suggestion. Do not change the suggestion. Simply choose save.

a) On lhe Change Object Type YMARA## screen, position the cursor on the component

name Methods and choose Edit --+ create. Alternatively, choose create.

b) ln the Create Method dialog box, choose No to answer the question," Create with

function module as temPlate?".

c) Enter the following data:

9B @ Copyright. All rights reserved

Page 113: SAP Workflow Bit601 en Col10

Lesson: Adjusting Standard Object Types to Suit Customer Requirements

Field Name Value

Method Display_Changes

Name Display Changes

Description Display Changes to I'laterial-s

d) On |he Generaltab page, select Ihe Dialog and Synchronous checkboxes.

e) On Ihe ABAPtab page, select Ihe Transaction radio button.

f) Enterwtoa in the Name field.

g) Choose Continue.

h) On the Change Object Type YMARA## screen, click the plus sign in front of theMethods component and select your new Display-Changes method.

i) Choose Goto -- Program or choose Ihe Program pushbutton.

j) ln the Extend Program dialog box, answer the question," Do you want to generate a

template automatically for the missing section ?" with ves.

k) Choose Save.

l) Go back to ihe basic screen of the Business Object Builder.

Task 3

Change the status of the YMARA## object type to implemented and then to released.

1. Change the status of your object type to implemented and then to released.

lgnore any warnings that may appear.

':r"' Hint:,, i

Set the status of an object type and its components in this order, modeled ->

' implemented -> released. You cannot directly change the status frommodeled to released.

a) On the Change Object Type YMARA## screen, position the cursor on the name of the

object lype,YMARA##.

b) choose Edit --+ change Re/ease Sfatus --> Obiect type --+ To implemented.

c) choose Edit ---+Change Re/ease status ---+obiecttype --+To released.

lgnore any warnings that may appear.

Task 4

Change the status of the new components of the YMARA## object type to released.

1, Changethestatusofallofyournewevents,attributes,andmethodstoreleased.a) On the Euslness Object Buitder screen, choose Obiect type ---+ Change. Alternatively,

choose Change.

@ Copyright. All rights reserved.

Page 114: SAP Workflow Bit601 en Col10

Unit 3: Business Objects and the Business Object Repositiory

b) ln the Events component, position the cursor on the Old-Material_Changed event.

c) Choose Edit -- Change Re/ease Status --+ Object type component---+ To implemented.

d) Choose Edit --+ Change Reiease Status ---+ Object type component ---+ To released.

Repeat these steps to change the status to released for your new methodDisplay-Changes, and then change the status of the new attribute from implementedto released.

2. Generate your object type again,

a) On lhe Change Object Type YMARA## screen, choose Object type --+ Generate.Alternatively, choose Generate.

Task 5

Test your Y##MARA supertype before you create a delegation.

Without delegation, the supertype does not recognize any of the components that you havecreated in the subtype. You can use the test environment to check system behavior beforeand after delegation.

1. Display the object type Y##MARA.

Choose fest.

Create an instance for the material T-BBD##.

The attributes and methods of the Y##MARA object type are now displayed.

Can you see your new attribute and new method?

a) On the Euslness Object Builder: lnitialScreen, enter y##l"rARA inlhe Object/lnterfaceType field.

b) Choose the lest pushbutton.

c) Choose Instance.

d) Enter r-BBD#* inlhe Material field.

This creates a new instance of the Y##MARA object type. The system displays theattributes and methods of the Y##MARA object type.

Can you see your new attrrbute and method?

No. You cannot see the new elements. These elements do not belong to the standardobject type Y##MARA but to the newly created, customer-specific subtypeYMARA##.

Task 6

Define a cross-system delegation for your Y##MARA supertype in the BOR.

1. Enter your Y##r"IARA su pertype in lhe Object/interf ace Type field.

Enter your current user name in the Person responsible field.

Enter your vunne## subtype in the Delegation type field.

lf necessary, create a change request with 8rT601, group ## as the description.

a) Return to the initial screen of the Business Object Builder.

b) Choose Settings ---+ Delegate.

i00 O Copyright. All rights reserved.

Page 115: SAP Workflow Bit601 en Col10

Lesson: Adjusting Standard Object Types to Suit Customer Requirements

Field Name Entry

Object type Y*#MARA

Person responsible Your username

Delegation type YMARA##

c) Choose Display---, Change to switch to change mode.

d) Choose the Neraz Entries pushbutton.

e) Enter the following data:

Choose Save.

lf required, create a change request with erre Or, grouP *# as the description

Exit this entire path to allow the next participant to create a table entry.

Task 7

Display your Y##MARA supertype again and choose fest.

1. Create an instance with your T-BBD## material.

Since delegation caiches the subtype and accesses it during the test, you now see the new

method and new attribute that you defined.

a) Test your Y##MARA supertype again.

You should now be able to see your new attribute and new method when you test your

supertype.

2. Test lhe Display-Changes method.

a) Select lhe Display-Changes method and choose the Execute pushbutton.

You can see the change document for the change you made.

3. Why don't you see your new attribute and method when you display the components of

the Y##MARA object type directlY?

a) The new components are not defined for the Y##MARA object type. You can only

access them using delegation.

D

s)

O Copyright . All rights reserved. 101

Page 116: SAP Workflow Bit601 en Col10

Unit 3: Business Objects and the Business Object Repositiory

r,i:'.,.,,,i:.,t.i,,,. LESSON SUMMARY'""'i ' You should now be able to:

. Adjust standard object types to suit customer requirements

ro2 @ Copyright. All rights reserved

Page 117: SAP Workflow Bit601 en Col10

nTT

TwnT

Learning Assessment

The events defined in the

-

act as triggering events

Choose the correct answer.

11 A Business Object Repository

B BAPI

C interface

D CORBA

Z. lf you want to extend a standard object type, create a

-for

this object type.

Choose the correct answer.

A supertype

B subtype

C delegation

D terminating event

3. lf you also want the supertype to recognize the new components of the subtype, you have

to set up a delegation.

Determine whether this statement is true or false'

(r,u"! Fatse

@ Copyright . All rights reserved

Page 118: SAP Workflow Bit601 en Col10

Unit 3: Learning Assessment

4. Which of the following are components of object types?

Choose the correct answers.

fl n Events

fr e Methods

fr c Attributes

fra Keyfields

! E Delegation

5. The value of a virtual attribute corresponds to the contents of the field of a database tableat runtime.

Determine whether this statement is true or false.

True

False

6. lt is possible to terminate work items based on synchronous methods only by triggering aterminating event.

Determine whether ihls stateme nt is true or false.

True

False

lw

!il

104 @ Copyright . AII rights reserved.

Page 119: SAP Workflow Bit601 en Col10

Learning Assessment - Answers

1. Theeventsdefinedinthe-actastriggeringevents.Choose the correct answer.

A Business Object Repository

B BAPI

C interface

D CORBA

2. lf you want to extend a standard object type, create a

-for

this object type.

Choose the correct answer.

A supertype

B subtype

C delegation

D terminating event

3. lf you also want the supertype to recognize the new components of the subtype, you have

to set up a delegation.

Determine whether this statement is true or false.

True

False

ET!l

nETf

ET

O Copyright . All rights reserved.

Page 120: SAP Workflow Bit601 en Col10

Unit 3: Learning Assessment - Answers

4. Which of the following are components of object types?

Choose the correct answers.

A Events

B Methods

C Attributes

D Key f ields

E Delegation

5. The value of a virtual attribute corresponds to the contents of ihe field of a database tableat runtime.

Determine whether this stateme nt is true or f alse.

True

False

6. lt is possible to terminate work items based on synchronous methods only by triggering a

terminating event.

Determine whether this stateme nt is true or false.

True

False

EEEEf

fE

TE

106 @ Copyright , All rights reserved.

Page 121: SAP Workflow Bit601 en Col10

Definition of Tasksfihftioif

Lesson 1

Creating Standard Tasks Using Synchronous Methods

Exercise 6: Create Two Standard Tasks

Exercise 7: Change one of the Standard Tasks

Lesson 2

Creating Standard Tasks Using Asynchronous Methods

Exercise B: Create asynchronous Tasks

Lesson 3

lntegrating Tasks in a Workflow TemplateExercise 9: lntegrate Tasks in a Workflow Template

Lesson 4

Using Task Groups and the Business Workflow Explorer

Exercise 10: Use Task Groups

UNIT OBJECTIVES

. Create standard tasks using synchronous methods

. Def ine a standard task using asynchronous methods

. lntegrate tasks in a workflow template

. Use task groups and the Business Workflow Explorer

108

115

L21

127

131

136

139

143

r47

@ Copyright. All rights reserved. ro7

Page 122: SAP Workflow Bit601 en Col10

Creating Standard Tasks Using SynchronousMethods

LESSON OVERVIEWThis lesson defines tasks and explains how the Workflow Engine handles the tasks that referto synchronous methods.

Business Example

You use tasks to integrate methods of BOR object types or ABAP-OO classes into yourworkflows. For your workflow, you are required to create the Display material changedocuments and Display material master tasks. For this reason, you require the followingknowledge:

. An understanding of standard tasks

. An understanding of the work item text

. An understanding of special flags in standard tasks

. An understanding of synchronous methods in standard tasks

. An understanding of the result parameter in standard tasks

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Create standard tasks using synchronous methods

108 @ Copyright , All rights reserved.

Page 123: SAP Workflow Bit601 en Col10

Lesson: Creating Standard Tasks Using Synchronous Methods

Task Types and Process Example

From an organizational perspective, tasks are the central element in a workflow.

The following are the main types of tasks:. Tasks (TS)

Reference one method of an object type and represent one step in the business process

. Workflows (WS)

Represent the business process and consist of a sequence of individual tasks and controlsteps

Tasks are designed as client-specif ic and time-dependent reusable modules.

Tasks, for example, T599700044, are used to describe a business process. Tasks can beexecuted one after the other in the business process. Parallel steps can, however, also bedefined.

Tasks are generally executed in the context of a workflow definition.

ln exceptional cases, they can also be triggered explicitly using an event, without beingincluded in a workflow.

The following questions have to be asked for a new task:. Who will carry out this work?

. What information will the different texts for the task contain?

. Do I need additional flags or settings?

Workflowil definition

SAP functions

Figure 33: Task Types WS and TS

@ Copyright. AII rights reserved 109

Page 124: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

Task Example

A task refers to a method of an object type.

A task must have possrble agents based on the organizational model, an activity group or all

SAP users (general task).

The work item is displayed in the fitle column in the Business Workplace.

The task description can be used to inform the user about the work that has to be done.

You can see the task description in the work item preview in the workplace.

lf tasks are controlled with simple deadline monitoring, individual message texts have to be

defined for all type of missed deadlines.

The variable parts of all those texts are automatically replaced at runtime by accessing the

attributes of the processed objects.

, '-rau;!h,n, I

N\, t-\ W'n-

tu'(',^t & 'rrt"y'

/"'ti'

\$rry. .," l

, s\*'

Writechange

document..i{i&,,.

.l.lllllllllll, .." J triooers

EventzBUS1001.

Who?(= Possibleagent)

Old_Maierial_changedItI

I

&Do What?+

Long texts

Work ltem

Figure 34: Task Example

110 @ Copyright . All rights reserved.

Page 125: SAP Workflow Bit601 en Col10

Lesson: Creating Standard Tasks Using Synchronous Methods

Standard Tasks

The following points should be adhered to while creating a standard task:. Assign the dialog method of a business object type to your task.

. Assign the maximum number of possible agents.

To do this, maintain an entry under Additional Data --+ Agent Assignment. You can refer tothe organizational model or to an activity group. For creating the standard agentassignment in the standard task, select the task, and in the menu, choose AgentAssignment --+ Create. Select and enter the required organizational object. The task can

also be a general task, which means that each SAP user is a possible agent. To create a

general task, select the task, choose Properties, and then select the GeneralTask radiobutton.

. Define the work item text and the required long text for the task, you can insert workflowinterface variables that will be triggered with the current data at runtime.

lf an asynchronous method call is used for the task, the method does not return confirmationof completion to the calling system. This means that the work item has not ended. An

asynchronous method must supply the end notification 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 workflowdefinition. You will find this type of call in the SAP system, for example, when handling lDoc

errors.

The Work ltem Text

The steps for creating and inserting work item text are as follows:

1. Create a title in the standard task, which will be shown for the work item in the Business

Workplace.

OrgobjectslRoles

FtIA AI

I'i:.: F gure 35: Defin ng a Dia og Task - Overv ew

r Who isresponsible

. Terminatinq events

r Ljggedng-eve.dgOnly if the task is notused in a workflow

I Work item text: title of workitem in worklist

o Long texts:> Name> Notilication> Missed deadline

@ Copyright. All rights reserved 111

Page 126: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

2. Create the work item text, and position the cursor to include a variable in the work itemtext.

3. Choose the /nserf variable pushbutton underneath the work item text.

4. The object attributes from the task interface are now available.

An example of work item text is Process request f rom &_Wl_Object_lD.CreatedBy&

The long texts of tasks use the same concept for variables. You maintain long texts in the taskon the Description tab page. You include variables by choosing lnsert --+ Expression.

An example of a task description of the Approval step is, Employee

&_WI_Ob j ect_f D. CreatedBye

created a notification of absence under the number& WI Object fD.Number&on& Wf Object TD.CreateDate&

. Decide whether to approve.

Synchronous Methods in Standard Tasks

The characteristics of synchronous methods are as follows:. Tasks with synchronous methods may have import parameters, export parameters, and

result parameters. Data exchange occurs in both directions.

. The task is completed when the method returns a f inal confirmation to the workflowsystem.

. The task is also completed when the application triggers the terminating event.

Result Parameter in Standard Tasks

Since a synchronous method can return values to the calling system, synchronous methods

can have export parameters or result parameters.

The following is an example of result parameters:

You want the approve vacation method to end with approved (A), rejected (R), or new (N).

The values A, R, and N are stored as fixed values in a domain.

The relevant value is transferred to the workf low in a special attribute.

Tasks with synchronous methodsmay have import parameters,export parameters and resultsparameters.The data exchange occurs in bothdirections.

The task is completed when themethod returns a final

MAYbe available

confirmation to the workflowsystem

o The task is also completed whenthe application triggers theterminating event.

Figure 36:

12 @ Copyright. All rights reserved.

Page 127: SAP Workflow Bit601 en Col10

Lesson: Creating Standard Tasks Using Synchronous Methods

lf a task is to be completed by a business event exclusively, this task has to contain an

asynchronous method. The terminating event definition in the task is simply an additional

option to complete the work item.

Special Flags in Standard Tasks

Some of the settings for standard tasks are as follows:. 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

lf the without diatog checkbox is set for the task method, the system can execute it in the

background .The Background processlng checkbox is also displayed for you to use.

An SAPphone customer service scenario is as follows:

A sales service clerk wants to call a customer.

The workflow dials the telephone number, which is attached to the current customer-object ofthe workflow. Once the connection is established, the sales clerk can talk to the customer and

view important customer data on the screen at the same time.

When a customer calls your company, a telephone service tool asks the customer to enter thecustomer contract number. The SAP system collects the important customer data and startsa workf low. The next available customer service clerk starts that work item. The customer'stelephone is now connected to the customer and the customer data is displayed on the

screen.

The Executable with SAP f orms checkbox refers to tasks that, when executed, should display

the data from the container in a form created externally (for example, using Visual Basic,

Lotus Notes, and Outlook Editor).

Buffering Behavior of the Workflow Engine

The Workflow Engine buffers data in different contexts.

When you choose Update in the Business Workplace or each time you use the transaction

code sewp to call the Business Workplace, the system creates the most up-to-date list of

work items that the affected user must process. The system creates the list using the

assignment of agents to tasks (definition of possible agents). The system buffers thisassignment once a day.

As soon as you define a new task and assign yourself as an agent, this task is not included in

the buffered data.

You can refresh the buffer as follows:. User-specif ic

- Use the transaction swus and then choose the Refresh Organizational Environment

pushbutton.

O Copyright. All rights reserved 113

Page 128: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

- Use the transaction sewp (Business Workplace) and then choose Settlngs --+ Workflow

Settlngs ---+ Refresh Organizational Environment.

. Global

Use the transaction code swu oeuF.

@ Copyright. All rights reserved.

Page 129: SAP Workflow Bit601 en Col10

Create Two Standard Tasks

Business Example

Standard tasks are based on object types and their methods. You can use these tasks as

standalone tasks or as steps in a workflow definition. Calling tasks explicitly using triggeringevents is an exceptional case.

Task IDefine the required standard tasks for your workflow.

You need the following tasks for your workflow:

. Display change documents

. Display material master

Define both of these tasks as standard tasks.

1. Generate the task to display the change documents.

ln the Se/ect task type dropdown box, choose the Standard task option. Enter the followingdata:

Field Name Entry

Abbr. z## Ts 1

Name Change documents for material,group ##

Object type Y##I'IARA

Method DispJ-ay_Changes

Use the input help to find this method. Save the task, and make a note of your tasknumber. Create the task as an object in the zoot package. lf necessary, create a new

request BlT601, group ##.

Define the possible agents for ihis task:

All users in the system can execute the task (general task).

Exit the task definition.

Generate the task for displaying the material master.

ln the Se/ect task type dropdown box, select the Standard task option. Enter the followingdata:

2.

Field Name Entry

Abbr. z#* 'rs 2

Name Display malerial, group **

@ Copyright. All rights reserved.

Page 130: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

Field Name Entry

Object type Y##}4ARA

Method Display_Chang'es

Use the input help to find this entry. Save the tasks and make a note of your task numberand define this task as a general task and exit the task definition.

Task 2

Test your two tasks Change documents for material, group ## and Display material master,group ## in the test transaction code swus.

1. Test the task Change documents for material, group ##. Start the test transaction, andrefresh the organizational buffer. Enter rs and the number of your Change documents formaterialtask, for example, 98000067. On the lnput Data tab page, use your material r-BBD## as test data. Save this test data.

Execute the task. The change documents for your material now display.

2. Repeat the test using the task oi-sp]-ay material master, croup ##. Do not forgetto specify the material in the input data.

Note:You cannot go directly from the definition of tasks to test transaction code swus.

Call the test transaction separately from the menu. Choose fools -' BusinessWorkflow -+ Development ---+ Runtime fools -- TestWorkflow.

116 @ Copyright. All rights reserved.

Page 131: SAP Workflow Bit601 en Col10

Greate Two Standard Tasks

Business Example

Standard tasks are based on object types and their methods. You can use these tasks asstandalone tasks or as steps in a workflow definition. Calling tasks explicitly using triggeringevents is an exceptional case,

Task 1

Define the required standard tasks for your workf low.

You need the following tasks for your workflow:

. Display change documents

. Display material master

Define both of these tasks as standard tasks.

L. Generate the task to display the change documents.

ln the Se/ect task type dropdown box, choose the Standard fask option. Enter the foliowingdata:

Field Name Entry

Abbr. z## Ts 1

Name Change documents for material.group ##

Object type Y##}4AR,A

Method Display_Changes

Use the input help to f ind this method. Save the task, and make a note of your tasknumber. Create the task as an object in the zoor package.lf necessary, create a newrequest BlT601, group ##.Def ine the possible agents for this task:

Ajl users in the system can execute the task (general task).

Exit the task definition.

a) On the SAP EasyAccess screen, choose Tools -. EuslnessWorkf low -> Development - Def inition too/s ---+ Tasks/Task groups -+ Create.

b) On the lask; Maintain screen, enter standard task in the Iask type field.

c) Choose IheCreate pushbutton.

d) On the Standard Task: Create screen, enter the following data on the Basic data tabpage:

@ Copyright. All rights reserved 7L7

Page 132: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

Field Name

Abbr. z## rs 1

Name Change documents for material,group *#

Object type Y##IARA

Method Display_Changes

e) Choose Save.

f) ln the Create Object Directory Entry dialog box, enter z0o1 in lhe Package field.

g) Choose Save.

h) On the StandardTask: Change screen, choose Additional data - Agentassi gn me nt --+ M a t ntai n.

i) On the Standard task: Maintain Agent Assignment screen, choose Edit ---+ Attributes.

j) ln the Task: dialog box, select Ihe General Task radio button.

k) Choose the Transfer pushbutton.

l) Go back to the SAP Easy Access screen.

2. Generate the task for displaying the material master.

ln the Se/ecf task type dropdown box, select the Standard task option. Enter the followingdata:

Field Name Entry

Abbr. z#*_rs_2

Name Display material, group ##

Object type Y*#MARA

Method DispJ-ay_Changes

Use the input help to find this entry. Save the tasks and make a note of your task numberand define this task as a general task and exit the task definition.

a) On the SAP EasyAccess screen, choose fools --- EuslnessWorkflow '-+ Development - Def inition fools + Tasks/Task groups ---+ Create.

b) On the lask; Maintain screen, enter standard task in the lask type field.

c) Choose theCreate pushbutton.

d) On the Standard Task: Create screen, enter the following data on the Basic data tabpage:

Field Name.: Entry

Abbr. z##_Ts_2

Name Display material master, group**

118 @ Copyright. All rights reserved.

Page 133: SAP Workflow Bit601 en Col10

Lesson: Creating Standard Tasks Using Synchronous Methods

Field Name Entry

Object type Y##FARA

Method Display

e) Choose Save.

f) ln the Transfer container element dialog box, choose yes.

g) ln the Create Object Directory Entry dialogbox, enter zool in the Package field.

h) Choose Save.

i) On the Standard Task: Change screen, chooseAdditionatdata -- Agentassign ment --+ M ai ntai n.

j) On the Standard Task: Change screen, choose Edit ---+ Attributes.

k) ln the lask: dialog box, select lhe General Task radio button.

l) Choose the Transfer pushbutton.

m) Go back to the SAP Easy Access screen.

Task 2

Test your two tasks Change documents for material, group ## and Display material master,group ## in the test transaction code swus.

\,, Note:

d::r' You cannot go directly from the definition of tasks to test transaction code swus.Call the test transaction separately from the menu. Choose Ioois --+ BusinessWorkflow --+ Developmeltt --+ Runtime fools --- Test Workflow.

1. Test the task Change documents for material, group ##. Start the test transaction, andrefresh the organizational buffer. Enter rs and the number of your Change documents formaterialtask, for example, 98000067. On the lnput Data tab page, use your material T-BBD## as test data. Save this test data.

Execute the task. The change documents for your material now display.

a) On the SAP Easy Access screen, choose lools --- BuslnessWorkflow --+ Development ---+ Runtime too/s --+ Test Workflow.

b) On the fesf Workflow screen, enter the task number generated in task 1 in theWorkflowfield.

c) Press ENTER.

d) Choose the Refresh Organizational Environmenf pushbutton.

e) On lhe lnput Data tab page, choose No lnstance in the Values field for Expression_Wl_Object_lD.

f) Enter I-BBD*# in the Keyfield.

O Copyright . All rights reserved. * rf.l'rW'9

Page 134: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

g) Choose Save.

h) Choose lhe Load pushbutton to display the saved input data later.

i) Choose Workflow --+ Execute.

j) The changes for the material I-BBD#* are displayed.

2. Repeat the test using the task oisplay material master, Group ##. Do not forgetto specify the material in the input data.

a) Proceed with the solution as described in step 1.

I20 O Copyright . All rights reserved.

Page 135: SAP Workflow Bit601 en Col10

Change one of the Standard Tasks

Business Example

You have demonstrated the tasks to your users and they have asked for some enhancements.They want the end of the task for displaying the change documents to be explicitly confirmed.They also want an informative text to appear in the Business Workplace of the agent, and a

task description to appear in the Business Workplace of the agent.

Adjust the Change documents for material, group ## (where ## is your group number) taskto suit other user requirements.

L. Set the Confirm end of processing checkbox in the task definition.

This checkbox changes the runtime behavior of the work item for the task. ln an additionaldialog box, the agent must now confirm explicitly that he or she has completed theprocessing for the work item.

2. Change the work item text for the Change documents for material, group ## task.

ln the work item text, the material number of the material that the work item is currentlyprocessing should display in a runtime variable. The work item text appears in the worklistof the recipient.

On the Basic Data tab page, enter the text croup #*: Display changes toI'rareriat inlhe Work item text f ield. Place your cursor afler Display changes in materialtext and lnsert variables to insert the runtime variable for the material number into thetext.

ln the Se/ect Expression dialog box, click the icon before the variable that represents yourmaterial object type, Depending on the view you have set, this variable may be calledM ate r i a I

-G ro u p n r-# # or Y # # M A R A or -W

I -O

B J ECT -l D.

Double-cl ick the Materi al field.

The work item text now contains the value &-WI-OBJECT-ID.MATERIAL&. The & sign is a

placeholder for the variable. Make sure that there is at least one blank space before thefirst & symbol and one blank space after the second & symbol. Save your task.

3. Create a task description for the Change documents for material, group ## task.

With the task description, you can provide information to the work item recipient at

runtime. Enterthetextoisplay of changes for required material, and insert

the runtime variable for the key of the material to be processed at the end of the sentence

again. Make sure that there is at least one blank space before the first & symbol and one

blank space after the last & symbol.

4. Save the Change documents for material, group ## task.

5. Test your task.

While displaying the change documents, open a new session as the same user and go to

the Business Workptace. Now you can see your newly def ined work item text. Select the

@ Copyright. All rights reserved. L2T

Page 136: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

work item, and scroll in the lower screen area' You can see the task description for your

work item.

Now,terminatethissession.ChooseBacktoexitthechangedocumentsdisplay.Tocompletethrsworkitem,chooseEndworkitemintheThisWorkttemHasToBeCompleted ExPlicitlY dialog box'

r22@ Copyright All rights reserved'

Page 137: SAP Workflow Bit601 en Col10

Change one of the Standard Tasks

Business Example

You have demonstrated the tasks to your users and they have asked for some enhancements.They want the end of the task for displaying the change documents to be explicitly confirmed.They also want an informative text to appear in the Business Workplace of the agent, and a

task description to appear in the Business Workplace of the agent.

Adjust Ihe Change documents for material, group ## (where ## is your group number) taskto suit other user requirements.

1, Set lhe Confirm end of processlng checkbox in the task definition.

This checkbox changes the runtime behavior of the work item for the task, ln an additionaldialog box, the agent must now confirm explicitly that he or she has completed theprocessing for the work item.

a) On the SAP EasyAccess screen, choose lools --+ BusinessWorkflow -+ Development ---+ Definition too/s --- Tasks/Task groups --+ Change.

b) On the lask; Maintain screen, enter the task number in the lask field.

c) Choose theChange pushbutton.

d) On Ihe Standard Task: Change screen, select the Confirm end of processing checkbox.

e) Choose Save.

2. Change the work item text for the Change documents for material, group ## task.

ln the work item text, the material number of the material that the work item is currentlyprocessing should display in a runtime variable. The work item text appears in the worklistof the recipient.

On the Basic Data tab page, enter the text croup *#: Dispray changes tor"rareriat in the Work item text f ield. Place your cursor afler Display changes in materialtext and lnsert variables to insert the runtime variable for the material number into thetext.

ln the Se/ect Expression dialog box, click the icon before the variable that represents yourmaterial object type. Depending on the view you have set, this variable may be calledM ate ri a I

-G r ou p n r-# # or Y # # M A R A or -W I

-O B J ECT -l D.

Double-cl ick the M ateri al field.

The work item text now contains the value &-WI-OBJECT-ID.MATERIAL&. The & sign is a

placeholder for the variable. Make sure that there is at least one blank space before thefirst & symbol and one blank space after the second & symbol. Save your task.

a) On the Standard Task: Change screen, on the Basic data tab page enter croup **:Display changes to material in the Work item texf field.

b) Position the cursor after Display changes for materialtexf and choose lnsert variables.

@ Copyright , All rights reserved.

Page 138: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

c) ln the Se/ect Expression dialog box, choose your material object type. This object typecould be with the name Y##MARA, Material_Group_##, or _WI-OBJECT_ID.

d) Choose lhe Materialattribute. Make sure that there is at least one blank space beforethe first & symbol and one blank space after the second & symbol.

e) Choose Continue to go back to the task screen.

f) Choose Save.

3. Create a task description for the Change documents for material, group ## task.

With the task description, you can provide information to the work item recipient atruntime. Enterthetextoisp1ay of changes for required naterial, and insert

the runtime variable for the key of the material to be processed at the end of the sentenceagain. Make sure that there is at least one blank space before the first & symbol and one

blank space after the last & symbol.

a) On the Standard Task: Change screen, choose the Descrrptlon tab page.

b) Choose lhe Change fext pushbutton.

c) On the Task description Changescreen, enterDisplay of changes for requiredmateriar. Position the cursor at the end of the text.

d) Choose lnclude --+ Expression.

e) Choose your object type. This object could be with the name Y##MARA,M ater i al _G rou p-# #, or _W I _OB J ECT-I D.

f) Choose the Materialattribute. Make sure that there is at least one blank space before

the first & symbol and one blank space after the second & symbol.

g) Go back to lhe Standard Task: Change screen.

4. Save the Change documents for material, group ## task.

a) On the Standard Task: Change screen, choose Standard task + Save.

5. Testyourtask.

While displaying the change documents, open a new session as the same user and go tothe Buslness Workptace. Now you can see your newly defined work item text. Select thework item, and scroll in the lower screen area. You can see the task description for yourwork item.

Now, terminate this session. Choose Back to exit the change documents display. To

complete this work item, choose End work item in the fhls Work ltem Has To Be

Completed Explicitly dialog box.

a) Run the transaction code swus.

b) On the fest Workflow screen, enter your task number for the Change documents formaterial, group## task in lhe Workf low field.

c) Choose the Load pushbutton.

d) Choose the Execute pushbutton.

e) While displaying the change documents, open a new session as the same user and go

to the Business Workplace. You can see your new item text.

f) The task description of your work item displays in the lower part of the screen.

124 @ Copyright. All rights reserved.

Page 139: SAP Workflow Bit601 en Col10

Lesson: Creating Standard Tasks Usrng Synchronous Methods

g) Terminate this session.

h) Choose Back Io exit the change document display.

i) ln the This Work ltem Has To Be Completed Explicitly dialog box, choose the CompteteWork ltem checkbox.

@ Copyright All rights reserved.

Page 140: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

'r ,::,.ttrri...,.ti LESSoN SUMMARY: You should now be able to:

. Create standard tasks using synchronous methods

t26 O Copyright. All rights reserved.

Page 141: SAP Workflow Bit601 en Col10

Creating Standard Tasks Using AsynchronousMethods

LESSON OVERVIEWThis lesson explains how to use tasks to integrate object types into a workflow template. ltexplains the definition of tasks in the system. You will also learn how the Workflow Enginehandles tasks that refer to synchronous or asynchronous methods.

Business Example

You know that functions are integrated into the workflow using tasks. You now want to createthe tasks Display material change documents and Display material master, which you requirefor your workflow. For this reason, you require the following knowledge:

. An understanding of the different ways in which asynchronous methods are processed

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Define a standard task using asynchronous methods

Use of Asynchronous Methods

Tasks with asynchronous methods can have import parameters, but they do not return anyresults, These tasks must have at least one terminating event.

You must assign terminating events to each asynchronous task. The system recognizes,through the triggering event, that the method call is completed.

r Tasks with asynchronous methods canhave import parameters but they do notreturn any results

o Tasks based on an asynchronousmethod must have at least oneterminating event

r The asynchronous method is onlystarted by the workflow system

r The asynchronous method calls atransaclion of an SAP application

r The application then activates theterminating event

r The task is ended when the terminatingevent is activated

:13 F gure 37: Asynchronous Methods - Task Defin tion

MUSTbe available

I

O Copyright. All rights reserved

Page 142: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

The terminating events are published events of the business object type that is the basis of

the task.

For example, the asynchronous Delete vacation request task must have at least one

terminating event, usually the deleted event.

The application triggers the event in the context of the Delete leave request method and the

associated work item that can be completed.

Maintaining Terminating Events in the Task

Tab Page Terminating Event

il,& f igure 38: Ma nta ning Term nating Events n the Task

A terminating event applies to one instance of a task, that is, to one specific work item. The

work item in turn refers to one specific object for the object type. You must specify a

connection to this object for the terminating event.

An example of maintaining terminating events in a task is: A head of department has four

work items for vacation approval. The request numbers are2O0O (work item 1), 2001(work

item 2), 2002 (work item 3), and 2003 (work item 4).

Applicant 2OO2 deletes his or her entry. This means that the work item in the inbox is no

longer required and is to be deleted.

The Request deleted terminating event must now be generated for object 2002.

The object reference is given to the terminating event for this purpose.

The object reference for a task is always in the variable -wl-oBJECT-ID.

A terminating event for a task is specified as follows:. Object type for which the event is defined

. Name of event

. Container element -Wl-OBJECT-ID

The system saves the information about which object belongs to which work item in the

background.

128 O Copyright , All rights reserved.

Page 143: SAP Workflow Bit601 en Col10

Lesson: Creating Standard Tasks Using Asynchronous Methods

Examples of Tasks with Event Parameters Formabsenc.Approve and Formabsenc.Delete

FORMABSENCE Notification of absence

* Applo,v€

in taskSynchronous method; Method with dialog

_Wl_Result is created automatically

Job: Head of Department

Not applicable

Confirm completion of processing

"Approve notification of absence from &"

] AsslOn container elemenis Use &_Wt_Object_td.CreatedBy&

Figure 39: Example of a Task with the Asynchronous Method Formabsenc.Approve

The user can exemplify the definition of results parameters using the Approve notification ofabsence method (Formabsenc.Approve).

ln general definition, the Resu/t Parameter tab page is selected,

Under the result type, you find the reference field for the relevant value (-PROCSTATE) andthe SWXFORMAB reference table.

ln the Data Dictionary, the PROCSTATE field refers to the SWX-PROCST field type. This f ield

type is assigned a domain SWX_PROCST. The domain contains the fixed values A (Approved),R (Rejected), and N (New).

A results parameter is defined for the APPROVE method. The results parameter refers to aresult 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

for the SWX-PROCST domain. The fixed values are A, R, and N.

FORMABSENCE Notification of absence

delete Asynchronous method

Definition in task container Not necessary

Not applicable

Event: DELETED (notification of absence deleted)

Container element WI OBJECT ID

Background processing

Not appiicable

Assign container elements

Not applicable

Figure 40: Example of a Task w th the Asynchronous Method Formabsenc.Delete

@ Copyright. All rights reserved

Page 144: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

The system automatically generates the _Wl-RESULT container element in the taskcontainer. The method must supply the element in the RESULT variable.

lf you incorporate a task that links to a method with results parameters into a workflowdefinition, the Workflow Builder automatically generates outcomes corresponding to thedefined fixed values.

ln our example, three outcomes - Approved, Rejected, and New are generated automaticallyin the Workflow Builder.

130 @ Copyright. All rights reserved.

Page 145: SAP Workflow Bit601 en Col10

Create asynchronous Tasks

Business Example

You have to create a task with an asynchronous method and a terminating event to familiarizeyourself with the processing of asynchronous methods in the workflow.

The task works with the object type zoouane and the method chanse. The members of yourorganizational unit are the agents. The work item text is change the basic material inmaterial- (variabJ-e material- of the object tlpe ZOOIIARA).

The terminating event of the object zoOMARA is Basicl'rateriarchanged.

L' Create a task with the abbreviation z#*_chanse (where ## is your group number), whichcalls the method Change of the object type zoorana. All of the users in the system areagents (general task). The work item text is change the basic materiar j-nmaterial (wariable rnaterial of the object tlpe z0OtvIARA>. The terminatingevent of the object zOOrvrARA is easicr,raterialChanged.

2. ln the transaction code swus, use your material T-BBD## to test your task. ln the firststep, exit the processing without changing the basic material in the view Basic Data 2. Thework item remains in your workplace.

ln the technical view of the work item, display the event on which the work item is waiting.Use the glasses symbol to display the data in the Business Workplace and then selectGoto --+ TechnicalWork ltem Display --+ Extras -+ lnstance tinkage.

lf you then call the work item again, change the basic material in the view Basic Data 2.Your work item terminates and disappears from the workplace.

,,11,,,,,,tiiri.;,1r11,, Hint:"''',,,1,,

,;:11,. The system is already set in such a way that the eventBasicMaterialChanged is triggered for object type zOOuane. (Creation ofchange documents)

O Copyright . All rights reserved 131

Page 146: SAP Workflow Bit601 en Col10

Create asynchronous Tasks

Business Example

You have to create a task with an asynchronous method and a terminating event to familiarize

yourself with the processing of asynchronous methods in the workf low.

The task works with the object type zoOlrARA and the method Change. The members of your

organizational unit are the agents. The work item text is change the basic material inrnaterial (variable material. of the object tlpe ZOOMAR'A>'

The terminaiing event of the object ZOOI'IARA is Basicl'4aterialChanged.

1. Create a task with the abbreviation z*#_change (where #* is your group number), which

calls the method Change of the object type zoouana. All of the users in the system are

agents (general task). The work item text is Change the basic material inmaterial (variable material of the object tlpe zOOt"lARA>' The terminating

event of the object z0OII{ARA is gasicl"taterialChanged.

a) Run the transaction code Prrs.

b) on lhe Maintain standard task screen, choose the create pushbutton.

c) On the Standard Task: Create screen, enter the following data on the Basic data labpage:

Field Narne Entry

Abbr. z##_change

Work item text Change the basic material inmaterial (variable material ofthe object tlPe ZO0r'!ARA>

Object Type 20o}!ARA

Method Change

d) On lhe Terminating events tab page, enter the following data:

Field Name Entry

Element WI OBJECT ID

Event Bas icl'laterialChanged

Choose Save.

ln the Create Obiect Directory Entry dialog box, enter zoOl in the Package field.

Choose Save.

e)

0

s)

132 @ Copyright. All rights reserved.

Page 147: SAP Workflow Bit601 en Col10

Lesson: Creating Standard Tasks Using Asynchronous Methods

h) On the Standard Task: Change screen, choose Additional data ---+ Agentassignment ---+ Mai ntain.

i) On the Standard task: Maintain Agent Assignment screen, choose the Attributespushbutton.

j) ln the lask: dialog box, select the General Task radio button.

k) Choose theTransfer pushbutton.

l) Go back to theSAP Easy Access screen.

2. ln the transaction code swus, use your material T-BBD## to test your task. ln the firststep, exit the processing without changing the basic material in the view Basic Data 2.fhework item remains in your workplace.

ln the technical view of the work item, display the event on which the work item is waiting.Use the glasses symbol to display the data in the Business Workplace and then selectGoto --+ TechnicalWork ltem Display ---+ Extras ---+ Instance linkage.

lf you then call the work item again, change the basic material in the view Basic Data 2.

Your work item terminates and disappears from the workplace.

,,..,.,rrr:, ., Hint:

,. ,j The system is already set in such a way that the eventBasicMaterialChangea is triggered for object type zOOuana. (Creation ofchange documents)

a) Run the transaction code swus.

b) On the fest Workflow screen, enter rsxxxxxxxx inlhe Workflow field.

c) Press ENTER.

d) On the lnput Data tab page, choos e the lnitial Data pushbutton.

e) Enter the material number T-BBD## in the Key field.

f) Choose the Refresh Organizational Environment pushbutton.

g) Choose the Execute pushbutton.

h) The system displays the material for changing. Choose Back to exit the transaction.

i) The system brings you back to transaction code swus and displays the followinginformation in the system message line:

Task started (Current Status: in Process)

j) On the Test Workfloul screen, choose Goto --+ Technicalwork item display.

k) On the Display work item screen, choose Extras ---+ lnstance linkage.

l) On the Display /nstances linkages screen, display the following values in the instancelinkages:

. Receiver key

@ Copyright, Ail rights reserved. 133

Page 148: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

Key for the work item (receiver type) that waits for a terminating event

. Object type and event that is to be triggered

ZOOM AR A and BAS/SMA T ERI ALCH ANG ED

. lnstance identifier

Key for the concrete material object that is changed and whose change results inthe required event

Terminating events are always Iinked to concrete instances of the object types.

134 @ Copyright. All rights reserved.

Page 149: SAP Workflow Bit601 en Col10

Lesson: Creating Standard Tasks Using Asynchronous Methods

...-,: LESSON SUMMARY'::' You should now be able to:

. Define a standard task using asynchronous methods

@ Copyright . All rights reserved.

Page 150: SAP Workflow Bit601 en Col10

lntegrating Tasks in a Workflow Template

LESSON OVERVIEWThis lesson explains how to integrate a task in a workf low step.

Business Example

After creating tasks for your business process in the system, you are required to integratethem in the workflow template. You are also considering whether you can group together allthe tasks that belong to a particular project. This grouping is possible using task groups. Forthis reason, you require the following knowledge:

. How to integrate a standard task into a workflow step

..',,,,,,,,,.] I LESSON OBJECTIVES

..l..,..,...:l,.....'.'.. After completing this lesson, you will be able to:

. lntegrate tasks in a workflow template

lntegration of Tasks in Workflow Templates

Call the Workflow Builder.Seleci the 'Activity' step type.

a ln the workflow step, enter

a A task abbreviation or

I A workflow abbreviation

r Ensure the binding for the data exchangebetween the task container and theworkflow container.

r Specify names for the outcomes of the

"Activity" step type in aworkflow

,.. refers to a task

ffi Rctivitv t

step (how does th€ tasUworkflowend?) ,.. refers to a workflowa Define agents

. Open the interface to be able to test theworkflow with input data in iest lransactionswus.

. Design deadline monitoring if required.

.{}* Flgure 41: ntegrat ng a Task in a Workflow

ffie.uuitvz

--NtJtMultiple ouicomes

Activity steps in a workflow can refer to:. A standard task, represented by a simple triangle.

. A workflow represented by three triangles (the associated workflow is called asubworkflow).

The binding defines the data exchange between the different containers in a workf low.

136 @ Copyright, All rights reserved

Page 151: SAP Workflow Bit601 en Col10

Lesson: lntegrating Tasks rn a Workflow Template

The system generates a proposal for the binding. lt is up to you to check whether thisproposal is suitable.

ln the workflow container for the element that represents the leading object, select lhe lmportcheckbox to be able to transfer data into the workflow in the test transaction code swus.

Double-click the required element in the workflow container.The Import checkbox is on theAttributes tab page.

You determine the work item recipients for this step in the Agents section. lf they are allowedto execute the tasks in question (that is, they are possible agents for the task), theserecipients receive the work item in their workplace. You see the possible agents for the task inthe Attributes for Task section.

On the Notif ication tab page, you can specify a recipient who receives a message when thestep completes. The message text is defined in the underlying task.

You can define deadlrne monitoring on the Latest Start, Required End, and Lafest End labpages.

O Copyright . All rights reserved,@rtil|teffitr

137 ;vr\ 1/lffio

Page 152: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

138 @ Copyright . All rights reserved.

Page 153: SAP Workflow Bit601 en Col10

l.$,

lntegrate Tasks in a Workflow Template

Business Example

You have created standard tasks that you now want to call in your workf low definition. Youwant to test the workflow template in the test transaction code swus, and enable the transferof input data for it in the same transaction.

1. lnsert your Change documents for material, group ## (where ## is your group number)task as the new first step in your workflow.

Call the Workflow Builder. Your workflow template displays.

. .ir',',:r:l:,,t . Hint:r.',.1.1,l.l.: ,'1,,. lf the template does not display, you can find it using Other Workflow/'':i

Version, the F4 help, and the abbreviation of your workflow template zwfx##

lnsert the task directly after the step Workflow started. At some stage during theprocessing, the system displays the generated binding in a dialog box. Choose Continue toconfirm the binding. Select Expression as the agent of this step and then choose the&_wF_rNrrrAToR& element using the input help (F4). Enter a text in the Outcomes tab forStep execuf ed,for example, Change documents displayed. Exit the screen, and activateyour workflow again.

Choose fest to go from the Workf low Builder to the test transaction code swus. Try totransfer your r-eao## material as input data.

Change the properties of the container element for your Y##MARA object. Select thelmport and Mandatory checkboxes for the container element in the workf low containerthat contains the reference to the current material master. Generate a new runtimeversion.

Test your workflow.

You can now transfer input data. Transfer your material T-BBD#*, and save the test data.Execute the workf low.

2.

3.

O Copyright. All rights reserved.

Page 154: SAP Workflow Bit601 en Col10

lntegrate Tasks in a Workflow Template

Business Example

You have created standard tasks that you now want to call in your workflow definition. You

want to test the workflow template in the test transaction code Swus, and enable the transfer

of input data for it in the same transaction.

1.. lnsert your Change documents for material, group ## (where ## is your group number)

task as the new first step in your workflow.

Call the Workflow Builder. Your workflow template displays.

Hint:lf the template does not display, you can find it using Other Workflow/Version, the F4 help, and the abbreviation of your workf low template zwfx##.

lnsert the task directly after the step Workflow started. At some stage during the

processing, the system displays the generated binding in a dialog box. Choose Continue loconfirm the binding. Select Expression as the agent of this step and then choose the

6._wF_rNrrrAToR& element using the input help (F4). Enter a text in lhe Outcomes tab for

Step executed,for example, Change documents displayed. Exit the screen, and activateyour workflow again.

Choose fest to go from the Workflow Builder to the test transaction code swus. Try to

transfer your T-BBD** material as input data.

a) On the SAP Easy Access screen, choose fools -r Business Workf low -, Development

---+ Definition fools --+ WorkflowBuilder ---+ WorkflowBuilder.

b) On lhe Workflow Buitder - Change 'WF##'screen, choose lhe Workflow started

symbol.

c) Choose Edit ---, Create -- SteP.

d) Choose the step type.

e) On the Controttab page, enter your task number in the lask f ield.

f) Press ENTER.

g) On lhe Define Container Elements and Bindings dialog box, choose continue.

h) On the Control tab page, choose Expression and enter &-ryF-INITIAT9R&.

i) On the Outcomes tab page, enter changes displayed in the Name field'

j) Go back to the Workflow Builder - Change 'WF##' screen.

140 @ Copyright . All rights reserved.

Page 155: SAP Workflow Bit601 en Col10

Lesson: lntegrating Tasks in a Workflow Template

k) On the Workflow Builder - Change'WF##'screen, choose the Generaf e and activateru ntime versions pushbutton.

l) Choose the fest pushbutton.

lf you try to retrieve input data, the element _wr_oB.rEcr_ro, which is your elementthat represents the leading object in the workflow container, is not offered as a value.ln the standard system, you cannot transfer externaldata to the workflow interface.You must explicitly define the variable that represents the object as being importenabled.

2. Change the properties of the container element for your Y##MARA object. Select theImport and Mandatory checkboxes for the container element in the workflow containerthat contains the reference to the current material master. Generate a new runtimeversion.

a) On the Workflow Builder - Change'ZWF_TEST1_##'screen, on the left-hand side ofthe screen, choose Workflow Container in the selection menu.

Double-click Y##MARA in the E/emenf field.

ln the Change Container Element dialog box, on Ihe Properties tab page, select theImport and the Mandatory checkboxes.

d) Choose Continue.

e) 0n the Workflow Builder - Change'ZWF_TESTL-##'screen, choose the Generate andactivate ru nti me versions pushbutton.

3. Test your workflow.

You can now transfer input data. Transfer your material r-eep##, and save the test data.

Execute the workflow.

a) On the Workflow Builder - Change'ZWF-TESTI-##'screen, choose the Iestpushbutton.

On the Test Workflow screen, on the lnput Data tab page, choose Y##MARA inlheExpression field and choose No lnstance.

Enter r-eoo## in the key field.

Choose Save.

Choose the Execute pushbutton.

Go back to exit the display for change documents, and explicitly end the work item and

the workflow.

b)

c)

b)

c)

d)

e)

f)

@ Copyright. All rights reserved t41

Page 156: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

""r'r iii rr I l:ia, :rl

:, ,1,1,,,t..,..,, LESSON SUMMARY::rl You should now be able to:

. lntegrate tasks in a workflow template

r42 @ Copyright . All rights reserved

Page 157: SAP Workflow Bit601 en Col10

Using Task Groups and the Business WorkflowExplorer

LESSON OVERVIEWThis lesson explains how to administrate tasks in task groups and how to use task groups for

agent determination. One method of administrating tasks is using the Business Workflow

Explorer.

Business Example

Now you have created tasks for your business process in the system, you are required tointegrate them into the workflow template. You are also considering whether you can group

together all the tasks that belong to a particular project. This grouping is possible using taskgroups. For this reason, you require the following knowledge:

. An understanding oftask groups

. An understanding of the Business Workflow Explorer

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Use task groups and the Business Workflow Explorer

Task Groups

Standard task n i

Workflow temPlate 'l

template m

Figure 42: Task Groups

It is possible to havetask groups within

task groups

@ Copyright. All rights reserved

Page 158: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

Logically related tasks can be grouped together in task groups. Task groups can also have a

descriptive text, which enables you to document the use of the task group precisely.

The following are applications of task groups:. Group the workflow templates that only communicate with each other using events into a

task group. You, therefore, gain a better overview.

. Bundle tasks (workflow templates and standard tasks) that belong to one work area toincrease 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.

Hint:,:' .' ' ,,,,: Task groups can only contain the task types workflow template and standard

task. Workflow tasks and customer tasks are no longer supported.

Task Groups - lnheritance

(Patrick Smith)

Patrick Smith)

USSCHMIDTPA (Palrick Smith)

F gure 43: Task Groups - lnheritance

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 figure Task Groups -lnheritance, the tasks in a task group also inherit the characteristics of the task group that are

highest in the hierarchy.

With extensive inheritance hierarchies, user can make undesired agent assignments 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.

The Business Workflow Explorer , ..,. ti \) f,,,1TheBusinessWorkflowExplorer: - ) Yr -\. Provides one medium for managing tasks and workf lows

@ Copyright. All rights reserved.

Page 159: SAP Workflow Bit601 en Col10

Lesson: Using Task Groups and the Business Workflow Explorer

. Provide the ability to:

- Create

- Change

Display

- copy

- Assign Employees

. No help values required; all relevant tasks displayed directly

The Business Workflow Explorer facilitates the management of workflow projects. All taskscan be assigned to a task group. The relevant employees incorporate this task group into thesearch range of the Business Workflow Explorer.

The functions mentioned here can always be accessed from context menus.

The following functions are also possible:. Display of the current workflows of task

. Quick overview of the most important task attributes

The Business Workflow Explorer always uses a defined search area. The user can define thisarea interactively. Note that calling the Business Workflow Explorer takes longer whenaccessing the largest chosen search range since all tasks have to be imported with theirattributes. Therefore, ensure that the chosen search range is not unnecessarily large.

You can search using the following objects:. Task groups

. Applicationcomponents

. Other (SAPphone tasks, local objects)

O Copyright , All rights reserved 145

Page 160: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

146 @ Copyright . All rights reserved

Page 161: SAP Workflow Bit601 en Col10

Use Task Groups

Business Example

You can use task groups to bundle associated tasks and workflows based on a project or afunction. For example, a task group exists which contains all tasks for notifications ofabsence. You can refer to task groups in the Workflow Builder. All tasks and workflows of agroup are summarized based on a project. This means that each member of the project wouldalways have access to the objects already generated.

1. Create aZ##_AG task group, and enter your tasks and your workflow into this task group.

@ Copyright . All rjghts reserved 747

Page 162: SAP Workflow Bit601 en Col10

Use Task Groups

Business Example

You can use task groups to bundle associated tasks and workflows based on a project or afunction. For example, a task group exists which contains all tasks for notifications ofabsence. You can refer to task groups in the Workflow Builder. All tasks and workflows of agroup are summarized based on a project. This means that each member of the project wouldalways have access to the objects already generated,

1., Create aZ##_AG task group, and enter your tasks and your workflow into this task group.

a) On the SAP EasyAccess screen, choose fools --+ BusinessWorkflow ---+ Development + Definition Tools ---+ Tasks/Task Groups -+ Create.

b) On the lask; Maintain screen, enter the following data:

Field Name Value

Task type Task grroup

Task z*#_Ae (where #* is the group number)

Choose the Create pushbutton.

On the Task Group: Create screen, on the Basic data tab page, enter the following data:

On the Standard tasks tab page, enter your standard task in the Obiecf /D f ield.

On the Workflow template tab page, enter your workflow template in the Oblect /D field.

Choose Save.

c)

d)

e)

f)

s)

Field Name Value

Abbr. z#* AG

Name Task Group, Group ##

148 O Copyright . All rights reserved

Page 163: SAP Workflow Bit601 en Col10

Lesson: Using Task Groups and the Business Workflow Explorer

LESSON SUMMARYYou should now be able to:

. Use task groups and the Business Workflow Explorer

@ Copyright. All rights reserved

Page 164: SAP Workflow Bit601 en Col10

Unit 4: Definition of Tasks

150O Copyright . All rights reserved

Page 165: SAP Workflow Bit601 en Col10

Learning Assessment

lf an asynchronous method call is used for a task, ihe method does not returnconfirmation of completion to the calling workflow,

Determine whether thls stateme nt is true or false.

fr true

I Fatse

2. Which entries always have to be maintained when defining a standard task to ensure thatno problems occur at runtime?

Choose the correct answers.

lZ A Possible agents

fi A An abbreviation

! C Terminating events

ff O An object type and its method

3. You have to assign terminating events to each asynchronous task.

Determine whether this statement is true or false.

True

False

buffers data in different contexts.

Choose the correct answer.

ZTThe4.

/ A Workflow Engine

B Workflow Builder

I C workflow definition

O Copyright. All rights reserved.

Page 166: SAP Workflow Bit601 en Col10

Unit 4: Learning Assessment

\.' ln a workflow step, you can link to a standard task or a workf low template.' Determine whether this stateme nt is true or f alse.

True 1 ..

-lw\.r^t^^IdIJU

6. To transfer input data to a workflow in the test transaction SWUS, the leading object in theworkf low container must have the property import.

Determine whether this stateme nt is true or false.

True

False

7. Task groups can be used to define the search range in the Business Workflow Explorer.

Determine whether thls stateme nt is true or false.

True

False

B. The Business Workflow Explorer facilitates the management of workflow projects.

Determine whether this statement is true or false.

True

False

ntr

aT

WT

n!

r52 @ Copyright. All rights reserved

Page 167: SAP Workflow Bit601 en Col10

Learning Assessment - Answers

1. lf an asynchronous method call is used for a task, the method does not returnconfirmation of completion to the calling workflow.

Determine whether this statement is true or false.

True

False

Which entries always have to be maintained when defining a standard task to ensure thatno problems occur at runtime?

Choose the correct answers.

I n Possible agents

B An abbreviation

I C Terminating events

E D An object type and its method

Without an abbreviation, the task cannot be created. lf there are no possible agents, this

leads to problems at runtime. A task is also of no purpose if is does not contain an object

type or a method. Terminating events only need to be maintained if the method is an

asynchronous method.

3. You have to assign terminating events to each asynchronous task.

Determine whether this statement is true or false.

True

False

ET

ET

€l Copyright , All rights reserved 153

Page 168: SAP Workflow Bit601 en Col10

Unit 4: Learning Assessment - Answers

buffers data in different contexts.4. The

Choose the correct answer.

ln

El

EnThe

ET

EI

[] n Workflow Engine

B Workflow Builder

C workflow definition

5. ln a workflow step, you can link to a standard task or a workflow template

Determine whether fhis stateme nt is true or false.

True

False

When the workflow template is called, the named workflow is started and run throughcompletely.

6. To transfer input data to a workflow in the test transaction SWUS, the leading object in theworkflow container must have the property import.

Determine whether this statement is true or false.

True

False

interface of the workflow must be opened explicitly for external data.

7. Task groups can be used to define the search range in the Business Workflow Explorer

Determine whether this statement is true or false.

True

False

B. The Business Workflow Explorer facilitates the management of workflow projects.

Determine whether this statement is true or false.

True

False

154 @ Copyright. All rights reserved

Page 169: SAP Workflow Bit601 en Col10

Lesson IExplaining Containers and Binding Directions

Exercise 11: Explain Containers

Lesson 2

Defining Container Elements and Blndings

fxercise 12: Use the Binding Editor ' I , -,,

Lesson 3

Using Secondary Methods and the Step Type Container Operation

: , Exerclse ].3: Use Container Elements and Bindings

156

161

164

167

t73t75

....,,. .....l.,:. uNlr oBJEcrlvES

i.'.r.r'" ' . Explain containers and binding directions

. Define container elements and bindings

. Use secondary methods and container operations step type

O Copyright , All rights reserved 155

Page 170: SAP Workflow Bit601 en Col10

Explaining Containers and Binding Directions

LESSON OVERVIEWThe Workflow Engine uses containers as an interface for data. This lesson introduces thecontainers that are active at different times throughout the runtime of a workflow.

Business Example

You have integrated a task in your workf low that displays the change documents for a specificmaterial at runtime. Now, you need to understand which interface you use to link this materialto the workflow and how the individual tasks can access the material. For this reason, you

require the following knowledge:

. An understanding of containers and bindings

. An understanding of binding at definition time versus binding at runtime

. An understanding of binding directions

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Explain containers and binding directions

Overview of Containers and Bindings

Data transfered to event container

Method container

Ftgure 44. Workflow for Changing Material Master - Container

156 @ Copyright. All rights reserved

Page 171: SAP Workflow Bit601 en Col10

Lesson: Explaining Containers and Binding Directions

The following sequence describes how and which containers are filled when a workflow isstarted with a triggering event:

1. User Jones changes the material master P-1OO and, therefore, triggers theold_material-changed event.

2. The event, in turn, triggers the Change material master workf low.

3. ln the event container, the system transfers from the event the object reference and theperson who triggered the event. The variable for the person who triggered the event is

-EVT-CREATOR and -EVT-OBJECT

is the variable for the object reference.

4. Both the values are transferred from the event container to 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.

5. The task containers are created from the workf low container.

t*li Caution:iii$ il& The task containers do not know their variables. During runtime, the workflow. ..:.'

runtime system transfers the values from the workflow container into the

task container.

A _Wl_OBJECT_ID is the variable for the object reference that exists in each task container.

The task recognizes the object reference because you must specify the object type when you

define the task.

Values can be transferred back to the workflow container from the task container, forexample, the _Wl_ACTUAL_AGENT element that contains the user who executed the workitem. ln turn, a subsequent task can then be filled with this value from the workflow container,

for example, in the work item text. You can also enter elements from the Workflow Container

as the agent of a workf low step.

Binding at Definition Time Versus Binding at Runtime

Question at definition time:: Definition of modeling and

assignment rules that areimplemented at runtime for

r Transferring data from onecontainer to anothercontainer

r Assigning (initial) values tosome container elements

Runtime

r Binding definition is executed atruntime

r This means that data ismoved from one containerto another

What data has to betransferred to supPort theprocess?

Figure 45: Binding

@ Copyright . All rights reserved 157

Page 172: SAP Workflow Bit601 en Col10

Unit 5: Containers and lnterfaces in Workflows

Binding refers to the definition of modeling and assignment rules implemented at runtime fortransferring data between containers and assigning values to container elements.

The workflow container appears on the left in the Workflow Builder. ln releases before 6.10,the workf low container appears on the right.

The task container is visible for any task on the Container tab page.

The binding definition is always executed with reference to the elements of a container. Thismeans that an expression is assigned to the container element or the container element isassigned to an expression.

Except for binding for rules, the system automatically generates a proposal for the requiredbindings at definition time. You must check whether each binding generated is correct.

You can define the binding between the workflow container and the task container whenentering the task, by choosing the Binding pushbutton in the workf low step. The binding forthe rule container is available after the Binding pushbutton in the Agenfs box in the workf lowstep. The binding of the event for the workflow container is available, for example, under theStart event tab page in the basic data of the Workflow Builder.

Binding Directions and Binding Example

W€ifi ilem qonlaittetli: '..:rTi$k'.canlain€r rl

rt

F gure 46: Containers and Binding Drrections

The task container always contains an element that can save the reference to the object to beprocessed in the relevant single-step task (_Wl-Object_lD). lt also contains the_Wl-Actual-Agent element. This is the agent who actually executes the work item. Forsynchronous tasks with a defined result parameter, the _Wl_Result element can store theresult of the underlying object method.

The workflow container always contains an element that can store the user name of theinitiator of the current workf low (_WF_lnitiator). For most workflows you have to createadditional elements in the workflow container to hold other relevant data. To do this, you can

either go along with the SAP proposals or create your own element. For example, you have toprovide a storage element for the main object of your process.

158 @ Copyright. All rights reserved

Page 173: SAP Workflow Bit601 en Col10

Lesson: Explaining Containers and Binding Directions

The event container always contains an element that can save the (object) reference to theobject whose change of status is made known using the -EVT-Object event. lt also always

contains an element with the name of the user responsible for changing the status of theobject (_EVT_Creator).

The rule container contains the elements that are required as input for rule resolution atruntime.

lf you def ine a default rule for the task, the binding can also occur from the task in the rule.

The method container contains the elements that are import parameters in connection withthe method execution. You can use macros to make the values available in the method.

Example of Binding Definition - 1

The binding is always at the appropriate place in the workf low definition. The systemgenerates bindings automatically. You must check the definition.

On the Triggering Eventlab page in the workflow template, you can define theEvent ---, Workflow Container binding.

On the Controttab page, you can def ine lhe Workflow Container ---+ Task Container bindingwhen entering the task in the workflow step.

On the Controltab page in the workflow step, you can define Ihe Workflow Container ---+ Rule

Container binding. This is displayed if the agent determination is set to occur using a rule.

To locate the binding to the method container, on the Task Definition screen, choose

Goto ---, Binding---+ Object Method.

The following are the main bindings that are done in the Notification of Absenceworkflow:. Event ---+ Workflow Container

&EVT CREATOR&--+& WF INITIATOR&

.-- Notrfication of absencel.iffi approvat

Approved l_-.-..--..--..----]

ffi Sends mailNo

Mail senl

&+ryqlregerNo I a"pprouatu

-iL wort Ro*Iiffi Eno

I

J- workflowE$l comptet.d

1,$ Figure 47:Dema Example - Bindlng Definltion

:F=tDg;"*ED6!f, (Do*5ooo+o'=(o;so-:\<o :EtO_O

O Copyright . All rights reserved. 159

Page 174: SAP Workflow Bit601 en Col10

Unit 5: Containers and lnterfaces in Workflows

&EVT_OBJ ECT& -- &Formabsenc&

. Workflow Container --+ Task

&Formabsenc&'-+ &_Wl_OBJ ECT_I D&

Each task is to be retrieved individually from the workflow container.

Example of Binding Definition - 2

lf the rule resolution of a workflow step requires an import parameter, the workflow containeris required to provide these parameters.

Binding

Workflow Container --+ Rule Container

& WF INITIATOR&---&ORG OBJECT&

qlH:'ff::- "created

+ lFIB

:3 l519^)29(D (t+6 =.r': 4qro a::: o (ct3a as.g *ob' +-Cto ogr4 :9e soE o(DO It!.6 o

o.<c

Workflow'container

@ );JLx1l* ofabsence

l{I

-

Approved I --lRejected,t v Notification of absence

E*l sends mait Wjl "b"']n"" r

Delete notificationMail sent

Figure 48: Demo Example - Binding Def inition

160 @ Copyright . All rights reserved.

Page 175: SAP Workflow Bit601 en Col10

Explain Containers

Business Example

You want to explain the different containers and their binding directions to project members

Answer the following questions:

Which workflow components have their own containers?

@ Copyright. All rights reserved

Page 176: SAP Workflow Bit601 en Col10

Explain Containers

Business Example

You want to explain the different containers and their binding directions to project members.

Answer the following questions:

Which workflow components have their own containers?

The workflow components with their own containers are workflows, tasks, events, rules, andobiect methods.

t62 @ Copyright . All rights reserved.

Page 177: SAP Workflow Bit601 en Col10

Lesson: Explaining Containers and Binding Directions

1l :r"t ,tt:

',r ...;lt''i;1i LESSON SUMMARY

":.'r "' You should now be able to:

. Explain containers and binding directions

@ Copyright. All rights reserved

Page 178: SAP Workflow Bit601 en Col10

Defining Container Elements and Bindings

LESSON OVERVIEWThis lesson explains how to check the containers in the system.

Business Example

The standard elements of a container may not be sufficient for your requirements. You,therefore, need to learn how to add elements to the container and how to provide thecontainer with data. For this reason, you require the following knowledge:

. How to create a workflow container element

. How to create a task container element

. How to check container bindings

.1.u: LESSONOBJECTIVES'...li After completing this lesson, you will be able to:

. Define container elements and bindings

Container Elements - Definition and Runtime

Containers are used for accepting attribute values, constants, and object references forcontrol and monitoring, for the workflow process and the execution of work items.

Containers contain

r Field values

r Object reterences

Definition Runtime *

F gr,re 49. Co^rar^er - De'rnitio'r a"d Runtire

L64 @ Copyright. All rights reserved

Page 179: SAP Workflow Bit601 en Col10

Lesson: Defining Container Elements and Bindings

The workflow system creates container definitions as standard. The tasks and methods used

in the workf low are the basis for the defined fields.

As a customer, you can enhance container definitions at any time. ln the Workflow Builder,

you can use the context menu to edit the container definition.

The container definition in the workflow describes the elements to be stored in the container,

with their element name, description, and data type reference. The description can refer to a

field in the ABAP Dictionary, to an object type, or to any field with a known data type.

A container instance is a table-like runtime structure derived from the container definition'

The following are considerations when instantiating a container:. The name of an element is entered in a line together with its value.

. The data type of this value for the container instance must comply with the data type

reference established at definition time.

The Binding Editor

The Change Binding For Step screen consists of two parts and each part consists of three

sections. The left side of the screen displays everything that belongs to the workflow

container; the right side of the screen represents the task container.

The top section lists the elements contained in the containers. The middle section displays

the binding from the workflow container to the task container. ln the lower section, you define

the binding from the task container to the workflow container, when required.

you can define the dataflow between the containers using Drag&Drop. To do this, select the

source element and generate it on the target element in the other container.

Binding is possible in both directions between the workflow and task containers.

Drag&Drop functions were not possible in releases up to and including Release 4.6C.

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

t:E-tuho.-obj.a.! il j.;r,ob,e.b

t O,s,a.ori,ro

I Ot!3.irs.rm

ar*srr:.*s*jwlrli€tre-4r--'lf i5a.r:ia3l:i:!rc:w**qi:ffi i

!, :l& fi il

Figure 50: Edit ng a Binding in the Workf low Butlder

O Copyright. All rights reserved. 165

Page 180: SAP Workflow Bit601 en Col10

Unit 5: Containers and lnterfaces in Workflows

Provide Data to the Container

Following are the possible ways in which data can reach the Workflow container:. From the container elements of the triggering event

. From the export parameters or results of a task

. From the input data specified when testing the workflow

. From the initial values assigned to the workflow container elements

. From a container operation step

Following are the possible ways in which data can reach the Task container:. From the interface to the workflow container

. From a terminating event

. From method parameters

. From initial values assigned to the task container elements

How containers are assigned values at runtime is shown in workflow runtime reporting.Display the technical log for a workflow. You will find the icons for the container next to eachstep. The container on the top level of the log is the workflow container; all other containersare task containers.

You also always recognize the workflow container since it contains the initiator element of theworkflow instance.

Container elements can or must be used in the following:. Work item text

. Descriptive texts (task description, missed deadline texts, notification texts)

. Export interface of the object method

. Export interface of the task

' Export interface of the rule

. Secondary methods

. Condition editor (step type condition, loop)

. Additional start conditions for workflows

166 @ Copyright . All rights reserved,

Page 181: SAP Workflow Bit601 en Col10

Use the Binding Editor

Business Example

Your workflow, which starts as soon as the material master changes, contains two steps aparifrom the user decisions - display change documents and display material master. Thebinding ensures that both ihe tasks recognize the currently valid material. When creating theworkf low def inition, def ine the binding between the workf low and the task container.

Taskl

Call your workflow for the material master change in lhe Workflow Builder.

1. Your workf low for changes to the material master has two steps, display changedocuments and display material master. You have already implemented the first step in

the workf low. Now implement the second step. Start lhe Workflow Builder.

Task 2

After the Change documents for material, group ## task, insert the Display material master,group ## task.

1, lnsert lhe Display material rnaster task.

Task 3

Determine the responsible agent for the step.

1. Define the position of the manager of your organizational unit as the agent for this step.

Task 4

Check the binding between the two tasks.

1. Determine with which material the first task should work.

2. How is the object transferred to the second task? Display the binding for the second task.ls it correct?

Task 5

Activate and test the workflow.

L, ln the first step, the change documents are displayed to the workflow initiator. After thefirst step has been processed, a work item is displayed for the 8lT601-MGR## manager.lfyou are executing the test as a manager, the material is displayed immediately,

Otherwise, switch to a mode where you are logged on as a manager, and execute the workitem to ensure that your material was transferred correctly. lf you have problems

O Copyright . All rights reserved.

Page 182: SAP Workflow Bit601 en Col10

Unit 5: Containers and Interfaces in Workflows

executing the work item, use Refresh organizational environmenf in the inbox of your

organ izational environment.

168O Copyright , All rights reserved

Page 183: SAP Workflow Bit601 en Col10

Use the Binding Editor

Business Example

Your workflow, which starts as soon as the material master changes, contains two steps apart

from the user decisions - display change documents and display material master. The

binding ensures that both the tasks recognize the currently valid material. When creating the

workflow definition, define the binding between the workf low and the task container.

Taskl

Call your workflow for the material master change inlheWorkflow Builder,

L. Your workf low for changes to the material master has two steps, display change

documents and display material master. You have already implemented the first step in

the workf low. Now implement the second step. Start the Workflow Builder '

a) On the SAP EasyAccess screen, choose Iools --- Euslness

Workflow --> Development'--+ Definition fools ---+ Workflow Builder'

b) On the Workf low Buitder - Change ZWF-TESTI-## screen, the workflow template is

displayed.

lf the workf low is not displayed, choose Other Workflow/Version using the abbreviation

zwf*##.

Task 2

After the Change documents for materiat, group ## task, insert the Display material master,

group ## task.

1. lnsert lhe Display material master lask.

a) On IheWorkftow Buitder - Change ZWF-TESTI-## screen, choose Change documents

for material, group ## in the Navigation area pane'

b) ln the context menu, choose Create.

c) ln the Se/ection menu dialog box, double-clickActivity.

d) On the Controltab page, enter the following data:

Field Name Entry

Task TSxxxxxxxx

Step Name Change documents for material,group##

e) Choose lheBinding (Exists) pushbutton.

Task 3

@ Copyright. All rights reserved

Page 184: SAP Workflow Bit601 en Col10

Unit 5: Containers and lnterfaces in Workflows

Determine the responsible agent for the step.

L. Define the position of the manager of your organizational unit as the agent for this step.

a) On the Workflow Builder - Change ZWF_TESTI_## screen, enter position in theAgents field.

b) ln the Choose Position dialog box, enter zpos* in the Search ferm f ield.

c) Choose the Transfer and to Graphic pushbutton.

Task 4

Check the binding between the two tasks.

1. Determine with which material the first task should work.

a) Run the transaction code swus and transfer the test data. The reference to the testmaterial is saved inlhe workflow container. ln the binding, the reference is transferredfrom the workflow container into the task container.

2. How is the object transferred to the second task? Display the binding for the second task.ls it correct?

a) On the Workflow Builder - Change ZWF_TESTI_## screen, choose Change documentsfor material, group ## in the Navigation Area pane.

b) On lhe Workflow Builder - Display ZWF-TESTL_## screen, choose Ihe Binding (Exlsts)pushbutton on the Control tab page.

c) ln the Display Binding For Step dialog box, choose &_WI_OBJECT_ID& in the Sfep'Change documents for material, group##'.

d) Choose Continue.

e) Go back to the Workflow Builder - Change ZWF-TESTI_## screen.

Task 5

Activate and test the workflow.

1. ln the first step, the change documents are displayed to the workflow initiator. After thefirst step has been processed, a work item is displayed for the B\T601-MGR## manager.lfyou are executing the test as a manager, the material is displayed immediately.

Otherwise, switch to a mode where you are logged on as a manager, and execute the workitem to ensure that your material was transferred correctly. lf you have problemsexecuting the work item, use Ref resh organizational environment in the inbox of yourorganizational environment.

a) On the Workf low Builder - Change 'ZWF_TESTI_##' screen, choose lhe Generate andactivate runti me version pushbutton.

b) ln the Navigation Area pane, choose Change documents for material, group ##.

c) On the fest Workflow screen, choose Y##MARA on the lnput Data tab page.

d) Choose <No /nstance> in the Values field and enter r-gao##.

e) Choose Execute.

170 @ Copyright . All rights reserved.

Page 185: SAP Workflow Bit601 en Col10

Lesson: Defining Container Elements and Bindings

f) Go back to the SAP Easy Access screen.

g) On the SAP Easy Access screen, choose the SIP Business Workplace.

h) On the Business Workplace of 8lT601screen, choose Seftings - Workflowsettlngs ---+ Refresh organizational environment.

O Copyright . All rights reserved.

Page 186: SAP Workflow Bit601 en Col10

Unit 5: Containers and Interfaces in Workflows

:,.ar:..,.''' ' LESSON SUMMARY:lr""l You should now be able to:

. Define container elements and bindings

L72@ Copyright. All rights reserved.

Page 187: SAP Workflow Bit601 en Col10

Using Secondary Methods and the Step TypeContainer Operation

LESSON OVERVIEWThis lesson shows you how to use secondary methods and the Container Operation step type.

Business Example

The standard elements of a container may not be suff icient for your requirements. You,therefore, need to learn to add elements to the container and to provide the container withdata. For this reason, you require the following knowledge:

. An understanding of step type container operations

. An understanding of secondary methods

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Use secondary methods and container operations step type

Step Type Container Operation and Secondary Methods

You can provide values for container elements using a special workflow step. This requires a

container operation step. Container operations are necessary, for example, if you want toexecute a secondary method, in addition to the main method.

Scenario: ln a workflow for processing material, you want to supply an objectreference that refers to the material group object type

.f 3 tl'G{tQ *,9ti{.1i:t:1, {\ e}61- c)!f "' 'ir:ir' 'r,1 ,:.1}s

Self-defined;

Value fromtransferredmaterial(event)Object

teferenceto material group

i Flgure 51: Example of a Container Operat on - Providing the Oblect Reference of the Material Group

@ Copyright. All rights reserved

Page 188: SAP Workflow Bit601 en Col10

Unit 5: Containers and lnterfaces in Workflows

The binding entered in the workf low step provides data for the main method. Therefore,another method must provide elements from the secondary methods with valid values(container operation, binding from an event).

lf the element in the workflow container does not already exist, first create an object referencein the workflow container.

For example, you can create a material group element in the workflow container withreference to the material group object type BUS1072.

Then insert the container operation step into the workflow. The leading object in yourworkflow is a material master.

The container operation provides the materral group element with the value of the materialgroup (MATERIALGR0UPl) from the material master (element Z00MARA) in the workflowcontainer.

,fft,, Caution:The material number (database key field) must not be transferred. Enter thereference to the entire material group object (object reference).

174 @ Copyright , All rights reserved.

Page 189: SAP Workflow Bit601 en Col10

Use Container Elements and Bindings

Business Example

Save the agent of the first step (display change documents) in a newly created variable

ZAGENT_TASKl in the workflow container. Ensure that this agent from the first step also

executes the Display material master step.

ln the workflow log, display that your new variable really contains the agent in the f irst step

Hint:You are required to save data between the workflow steps.

1. Save the agent of the first step (display change documents) in a newly created variable

ZAGENT_TASK] in the workf low container. Create the variable with the following

definition, Table WFSYSI, field Agent.

2, Ensure that the agent in the first step that you saved in the variable ZAGENT-IASKI also

executes the display material master step.

3. ln the workflow log display that your new variable really contains the agent from the first

step.

O Copyright . All rights reserved

Page 190: SAP Workflow Bit601 en Col10

Use Container Elements and Bindings

Business Example

Save the agent of the first step (display change documents) in a newly created variableZAGENT_TASK1 in the workflow container. Ensure that this agent from the first step alsoexecutes the Display material master step.

ln the workf low log, display that your new variable really contains the agent in the first step.

Hint:You are required to save data between the workf low steps.

L. Save the agent of the first step (display change documents) in a newly created variableZAGENT_TASKI in the workflow container. Create the variable with the followingdefinition, Table WFSYSf, field Agent.

a) Run the transaction code swoo.

b) On lhe Workflow Builder - Change 'ZWF_TESTL-##' screen, in the selection menu,choose Workflow Container.

c) ln the Workf low Container pane, choos e <Double-Click to Create> in the Element f ield.

d) ln the Create Container Element dialog box, enter the following data:

Field Name Entry

Element ZAGENT TASK1

Name Agent_Task1

Description Agent in first step

e) On the D. Type tab page, select lhe ABAP Dict. Reference radio button and enter thefollowing data:

f) Choose Continue.

g) ln the Navigation area pane, choose Change documents for material, group ##

Field Name Entry

Structure wfsyst

Field Agent

176 @ Copyright . All rights reserved

Page 191: SAP Workflow Bit601 en Col10

Lesson: Using Secondary Methods and the Step Type Container Operation

h) On IheWorkflow Builder - Change'ZWF_TESTI_##'screen, on the Controltab page,

choose the Bindings (Exlsts) pushbutton.

i) The Change Binding For Step dialog box shows the binding between the workflowcontainer and the task container.

j) ln the Step'Change documentsfor material', group ## pane, choose_W_Actual_Agentand drag and drop it to the ZAGENT_TASKJ in lhe Workflow field.

k) The system creates the binding f rom the task container to the workf low container.

l) Choose Continue.

m) Choose the Transfer and to graphic pushbutton to return to the definition of yourprocess.

2. Ensure that the agent in the first step that you saved in the variable ZAGENT_IASK-I alsoexecutes the display material master step.

a) On the Workflow Builder - Change 'ZWF_TESTI_##'screen, double-click displaymaterial master.

b) ln the Expression for step agent dialog box, choose ZAGENT_TASKJ in the Expressionf ield.

c) Choose lheTransfer and to graphic pushbutton.

d) ln the Agents pane, enter ZAGENT_TASKI in the Expresslon field.

e) Choose lheTransfer and to graphlc pushbutton.

f) Choose the Generate and activate runtime version pushbutton.

g) Choose the fest pushbutton.

h) Choose the Execute pushbutton.

3. ln the workflow log display that your new variable really contains the agent from the firststep.

a) Run the transaction code swus.

b) On the fest Workflow screen, choose the Execute pushbutton.

c) Choose the Workflow Log pushbutton.

d) On lhe Workf low Log screen, choose Goto -> List with technical details.

e) On lhe Workf low log (View with technical details) screen, choose the Container labpage.

f) On the Container tab page, choose ZAGENT_TASKI in the Expresslon field.

g) ln the Steps pane, choose Material master change ok?.

h) On lhe Container tab page, choose-WL Actual_Agent in the Expression f ield.

i) This value must correspond to the value in ZAGENT-TASKL in the Expresslon f ield.

O Copyright . All rights reserved. * rtryL#o

Page 192: SAP Workflow Bit601 en Col10

Unit 5: Containers and Interfaces in Workflows

l .::.::.iii LESSoN suMMARy,,i.,i:,,, you should now be able to:

. Use secondary methods and container operations step type

178O Copyright . All rights reserved.

Page 193: SAP Workflow Bit601 en Col10

1. Workflow containers and task containers are used in every workflow that containsbusiness process steps.

Determine whether this statement is true or false.

True

False

,A You can access data in the task containers at any time during the runtime of the workflow.

, Determine whether this statement is true or false.

ET

True

False

3. You can transfer data directly from the event container to the method container

Determine whether this statement is true or false.

True

False

4. Binding is possible in both directions between workflow and task containers.

Determine whether this statement is true or false.

Q'true

I Fatse

5. The system never generates a proposal for the required bindings at runtime time.

Determine whether this statement is true or false.

True

False

7tg.

rZ

TZ

O Copyright. All rights reserved.

Page 194: SAP Workflow Bit601 en Col10

Unit 5: Learning Assessment

6. The event container is always filled by the system as standard.

Determine whether thls statement is true or false.

True

False

7. The binding from the to the

Choose the correct answer

TT

nTIT

is not generated as standard.

''A'c \ k

A workflow container, rule container

B rule container, task container

C task container, workf low container

D event container, rule container

B. Data can reach the workflow container in which of the following ways?

Choose the correct answers.

I n From the export parameters or resuits of a task

I B From a terminating event

I C From a container operation step

9. The content of the

-

is available throughout the whole runtime of the workflowinstance.

Choose the correct answer.

A task container

I B event container

f, C workflow container

10. You can make customer-specific enhancements to workflow containers and taskcontainers by adding elements.

Determine whether this sfateme nt is true or false.

True

False

,\)1 1\J

tT

180 @ Copyright . All rights reserved.

Page 195: SAP Workflow Bit601 en Col10

Unit 5: Learning Assessment

11. To populate container elements in a workflow step, you can use the Container Operationstep type.

Determine whether thls stateme nt is true or f alse.

True

False

12. Each task container must be explicitly provided with the leading object from the

Choose the correct answer.

TT

I n eventcontainer

n B workflow containertt

I C rule container

@ Copyright. All rights reserved 181

Page 196: SAP Workflow Bit601 en Col10

Learning Assessment - Answers

Workflow containers and task containers are used in every workflow that coniainsbusiness process steps.

Determine whether thls stateme nt is true or false.

True

False

2. You can access data in the task containers at any time during the runtime of the workflow.

Determine whether this stateme nt is true or false.

True

False

3. You can transfer data directly from the event container to the method container.

Determine whether fhls stateme nt is true or false.

True

False

Binding is possible in both directions between workflow and task containers.

Determine whether this statement is true or false.

True

False

5. The system never generates a proposal for the required bindings at runtime time

Determine whether thts statement ts true or false.

True

False

El

nE

TE

ET

TE

182 O Copyright. All rights reserved.

Page 197: SAP Workflow Bit601 en Col10

Unit 5: Learning Assessment - Answers

6. The event container is always filled by the system as standard.

Determine whether this staieme nt is true or f alse.

True

False

7. The binding from the to the is not generated as standard.

Choose the correct answer.

A workflow container, rule container

B rule container, task container

C task container, workf low container

D event container, rule container

Data can reach the workflow container in which of the following ways?

Choose the correct answers.

I n From the export parameters or results of a task

I B From a terminating event

E C From a container operation step

9.Thecontentofthe-isavailablethroughoutthewholeruntimeoftheworkflowinstance.

Choose the correct answer.

I n taskcontainer

B event container

I C workflow container

10. You can make customer-specific enhancements to workflow containers and taskcontainers by adding elements.

Determine whether fhis stateme nt is true or false.

I rrue

l-l Fatsett

Containers in the Workflow Engine contain standard elements. You can add new elementsaccording to the requirements of the process.

ET

ETT!

@ Copyright , All rights reserved 183

Page 198: SAP Workflow Bit601 en Col10

Unit 5: Learning Assessment - Answers

11. To populate container elements in a workflow step, you can use the Container Operationstep type.

Determine whether this statement is true or false.

True

False

12. Each task container must be explicitly provided with the leading object from the

Choose the correct answer.

Er

! n eventcontainer

E B workflow container

! C rule container

184 O Copyright . All rights reserved.

Page 199: SAP Workflow Bit601 en Col10

Lesson 1

Determining the Recipients of Work ltems

Lesson 2

Defining a Rule with Rule Type Responsibilities

Exercise 14: Create a Rule of Type Responsibilities

Lesson 3

Error Handling, the lnteraction Between Possible and Responsible Agents

186

192197

207

UNIT OBJECTIVES

. Determine the recipients of work items

. Define a rule with rule type responsibilities

. Explain the interaction between possible and responsible agents and error handling

@ Copyright. All rights reserved. 185

Page 200: SAP Workflow Bit601 en Col10

Determining the Recipients of Work ltems

LESSON OVERVIEWThis Iesson shows the different ways in which the workflow system can determine therecipients of work items.

Business Example

You want to assign your business process step to agents. You also want to show how you

determine it dynamically by the evaluation of runtime data. From a technical perspective,workflow runtime system performs this evaluation by the definition of rules. For this reason,you require the following knowledge:

. An understanding of the options for agent determination

. An understanding of rule types

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Determine the recipients of work items

Options for Agent Determination

Using the information about agents in the workflow step, and possible agents for the task, theWorkflow Engine determines the agent that is currently valid for the workflow step.

PlgcessWorkflow Definition

Orqanization

Org. unit

ffi / ,ro, | : -l/,/,iiWorklistI /,/l posttionil i

-I / ,/,/ I prio Tasks+ , a-- Work center ; I I npp,oue rorm

ffi-ResponsioititJ: i z Postlnvoice

{ ' /,//.- Work center ; I 1 Approu" rorm March r

.

ffi.ResponsibilitY:--Rulesij3FHlll#::.k}

| - r{-,;" 'f :r-

I \ \ *:;Tl:* t!

your workrist can dispray :w Ul ;Y:*;ffirff' j

-

Ftrr* 5rl,V*kf k^, StepjOpt... f"r AC."t Ar.€"t""t

/

186 O Copyright. All rights reserved

Page 201: SAP Workflow Bit601 en Col10

Lesson: Determining the Recipients of Work ltems

All responsible agents, who are also possible agents for the task become recipients of thework item.

The workflow system only enters this work item once in the work item list.

The user can view newly added work items by refreshing the work list.

You can assign fixed agents.

Some options for assigning fixed agents are as follows:. Members of organizalional units

. Holders of positions and workplaces

. Holders of positions who have inherited tasks through position assignment

. SAP users

They can also refer to expressions (workflow container elements).

For example, you can save the agent for the f irst workflow step in a variable of the workflowcontainer and enter this variable in the fifth step of the workflow as the agent for that step.

Another option is agents who are found dynamically at runtime using a rule. A rule functionmodule determines the agents responsible based on runtime data transferred into the rulecontainer.

Basic Options for Agent Determination

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

Particulate groups or positionsSAP Rules, for example,manager, responsibilities, SAPorganizational objectBBP ManagerAd Hoc Selection

- New step for free choice of thenext recipientSeparate ABAP prograrns withevaluation path or a customer-created function

l:::.,:l:.i Frgure 53: Basrc Options for Agent Determination

:

I Without SAP OrqanizationalStructure

- Fixed user assignment- Rules with responsibilities for

usersWorkflow container elementSAP Office distribution listNew step for free choice of lhenext recipientSeparate ABAP function withcustomers or SAP tablesAs of R/3 Enterpriie:Roles defined in transaction PFCGand entered in the user masterrecord

@ Copyright . All rights reserved.FFFET

187 ,-a,l /g(0

Page 202: SAP Workflow Bit601 en Col10

Unit 6: Agents

Caution:Roles that you create in transaction code PFcG (Role Maintenance) and assign tousers in transaction code swul can only be selected in the workflow step as ofR/3 Enterprise.

ln R/3 Enterprise, because of the runtime data, the workflow object for agentdetermination was renamed in rule. However, in releases before R/3 Enterprise,the object is called a role and, as a result, there was a double occupancy of thename.

The rules based on responsibility can be implemented within minutes. SAP does notrecommend a rule def inition with a fixed user assignment because the agent assignment doesnot change automatically if an employee in the company takes over a new task and is then nolonger available for the task assigned in the workf low.

As of Release 4.0, you can generally define rules using responsibilities instead of using SAP

organizational objects. Rules using responsibiliiies are more flexible and easier to use.

Rule Types

The following are possible rule types:. Responsibilities (pure configuration, no ABAP code)

- Defined value ranges are assigned to agents.

- Data is filled from the workflow container at runtime.

. Organizational data (pure configuration, no ABAP code)

- SAP Organizational Object Types are used to assign agents.

. Function to be executed

- ABAP code

You can develop each function module required yourself.

. Organizational attributes

You can use organizational attributes in the SAP applications EBP and CRM.

There are four types of rules that you can use in the Activity step type, You cannot use a ruleusing Organizational attributes in SAP ERP. Three of the four rules that you use only requiresystem settings; for the fourth rule, define a customer-specif ic function module in the system.

You can use organizational data as follows:. Rules using organizational data require an SAP organizational object type in the system.

. Table T7797 contains SAP organizational object types, and the relationship between theseobject types and other organizational objects types that can be linked to these objecttypes in T779I

. lf you are using these objects inside your workflow, then it should have one element as SAP

organizational object type.

. The SAP organizational object type is linked to agents through organizational units,positions, or jobs.

The characteristics of rules with responsibilities are as follows:

188 O Copyright. All rights reserved.

Page 203: SAP Workflow Bit601 en Col10

Lesson: Determining the Recipients of Work ltems

. As of Release 4.0, users can define rules using responsibilities.

. ln the rule container, the user defines variables that are filled with values at runtime.

. You also define value ranges for these variables and assign agents to the different valueranges.

Developing customer-specif ic f unction modules for rule resolution is the topic of the courseBrT610.

Rule Example - Find Superior of User

You can use the Superior of a user rule to forward a notification of absence to the superiorresponsible.

ln this case, Marcus Adams wants to go on vacation and only David Boss should receive thiswork item. No other possible agents should receive this notification of absence.

Restriction of possible agents according toorganizational model

@I Group of all managers

I

r Standard task (definition):Approve notification of absence

r Linked with job: Head of Department

o Rule (agent):Superior...

r Rule parameters: Employees

r Work item (activity at runtime):Approve notification of absence 4712

) Employee: Marcus AdamsEvaluation of organizational plan

)Superior: David Boss

F gure 54: Examples of Ru es - Rule (F nd the Superior of a User)

Responsible agent

@ Copyright , All rights reserved. 189

Page 204: SAP Workflow Bit601 en Col10

Unit 6: Agents

. Rule:Restriction of possibleagents according to Customizing

r Possible Agents of Task:Post document

+ Linked with job:- lnvoice verification clerk

r Rule: "find AP clerk") 2 parameters:

- Customer name- lnvoice amount

CustomernamesH*N

r Work item (activity at runtime):, "Post document 4712

* Customer-t{ZOorp.,+ lnvoiced amount - $ 258,300

$ tnvoiceO amount: < $ 50,000

$ tnvoicec amount: >= $ 50,000

,.l;l$ Figure 55: Exampies of Rules- Rule (lnvorce Ver fication Clerk)

Customer namesA_G

Rule Example - lnvoice Verification Clerk

The figure examples of rules - rule (invoice verification clerk) is an example of how you coulduse a rule resolution in an invoice verification clerk workf low.

Design requirements for the invoice verification clerk rule are as follows:. All clerks working in this unit are assigned to a special customer group. At runtime, they

should receive invoices only from customers in that group.

. Each clerk has a predefined personal transaction limit, lf the invoice is above this limit, theclerk is not allowed to process the invoice.

The steps for the invoice verification clerk rule at runtime are as follows:. The two import parameters for rule resolution (Manley Corp and $258,300) determine

that you should send the work item to the three agents that are circled in the f igure.

. Only those three agents will receive this work item in their worklist.

. The first agent to execute the work item at runtime blocks access to the work item so thatno other agent can access it, The work item actually disappears from the worklist of theother two agents when they refresh their worklist.

. After the first agent completes the work item, the work item disappears automatically fromthe other two users worklist after the next refresh.

190 @ Copyright . All rights reserved

Page 205: SAP Workflow Bit601 en Col10

Lesson: Determining the Recipients of Work ltems

Business Workplace

r Shared folders - right mouse button

t Create new subfolderName: <Choose any name>' e.g. WF-Distributor

r Button: Distribution Lists

e "Create"buttonlName: <Ghoose anY name>' e.g.Title: <any title>Session: WF-Distributor

r Distribution List Content tab- Enter reciPient (SAP user lD)

o Save

WF DLIST

F:gure 56: Creating a D strrbttion L st

Working with Distribution Lists

you can determine agents for workflow steps using distribution lists. This graphic lists the

steps required to create a distribution list.

Rule Resolution with Distribution List

SWX_READ_DLl is the standard rule used to trigger distribution lists. Transfer the name of the

distribution list as a constant in the binding.

LESSON SUMMARYYou should now be able to:

. Determine the recipients of work items

Workflow Builder

r Process dialog steP

r Agent Assignment:- Rule 30000012 (swx-read-dli)

r Binding: <Name of distribution list>, e'9. WF-DLISTThe name of the distribution list is entered as a consiant

a

I

r Activate workflow

Start workflow

Check work item reciPient

Figure 57: Rule Resolution with Distribution List

@ Copyright . All rights reserved *m"

Page 206: SAP Workflow Bit601 en Col10

Defining a Rule with Rule Type Responsibilities

LESSON OVERVIEWThis lesson shows you how to use rule type responsibilities and how to maintain rules.

Business Example

You want your business process step Display Material Master to be sent to different users,depending on the material group. You can define this using the rule type Rule withresponsibilities. For this reason, you require the following knowledge:

. How to define the rule with responsibilities

. How to use this rule in a workflow

. How to ensure that a workflow step never has the No agent found status

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Define a rule with rule type responsrbilities

Rule Definition with Responsibilities

Rule definition with responsibilities - Background. When is this rule type required?

- The application requires that responsibilities be assigned to business objects, forexample, the one who is responsible for the material group xy.

. What is the characteristic feature of this type of rule?

- The rule does not have to be programmed and is only based on configuration, withoutany ABAP code,

. How are these rules defined?

- You can define the rule parameters (containers) and responsibilities (positions,organizational units, and users) for values or value ranges of the parameters.

t92 @ Copyright . All rights reserved

Page 207: SAP Workflow Bit601 en Col10

Lesson: Defining a Rule with Rule Type Responsibilities

Mr. Smith

Position:Administrationagent 2 in HR dept.

Ms. Jones

Position:Administrationagent't in HR dept.

Responsiblefor

,; Figure 58: Rule Def in tion with Responsibilitres - Example

The two administrators who are responsible for employee queries in a midsize businessare as follows:. Mr. Smith for employees from A to K

. Ms. Jones for employees from L to Z

These rules should help the application solve problems, such as finding the personresponsible for a material without using separate tables and rule function modules.

An assignment table is evaluated for rule resolution where various instances of the ruleparameters are assigned to objects of organizalional management (jobs, positions, users, andor ganizationa I u n its).

To create a rule definition with the responsibilities type of rule, perform the followingsteps:1. Maintain the elements in the rule container.

2. Maintain the responsibility for each possible value or value interval of the rule parametersin the assignment table.

3. Assign responsible agents to the values or value intervals.

The advantages of a rule definition with responsibilities are as follows:. lf an organizational object is deleted, the rules for that type are also updated.

. Where-used lists for organizational objects can also find these rules.

. No ABAP programming is required.

@ Copyright. All rights reserved 193

Page 208: SAP Workflow Bit601 en Col10

Unit 6: Agents

Rule Definition with Responsibilities - lntroduction

The rule definition is available on the SAP Easy Access screen, under fools -- Business

Workflow --+ Developmefit --+ Definition too/s -+ RulesforAgentAssignm€flf -+ Create/

Change/Display.

To create a rule with responsibilities, perform the following steps:

1.. Define the rule container.

ln this case, we are referring to the attribute name of an employee'

2. Define two responsibilities (= value ranges)'

ln this case, Employees f rom A io K and Employees from L Io Z are the ranges.

3, Define the value ranges for each responsibility (A" to K" and L" to Z")'

4. Finally, assign the responsible agents; use the Insert agent assignment button'

5, Enter the rule in the req uired workflow step and fill the elements of the rule container

from the workflow container in the binding'

At runtime, the rule you just defined is called, and it receives a value for an element' lf the

current value is between A and K, Smith receives the work item. lf the current value is

between LandZ, Jones receives the work item.

you can also define more than one rule with responsibilities in the rule container and create

any combinations for value ranges with agents'

Rule container definition (basis for comparison)

C6ntainer eleinent Data type Name

Element Prel-uname ID

Area of responsibility first letter Last name

Employees from Ato K

Employees from L to Z

Mr. Smith

Ms. Jones

Which value Who?

i Figrte 59: Rule Def nition with Respons bil ties - lntroduction

194 @ Copyright . All rights reserved

Page 209: SAP Workflow Bit601 en Col10

Lesson: Defining a Rule with Rule Type Responsibilities

Secondary Priorities

lf you have defined many different value ranges with different agents in a project, a value thatis not contained in a value range may be transferred at runtime.

lf lhe Terminate if rute resolution has no resu/t checkbox is set in the rule definition, there is an

error in the workflow.

As of Release 4.6, you can use secondary priorities to solve this problem.

The following are the steps to create a secondary priority for a rule with responsibility:. ln addition to existing responsibilities, create a new responsibility that includes all values

that are possible at runtime, and assign agents to it.

. Enter a priority for all responsibilities in the def inition of the responsibilities. The lowest

priority is 01and the highest 99.

The priority of the responsibility that includes all values must be lower than the priorities of

responsibilities that refer to specific values.

lf the system finds a value at runtime that does not have a high-priority responsibility, the

system uses a responsibility with a lower priority.

The indicator on the basic screen for rule definition takes secondary priorities into account.

At runtime, the system finds a responsibility with a higher value for the material group 003,

but no agents are assigned to it. ln this case, the system only evaluates the responsibility with

the low priority if the Secondary priorities indicator on the basic screen is selected.

DEFINITION TIME secondary priorities)

Rule Container: Material type P-100 (FERT) ) Position 5000644

Value rangel: FERTAgent: Position 5000644

P-102 {ROH) } Position 500064s

P-200 (ERSA) ) Position 5000647

P-400 (HIBE) ) No value found) Rule does not determine

any Agent) lf necessary

the workflow terminates

Value range: ERSAAgent: Position 5000645

Value range: ROHAgent: Position 5000646

Defining an additionalcomprehensive value range:

secondary priorities)

Value range: *

Agent: Position 5000000

P-400 {HIBE) ) Position 5000000from the comprehensivevalue range that catchesmissing values

i;{ f gure 60: Rule Definition with Responsibilit es - Uslng Secondary Pr orit es

@ Copyright. All rights reserved. 195

Page 210: SAP Workflow Bit601 en Col10

Unit 6; Agents

Rules in a Workflow Step

MaCier dataOlganization?l plan

.Customizing Data

Result of ruleresolution

I 'ut o^ ard Bindins i| 't Figt'. 61: Rule Resolut o^ ard Binding

;*o"' "r"*.,.r*

The rules are available on the SAP Easy Access screen, under fools --+ Buslness Workflow --Development ---+ Definition too/s -, Standard Ru/es.

You can use the input help (F4) to display all standard rules.

A rule is identified by a unique name, A rule container is defined for each rule. The ruleparameters determine which information is required for the rule resolution to be executed atruntime.

lf an error occurs during rule resolution, setting lhe Terminate if rule resolution has no resultindicator for the rule resolution determines how the workflow will continue. lf the indicator is

selected, the workflow assumes an Error status and a notification is sent to the workflowadministrator. lf the indicator is not selected, then the workf low routes this work item to allpossible agents.

196 @ Copyright. All rights reserved.

Page 211: SAP Workflow Bit601 en Col10

Create a Rule of Type Responsibilities

Business Example

This procedure enables you to generate a rule resolution based on your own requirementswithout having to use ABAP programming. By assigning responsibilities to specific fieldvalues, you can use a rule to assign the responsibilities to objects from your organizationalchart.

ln this scenario, we assume that the members of your organizational unit are agentsresponsible for the material group 001. lf a material is changed, a rule should find theseagents so that they can be informed about the change in a work item.

Task 1

1. Create a standard rule for responsibilities. Create your rule in the package zoo1. Create astandard rule z*#_uatgroup and define the Rule type responsibilities. Enter the name

I'taterialgroup *#. The rule should terminate if an agent cannot be found.

Task 2

L. Define the rule container. ln the container, generate an element Materia]-group, Entermateriar group for the element, its name, and a short description. Define the elementwith reference to the ABAP structure IIARA and the uarxr, field.

Task 3

1, Define a value range. Define a responsibility (= v31r. range) under the Object abbreviationMatkl_001, Enter the namer'aterial grou1> Oo1. The from-to value range shouldinclude OO1.

Task 4

1, Define the agents responsible for your value range. Define the organizational unitzwf _ors_** as the agent for the responsibility.

Task 5

L. For test purposes, simulate the rule.

Task 6

Use the rule in lhe Display material master, group ## workflow step.

1. Call lhe Workflow Builder with your workf low template for the zwf_testl-## materialmaster.

O Copyright. All rights reserved

Page 212: SAP Workflow Bit601 en Col10

Unit 6: Agents

2. Choose Display material master, group ## and change the agent responsible to Rule.

3. Enter your rule number, for example, 9910013.

4. ln the binding, transfer the material group of your object to the rule. This must be thematerial group of your object type Y##MARA.

5. Create suitable test conditions.

To test the rule, remove the indicator Advance with dialog for the workflow step. When you

do this, the work item does not start immediately if the tester is one of the recipients of thework item, and in the log, you can see which agent has the work item in your workplace.

6. Activate your workflow.

7. Test your workf low.

Start your workflow in the test environment. ln the first step, the change documents are

displayed to the workflow initiator. The second step does not start immediately. ln theworkflow log, check which agent has the work item.

Test the successful case (material group 001) as well as the error scenario (materialgroup is not 001). To create a termination situation, change lhe Materialgroup in basicdata lfor your material to a value that is not OO1(transaction code pruO2).

Your workflow must adopt an error status. After you have completed the test successfully,reset the value of the material group to 01.

Task 7

Secondary Priorities

You have defined n different value ranges in a rule with responsibilities.

You want to create a value range whose agent is to be the recipient of the work item if thecurrent runtime values are not defined in a responsibility.

L. ln your rule with responsibilities, define a value range that includes all material groups.Enter the object abbreviation matk r etse and the name remaining quantity. Def ine thefrom x to * value range.

Task 8

1.. Define Ihe BIT6OIMAT-## user (your material checker) as the responsible agent.

Task 9

1. Determine the correct priorities. Determine priority or for the responsibility that includes

all material groups. Define responsibility 02 f or the responsibility you have alreadyentered, which has your organizational unit as the responsible agent.

Task l0

L. Simulate the rule.

Task 11

1. Test your workflow again.

198 @ Copyright. All rights reserved.

Page 213: SAP Workflow Bit601 en Col10

Create a Rule of Type Responsibilities

Business Example

This procedure enables you to generate a rule resolution based on your own requirementswithout having to use ABAP programming. By assigning responsibilities to specific fieldvalues, you can use a rule to assign the responsibilities to objects from your organizationalchart.

ln this scenario, we assume that the members of your organizational unit are agentsresponsible for the material group OO1. lf a material is changed, a rule should find theseagents so that they can be informed about the change in a work item.

Task I1.. Create a standard rule for responsibilities. Create your rule in the package zoo1. Create a

standard rule z##_t'tatgroup and define the Rule type responsibilities. Enter the namel"taterialgroup **. The rule should terminate if an agent cannot be found.

a) On the SAP Easy Access screen, choose lools ---+ Buslness Workf low ---+ Development---+ Definition fools --+ RulesforAgentAssignment - Create.

b) On the Maintain Ru/e screen, choose the Create pushbutton.

c) On the Rule: Create screen, enter the following data on the Ru/e def inition tab page:

Field Name Entry

Abbr. z*#_raatgroup

Name Materialgroup##

Category Agent Determination:ResponsibiJ-ities

Select the Terminate lf Rule Resolution Without Resu/t checkbox.

Choose Save.

ln the Create Object Directory Entry dialog box, enter zool in lhe Package field.

Choose Save.

Task 2

1. Def ine the rule container. ln the container, generate an element Materialgroup. Entermaterial group for the element, its name, and a short description. Define the elementwith reference to the ABAP structure MARA and the uarxr, field.

d)

e)

D

g)

@ Copyright . All rights reserved

Page 214: SAP Workflow Bit601 en Col10

Unit 6: Agents

Field Name Entry

Element Materialgroup

Name }laterialgroup

Short Description Malerialgroup

a) On the Rule: Change screen, on the Container tab page, choose the Create Elementpushbutton.

b) ln the Create Container Element dialog box, enter the following data:

c) On the D. Type tab page, select Ihe ABAP Dict. Reference radio button and enter thefollowing data:

Choose Continue.

On the Rule: Change screen, choose Save.

Task 3

1. Define a value range. Def ine a responsibility (- value range) under the Object abbreviationMatkr 001. Enter the name Material group 001. The from-to value range shouldinclude 001.

a) On the Ru/e: Change screen, choose the Responsibilities tab page.

b) On the Responsibilities tab page, choose the Create responsibility pushbutton.

c) ln the Create responsibility dialog box, enter the following data:

Field Name Entry

Object abbr. llatk1 001

Name Materia.I-group00l

Choose Continue.

On the Responsibi/ity Change for Rule Matkl_O)l screen, enter the following in theResponsi bil ify Specs pane.

Choose Save.

Go back to the Ru/e: Change screen,

d)

e)

d)

e)

0

s)

Field Name Entry

Structure MAR,A

Field },TATKL

Field Name Entry

of 001

to 001

200

Task 4

@ Copyright . All rights reserved

Page 215: SAP Workflow Bit601 en Col10

Lesson: Defining a Rule with Rule Type Responsibilities

L. Define the agents responsible for your value range. Define the organizational unitzwf_ors_## as the agent for the responsibility.

a) On the Rule: Change screen, choose the Responsibilities tab page.

b) On the Responsibilities tab page, choose Materialgroup))lin the Name field.

c) Choose the /nsert agent assignment pushbutton.

d) Double-click Matkl_001 in the Code f ield.

e) ln the Choose Organizational unit dialog box, enter zwf _org *# in the Search Term

f ield.

f) Choose Continue.

g) ln the Create Relationship dialog box, choose Organizational unit group ## in the Namef ield.

Choose the Create pushbutton.

Choose Save.

Task 5

1. For test purposes, simulate the rule.

a) On the Ru/e; Change screen, choose the Slmu/ate rule resolution pushbutton.

b) ln the Simulation of Rule Resolution: Standard Rule XXXXXXXXX Z##Matgroup dialogbox, enter 001 in lhe Container element value field.

c) Press ENTER.

'&,,. , Note:

rrl- As a result of the rule resolution, your organizational unit is to be displayed.lf you enter a value that is not equal to 001, the message No agent found,terminated is to be displayed.

Task 6

Use the rule in the Display material master, group ## workflow step.

1. Call lhe Workflow Builder with your workf low template for the zwf_testl-## materialmaster.

a) OntheS,4PEasyAccessscreen,chooseTools ---, BuslnessWorkflow - Development---+ Definition too/s --+ Workflow Builder ---+ Workflow Builder ( swoo).

b) On lhe Workflow Builder - Change'ZWF_TESTI_##'screen, choose to the changemode.

2. Choose Display material master, group ## and change the agent responsible to Rule.

a) On lheWorkflow Builder - Change'ZWF_TESTI_##'screen, choose Display materialmaster, group ## in the Navigation area pane.

b) ln the Agents pane, choose Ruie from the dropdown menu.

h)

i)

@ Copyright. All rights reserved

Page 216: SAP Workflow Bit601 en Col10

Unit 6: Agents

3. Enter your rule number, for example, 9910013.

a) Enter the rule number in the Ru/e field.

4. ln the binding, transfer the material group of your object to the rule. This must be the

material group of your object typeY##MARA.

a) ln the Agents pane, choose the Blndlng (Exlsts) pushbutton'

b) ln the Change Binding For Rule dialog box, choose MaterialGroup in the Workflow field.

c) Drag MaterialGroup from lhe Workflow field and drop it in Ru/e 'Materialgroup29' field.

d) Choose the Exli Binding Editor pushbutton, to transfer the data.

5. Create suitable test conditions.

To test the rule, remove the indicato r Advance with dialog for the workf low step. When you

do this, the work item does not start immediately if the tester is one of the recipients of the

work item, and in the log, you can see which agent has the work item in your workplace.

a) On lheWorkflow Builder - Change'ZWF-TESTI-##'screen, choose the Defails tab

page.

b) On the Defalls tab page, deselect the Advance with dialog checkbox inlhe Work ltem

Response pane.

6. Activate your workflow.

a) Choose lhe Transfer and to Graphic pushbutton.

b) On lhe Workflow Buitder - Change'ZWF-TEST1-##' screen, choose the Generate and

activ ate r u nti me v e r sion pushbutton.

7. Test your workflow.

Start your workflow in the test environment. ln the f irst step, the change documents are

displayed to the workflow initiator. The second step does not start immediately. ln the

workflow log, check which agent has the work item.

Test the successful case (material group 001) as well as the error scenario (material

group is not 001). To create a termination situation, change Ihe Material group in basic

data 1f or your material to a value that is not 001 (transaction code uuOZ).

your workflow must adopt an error status. After you have completed the test successfully,

reset the value of the material group to 01.

a) On lhe Workf low Builder - Change 'ZWF-TESTL-##' screen, choose the festpushbutton.

b) On the fest Workflow screen, choose the Load pushbutton.

c) Choose Execute.

d) Terminate the step and call the Workftow Log pushbutton from the test transaction.

e) ln the Agents section, display who has received the work item for displaying the

material master. The agents should be members of your organizational unit.

f) Go back to the SAP Easy Access screen.

g) On the SAP EasyAccess screen, run the transaction code vuo2'

h) On the Change Material (lnitial Screen), enter 11oe inlhe Material field.

202 @ Copyright. All rights reserved

Page 217: SAP Workflow Bit601 en Col10

Lesson: Defining a Rule with Rule Type Responsibilities

Note:Change the material group to a value that is not 001.Terminate if no agent found flag is selected.

Ensure that the

i) Choose the Se/ect view(s) pushbutton.

j) Choose the Basic Data I pushbutton,

k) Choose Save.

l) Run the transaction code swoo.

m) On the Workflow Builder - Change'ZWF_TESTI-##'screen, choose the festpushbutton.

n) On the lest Workflow screen, enter T-Boo** in the Key field.

o) Press ENTER.

p) On IheWorkflow Log screen, choose Goto -' List with technical details.

q) On lhe Workf low log (View with technical details) screen, the workf low must assume an

Error status as soon as it reaches the step with the rule resolution.

*f:*" Caution:After you have completed the test, reset the value of the material group inthe material master to 001.

Task 7

Secondary Priorities

You have defined n different value ranges in a rule with responsibilities.

You want to create a value range whose agent is to be the recipient of the work item if thecurrent runtime values are not def ined in a responsibility.

L ln your rule with responsibilities, define a value range that includes all material groups.

Enter the object abbreviation natk:._else and the name remaining quantity. Define thefrom x to * value range.

a) On the SAP Easy Access screen, choose fools -- Buslness Workflow --+ Development

--+ Definition fools --- Rulesfor AgentAsstgnment -'> Change.

b) On the Maintain Ru/e screen, change Ihe Change pushbutton.

c) Enter your rule number in the Rule field.

d) On the Rule; Change screen, choose Responslbl/ltles tab page.

e) Choose the Create Responsibility pushbutton.

f) On the Create responsibility dialog box, enter the following data:

@ Copyright . All rights reserved.

Page 218: SAP Workflow Bit601 en Col10

Unit 6: Agents

Choose Continue

On the Responslbi/lty Change for Rute Matkl-etse screen, enter the following data in the

Responslbl/lty Specs f ield :

i) Choose Responsibl/ity --+ Save.

Task 8

L. Define Ihe BIT^O\MAT-## user (your material checker) as the responsible agent'

a) Select lhe Matkl_else responsibility in the basic screen for responsibilities.

b) Choose the /nsert agent assignment pushbutton'

c) ln the Se/ectlon dialog box, choose lJser inthe obiect type field.

d) Search for the user B\T60IMAT-##.

e) Select the user.

f) ln the create Relationship dialog box, choose the create pushbutton.

g) Choose Save.

Caution:The user B.T6OLMAT-## must be the possible agent of the underlying

standard task so that they receive the work item.

Task 9

1. Determine the correct priorities. Determine priority 0r for the responsibility that includes

all materialgroups, Define responsibility 02for the responsibility you have already

entered, which has your organizational unit as the responsible agent.

a) on the Ru/e; Change screen, choose the Responsibilities tab page.

b) Select lhe Matkl-else responsibility.

c) Choose Rule -, Display<->Change'

d) On the Respons ibitity Change for Rule Matkl-etse screen, enter o1 in the Pdorlty f ield.

e) Choose Responslbi/lty ---+ Save'

g)

h)

Field Name :, Entry :' 1,,,,, ''',Object abbr t"Iatkl else

Name Remaining guantitY

Field Name Entry

of *

to *

204 @ Copyright. All rights reserved

Page 219: SAP Workflow Bit601 en Col10

Lesson: Defining a Rule with Rule Type Responsibilities

f) Go back to the Ru/e: Change screen.

g) Repeat the procedure for your responsibility for the material group 001. Enter thevalue 02 in the Priorify field.

Task lO

1. Simulate the rule.

a) Choose the Slmu/ate Rule Reso/utlon pushbutton.

b) Carry out a test using the values 001 and OO3.

Task 11

1. Test your workflow again.

a) Run the transaction code swus.

b) On the fest Workflow screen, choose Y##MARA in the Expression field.

c) Enter r-BBD## in the Key field.

d) Press ENTER.

l--l int'

r , ,:, r ',':, Note which value is contained in the material group in your T-BBD##material master.

O Copyright . All rights reserved. ',rffi

Page 220: SAP Workflow Bit601 en Col10

Unit 6: Agents

..:I.:III LESSONSUMMARY. ' ''"" You should now be able to:

. Define a rule with rule type responsibilities

206 @ Copyright. All rights reserved

Page 221: SAP Workflow Bit601 en Col10

Error Handling, the lnteraction BetweenPossible and Responsible Agents

LESSON OVERVIEW

Standard tasks have possible agents assigned to them. ln the workflow step that uses the

task, you can define responsible agents. Agents who are in both groups receive the work item.

Business Example

While testing your workflow, a problem arises. None of the expected agents have received a

work item. You want to understand the interaction between the possible and responsible

agents. For this reason, you require the following knowledge:

. An understanding of the selection procedure for work item recipients

. An understanding of the interaction between possible and responsible agents

. An understanding of error handling

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Explain the interaction between possible and responsible agents and error handling

Selection Procedure for Work ltem Recipients

Only the recipients that are still on the list after the fourth step can execute the work item'

IFirst: I

1

Find possible agents I

(For a general task, everyuser is a possible agent)

I

Second:

Evaluating the entries (orstatements) in theworkflow step(responsible agents)

Third: Fourth:

Delete all excluded agentsfrom the recipient list

lf no entries are available inihe workflow slep:Evaluating the task -Standard rule t

il f igure 62: Selection Procedure for Work ltem Rec p ents

@ Copyright, All rights reserved.

Page 222: SAP Workflow Bit601 en Col10

Unit 6: Agents

One of the most common error situation arises when no possible agents are assigned to thedialog task. ln this case, there can never be a recipient. You must assign possible agents to all

dialog tasks as well as to the delivered standard tasks used in SAP workf low templates.

lf the workflow designer does not provide responsible agents for the tasks in the workflowstep, the system checks to see whether a default rule has been stored for the task in theworkflow step.

To display the default rule, go to the Default rules tab page in the task definition.

On the SAP Easy Access screen, choose Tools --+ SAPBusiness Workflow ---+ Definitionfools -' Deve I o p m e nt --+ T asks/T ask groups.

As of R,z3 Enterprise (Basis 6.20), you can subsequently execute rule resolution with an

updated rule definition for an existing work item again. To do this, on the S,4P EasyAccessscreen, choose Iools -- Buslness Workflow ---+ Development ---+ Administration --+ WorkflowRuntime ---+ Execute Rules for Work ltems (transaction code swrI_RUIE).

lnteraction Between Possible and Responsible Agents

The objective of agent determination in the workflow is to create an intersection betweenpossible agents for a task and responsible agents that are defined in the workflow step.

The final list of recipients is determined by matching the entries in the possible agents definedby the workflow designer or developer at the task level with the entries in the list determinedat the workf low step level during runtime using ihe rule.

Down

I Possible agents of the taskAdditional data - agentAssignment - maintain

MacDonald

Recipient of the work item

lntersection from possible and

Chesterton

-responsible agents

Agent responsibl€ based on a rule in the workflow step

Figure 63: lntersection as an 0bjective

208 @ Copyright . All rights reserved,

Page 223: SAP Workflow Bit601 en Col10

Lesson: Error Handling, the lnteraction Between Possible and Responsible Agents

Error Handling - Agent Not Determined

lf a rule does not return any agents, the system checks Ihe Terminate if rule resolution has noresu/t checkbox.

lf the checkbox is selected for the rule, the entire workf low assumes the Error status.

lf the checkbox is not selected for the rule, all possible agents for the task receive the workitem.

Error Handling When Not Using a Rule - No Overlap Between Possible andResponsible Agents

lf the possible and responsible agents for a process step do not overlap, the WorkflowEngine proceeds as follows:. Release SAP R/3 Enterprise or higher.

The system creates the work item for the step, however the work item is not visible in anyof the workplaces.

. Release lower than SAP R/3 Enterprise.

The work items are delivered to agents that are defined as possible agents in the task ofthe process step.

ln SAP R/3 Enterprise and SAP ERP, to find work items that have the status No agent found,an administrator must regularly execute the transaction code stJr2_ADM1.

Use the f unction Administrator Forward (Shift + F12) to send the work items that are found tothe correct agent and correct the incorrect agent determination.

Transaction code swt2_aDM1 is located on the SAP Easy Access screen, chooseIools -- Buslness Workflow - Development ---+ Administration ---+ Workflow Runtime.

ln SAP ERP, transaction code swr2 ADM2 exists. lt lists the work items that have deletedUSCTS.

Sting

Farr

Starr

-tPossible agents of the taskAdditional data - maintain agentassignment

f MacDonald Ling

tltlRule resolution: Iil';ffiffiil I I

Recipient of the work item:

Indicator "Terminate if rule resolution has no result"is set:Workflow INCORRECT

lndicator "Terminate if rule resolution has no result"is not set:All possible agents receive the work item.

F gure 64: Rule in Workf low Siep Does Not

an Agent

@ Copyright. All rights reserved ,*m

Page 224: SAP Workflow Bit601 en Col10

Unit 6: Agents

,r,, ,r LESSON SUMMARY

" -l ' You should now be able to:

. Explain the interaction between possible and responsible agents and error handling

210O Copyright. All rights reserved

Page 225: SAP Workflow Bit601 en Col10

Learning Assessment

1. Who or what determines the actual agent for a workflow step.

Choose the correct answer.

f, n Workflow Engine

I B Fixed agents

I c SAP users

2. You can use SAP Office distrubution lists for agent determination in workflow steps.

Determine whether this statement is true or false.

True

False

Data is transferred to rules at runtime, which can be used to f ind assigned agents for theworkflow step.

Determine whether this statement is true or false.

True

False

4. For rules of type rule with responsibilities, you must create a _and --, andassign agents to them.

Choose the correct answer.

I n task container, responsibilities

I B rule container, event container

! C rule container, responsibilities

rT

TT

O Copyright . All rights reserved zTL

Page 226: SAP Workflow Bit601 en Col10

Unit 6: Learning Assessment

b. you can use secondary priorities to ensure that work items are always assigned to agents.

Determine whether thls stateme nt is true or false'

True

False

6. Which of the following are advantages of the rule type Rule with Responsibilities?

Choose the correct answers.

! n ft an organizational object is deleted, the rules for that type are also updated

I B Responsible agents are assigned to the values or value intervals

! C No ABAP programming is required'

7. Arrange the selection procedure for work item recipients in the correct sequence. 1 =

Evaluate the entries in the workflow step; 2 = Delete all excluded agents from the recipient

list; 3= lf no entries are available in the workflow step, evaluate the task - standard rulei 4

= Find possible agents

Choose the correct answer.

A (1) (2) (3) (4)

B (4) (1) (3) (2)

c (3) (2) (1) (4)

D (2) (3) (4) (1)

B. The Workflow Engine always tries to find an intersection between possible and responsible

agents.

Determine whether this statement is true or false'

True

False

9. For rules, you can use the Terminate if rule resolution has no result indicator to define that

the workflow assumes error status if the rule does not determine any users'

Determine whether thls sfateme nt is true or false'

True

False

!!

IT!l

nT

TT

272@ Copyright. All rights reserved.

Page 227: SAP Workflow Bit601 en Col10

Learning Assessment - Answers

1. Who or what determines the actual agent for a workflow step.

Choose the correct answer.

I n Workflow Engine

I B Fixed agents

I c SAPusers

2. You can use SAP Office distrubution lists for agent determination in workflow steps.

Determine whether thls stateme nt is true or f alse.

True

False

tribution lists must be created and maintained in the Business Workplace. They cann be retrieved at runtime in the workflow step using a standard rule.

3. Data is transferred to rules at runtime, which can be used to find assigned agents for theworkflow step.

Determine whether this statement is true or false.

ET

ElDis

the

True

False

Data is evaluated by rules whose values have been assigned agents in the rule definitionitself , that are stored in organizational management, or that are maintained in specif iccustomizing tables.

For rules of type rule with responsibilities, you must create a _and _, andassign agents to them.

Choose the correct answer.

! n task container, responsibilities

I B rule container, event container

[| C rule container, responsibilities

O Copyright. All rights reserved 2r3

Page 228: SAP Workflow Bit601 en Col10

Unit 6: Learning Assessment - Answers

5. You can use secondary priorities to ensure that work items are always assigned to agents

Determine whether thls stafement is true or false.

True

False

6. Which of the following are advantages of the rule type Rule with Responsibilities?

Choose the correct answers.

I n ft an organizational object is deleted, the rules for that type are also updated

I B Responsible agents are assigned to the values or value intervals

I C No ABAP programming is required.

7. Arrange the selection procedure for work item recipients in the correct sequence. 1 =Evaluate the entries in the workflow step; 2 = Delete all excluded agents from the recipientlist; 3= lf no entries are available in the workf low step, evaluate the task - standard rule; 4

= Find possible agents

Choose the correct answer.

A (1) (2) (3) (4)

B (4) (1) (3) (2)

c (3) (2) (1) (4)

D (2) (3) (4) (1)

B. The Workflow Engine always tries to find an intersection between possible and responsibleagents.

Determine whether fhis stateme nt is true or false.

True

Falco

9. For rules, you can use the Terminate if rule resolution has no result indicator to define thatthe workflow assumes error status if the rule does not determine any users.

Determine whether this statement is true or false.

True

False

ET

TETI

E!

ET

214 @ Copyright . All rights reserved

Page 229: SAP Workflow Bit601 en Col10

Lesson L

Defining Agents and Tasks Dynamically

Exerciset5:UsetheWizard-Se|ect.Agents...'.

Lesson 2

Enhancing Workflows Using the Step Type Ad Hoa Anchor i::

' Exercise 16: Enhance workflows Using the step Type Ad Hoc Anchor

2t6221

228231

UNIT OBJECTIVES

. Define agents and tasks dynamically

. Enhance workflows using step type ad hoc anchor

@ Copyright , All rights reserved.2t5

Page 230: SAP Workflow Bit601 en Col10

Defining Agents and Tasks Dynamically

LESSON OVERVIEWWithin a workflow scenario, it may not be possible to define the responsible agents at the timeof definition. This lesson describes how these agents can be determined dynamically atruntime.

Business Example

ln your business process, you do not want agents for a step to be determined until runtime.This lesson explains ways in which you can do this. For this reason, you require the followingknowledge:

. How to determine agents dynamically at runtime

. How to define tasks for a business process step dynamically at runtime

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Define agents and tasks dynamically

Wizard - Select Agents

Generating workflows with ad hoc processing using wizards:. Dynamichierarchicalapprovalworkflow

. Dynamicparallel approvalworkflow

. Dynamic circular

. Dynamic parallel circular

216 @ Copyright . All rights reserved

Page 231: SAP Workflow Bit601 en Col10

Lesson: Defining Agents and Tasks Dynamically

Workflow Definition

listpos$ible

agent ofT$500000xy

the

Responsible agentsExpression:

Agent_list

object list.

ln your workflow, there is a step in which you cannot determine responsible agents at thedesign stage. However, at runtime, there are users who know which user should execute therelevant step.

You can use task T530200146 to enable manual selection of the responsible agent for asubsequent step. This task generates an on-screen list of possible agents for the subsequenttask.

At runtime, the user who executes the work item for task T530200146 can select the requiredagents from the list of possible agents from the TS5O0OOOxy task. All responsible agents thatthe user selects manually are transferred to the agent list for the next step. The work item ofthe next step is now available for all the agents on that list.

Up to Release 4.5, the task whose responsible agents is to be determined manually(TS5O0000xy, in the current example) must not be defined as a general task.

Using the Select agent wizard, you can enter the dispatcher task TS30200146 into yourworkflow definition, as well as the subsequent task.

ln releases before Release 4.5, this wizard did not exist, and you should use task TS3020014i.With this task, you can only select one agent.

ts theagent

the

Taskcontainer: :r '

lmporl, .,

Figure 65: lntegrate the Select Agents W tzard - Defin jng Agents f or a Step at Runtirne

Note:lf you want to execute the function for a step that already exists, no responsibleagents are to be defined for the step. This means that there must be no entry intheAgents section on the Control tab page.

When there is no entry in the Agents section on the Controltab page, choose theprocess step in the definition in the Workflow Builder, for which you want todetermine the agent dynamically and start the wizard. The wizard then does notask which task you require but immediately asks for the title of the selection dialogbox.

@ Copyright. All rights reserved. 2t7

Page 232: SAP Workflow Bit601 en Col10

Unit 7: Ad Hoc Processing Options

Note:At runtime, the wizard enables you to choose from all variants available for apossible agent. lf, for example, you define an organizational unit as a possibleagent, then you can select the organizational unit, the position, or the user.

However, if you want to restrict this view to certain objects, in the binding for taskTS30200146, you can provide the &AllowedAgentTypes& element in the taskcontainer with US (user), S (position), and O (organizational unit).

Ad-hoc Agents

Agent definition in workflow step: WF_INITIATOR

Agent definition in workflow step: Not applicable

Agent definition in workflow step: Not applicable

You can define an ad hoc agent assignment for a workflow. This allows the user who starts theworkflow to assign a recipient at the beginning of the execution to all the steps required forthis. While executing the workflow, this user can at any time also change the recipientassignment for steps that have not been completed yet.

The agent is changed at runtime in the Outbox folder of the Business Workplace. Using theChange agents icon for the steps with ad hoc agents, the user who initiated the workf low canredefine the agents.

You can convert all existing workf lows in the Workflow Builder to ad-hoc workflows, orintegrate ad-hoc processing steps into workflows to be newly defined. Steps that are to beassigned ad hoc users during execution must not have any responsible agents entered in theirstep definition. When a workflow is converted into an ad hoc workflow, the systemautomatically creates container elements in the workflow container and the relevant taskcontainers. The entry fields for responsible agents in the workflow step are filled with anexpression(container element).

To define ad-hoc Agents

':rrrr''',:.'"" 1. Define workf low. The steps for ad hoc agents do not receive an agent definition in theworkflow step.

2. Select Extras->Ad hoc functions -> Enable ad hoc agent assignment

The result;

. Two new elements for the ad hoc agents are created in the workflow container

Figure 66: Setting ad-hoc Agents

218 @ Copyright . All rights reserved.

Page 233: SAP Workflow Bit601 en Col10

Lesson: Defining Agents and Tasks Dynamically

TG700000009 task group

. Both of these elements are entered in the step definition

Exchange Tasks at Runtime

The Process notification ofabsence subworkflow is supplied

with the selected tasksin container element

&TASK&

Revise notification ofa9:gn-::

Delete notification of

il FigLrre 67. Changrng Tasks at Runtime

Consider a scenario in which a workflow consists of two steps, creating a notification ofabsence and processing the new notification of absence.

To determine the second step of the workflow dynamically, you can insert task T570008069.The import parameter for the task is a task group that contains the tasks (standard tasks orworkflows) which can be chosen. You can use an existing task group or create a new

customized task group. ln our example, we are using the TG70000009 task group.

The tasks are displayed in a dialog box for the agent of the Select task step, and the userselects one of these tasks. The task is transferred to a container element. ln the example,&TASK& is the container element.

The step to be determined dynamically, in the example, the Process notification of absencesubworkflow, is to be filled with the selected task. ln the workflow step, the system specifiesthe container element on the Details tab page under Ad Hoc Specif ication Determinatlon. Thiscontainer element contains the required task and overrides the defined task. ln the examplementioned here, the container element is &TASK&.

ln the Iask f ield on the Control tab, define a task that is executed if the container element&TASK& is empty. ln additjon, the task determines the def inition of the task container for thebinding.

You can select and call workflows and tasks. Both interfaces must be identical.

Using the sample workflow, WS74500021, in the system, you can clarify the processinganytime.

As of SAP ERP, you can use the Ad Hoc - Exchange Task wizard to insert an activityT570008069 in the workf low.

The wizard f irst requests the task that is relevant for the interface. The wizard then requeststhe task group that has the potential activities from which, at runtime, a user can select theaction that should occur.

@ Copyright. All rights reserved. 2r9

Page 234: SAP Workflow Bit601 en Col10

Unit 7: Ad Hoc Processing OPtions

220 @ Copyright. All rights reserved.

Page 235: SAP Workflow Bit601 en Col10

Use the Wizard - Select Agents

Business Example

At workf low definition time, you cannot decide how you want to restrict the number ofpossible task agents for a particular workflow step, task Y. However, when your workflow isrunning, one or more users exist who can say exactly who should be the agent responsible forthe workflow step with task Y.

To enable this user to determine the responsible agent for the workflow step with task Y,

dynamically at runtime, you can use a workflow wizard that inserts the following two tasksinto the workflow:

. Task T530200146 that determines the responsible agent for the subsequent task Y.

. Task Y itself.

Task 1

1. Make a copy of your material master workflow template. For the new template, enter thelD zwf_dyset_## and the name Dynamic agent determination ##. Create thetemplate as a local object.

Task 2

L. Ensure that you can dynamically determine the agents for the Change documents formaterial, group ## task. You should be able to select several agents. Ensure that the steponly appears once in the workflow.

Caution:Since the step for which you want to choose the agent is already available inthe workflow definition, the wizard did not request the task that you require,but immediately requested the title of the selection dialog.

'r Note:

r,," lf you create a new task (for which you want to determine the agentdynamically) in a workf low, in the first step of the wizard, specify which task itis. (Enter the key rsxxxxxxxx),

The wizard then creates two process steps (the task TS30200146 and the taskTSxxxxxxxx).

Task 3

@ Copyright. All rights reserved

Page 236: SAP Workflow Bit601 en Col10

Unit 7: Ad Hoc Processing Options

1. Specify the user who dynamicaliy seiects agents for the Change documents for material,group ## task as the workflow initiator.

Task 4

1. Change the agent assignment for the possible agents in your Change documents formaterial, group ## task. Define the ZWF_ORG_## organizational unit as the possrbleagents. ln addition, enter the 81160lr-rAT-#* user as a possible agent.

Task 5

1. Activate your workflow and test the processing.

222 @ Copyright. Allrights reserved.

Page 237: SAP Workflow Bit601 en Col10

Use the Wizard - Select Agents

Business Example

At workf low definition time, you cannot decide how you want to restrict the number ofpossible task agents for a particular workflow step, task Y. However, when your workflow isrunning, one or more users exist who can say exactly who should be the agent responsible forthe workflow step with task Y.

To enable this user to determine the responsible agent for the workflow step with task Y,

dynamically at runtime, you can use a workflow wizard that inserts the following two tasksinto the workflow:

. Task T530200146 that determines the responsible agent for the subsequent task Y.

. Task Y itself.

Task 1

L. Make a copy of your material master workflow template. For the new template, enter thelD zwf_dysel_## and the name rt.ynamic agent determination ##. Create the

template as a local object.

a) Run the transaction code swoo.

b) On the Workflow Builder - Change 'ZWF_TESTL_##'screen, choose Workf low-- Saved5.

c) ln the Give your new template a name here dialog box, enter the following data:

Field Name Entry

Abbr. Zwf_dyseI_##

Name Dynamic agent determination ##

d) On the Creafe Object Directory Entry dialog box, choose LocalObjecl and chooseContinue.

Note:

S," '

A message appears informing you that the new template has been createdas a copy, and from now on you are processing the copy, which is the newtemplate.

Task 2

@ Copyright. All rights reserved. 223

Page 238: SAP Workflow Bit601 en Col10

Unit 7: Ad Hoc Processing Options

1. Ensure that you can dynamically determine the agents for the Change documents for

material, group ## task. You should be able to select several agents. Ensure that the step

only appears once in the workflow.

a) On lheWorkflow Builder - Change'Zwf-dysel-##'screen, double-click Change

documents for material, group ##.

b) ln the Agents pane, delete the value in the Ru/e f ield.

c) Go back to lhe Workflow Builder - Change 'Zwf-dysel-##'screen.

d) On the left-hand side of the Workflow Builder - Change 'Zwf-dysel-##'screen, choose

Workflow Wizards.

e) ln the Wizard pane, chooseModelingSupport.

f) ln the Navigation area pane, choose Change documents for material, group ## task.

g) ln the Workflow Wizards pane, choos e Ad Hoc: Include "Se/ect Editor" .

h) ln the Choose agents dialog box, choose the Continue pushbutton'

i) ln the Iask field, enter Tsxxxxxxxx and choose the Continue pushbutton.

j) ln the Title of sel. dialog box, enter Determine agents dvnamically'

k) Select the Severa/ Agents Can Be Se/ected checkbox and choose lhe Continuepushbutton,

l) Choose the Complete pushbutton.

Caution:Since the step for which you want to choose the agent is already available in

the workflow def inition, the wizard did not request the task that you require,

but immediately requested the title of the selection dialog.

Note:

lf you create a new task (for which you want to determine the agent

dynamically) in a workflow, in the first step of the wizard, specify which task it

is. (Enter the key Tsxxxxxxxx).

The wizard then creates two process steps (the task T530200146 and the taskTSxxxxxxxx).

Task 3

1. Specify the user who dynamically selects agents for the Change documents for material,

group ## task as the workflow initiator.

a) On lhe Workflow Builder - Change 'Zwf-dysel-##'screen, choose Se/ection of Agents

for Subsequent Task in the Graph ical Model pane'

b) You can see that the responsible agent for the step is already the workflow initiator. All

users are defined as possible agents for the task TS30200146 (general task).

224 @ Copyright , All rights reserved.

Page 239: SAP Workflow Bit601 en Col10

Lesson: Defining Agents and Tasks Dynamically

Task 4

1. Change the agent assignment for the possible agents in your Change documents formaterial, group ## task. Define the ZWF_ORG_## organizational unit as the possibleagents. ln addition, enter the Brr6olr4AT-## user as a possible agent.

a) On lheWorkflow Builder - Change'Zwf_dysel_##'screen, double-click Changedocuments for material, group ## lask in the Navrgation area pane.

b) Select the Agent Assignment checkbox in the lask Properties pane. You are now in thescreen for the definition of possible agents for your task.

c) Double-click to display the step with the Change documents for material, group ##task.

d) On the Standard task: Maintain Agent Assignment screen, choose lhe Attributespushbutton.

e) ln the lask: dialog box, select the Generalforwarding allowed radio button.

f) Choose lheTransfer pushbutton.

g) On the Workflow Builder - Change 'Zwf_dysel_##'screen, choose lhe Create agentassignment pushbutton.

h) ln the Choose agenttype dialog box, double-clickOrganizationalunitinlheObjecttypef ield.

i) On the Choose Organizational unit dialog box, enter zwF* in the Search ferm field.

j) ln the Organizational unit (i) dialog box, choose your organization unit and choose theTransfer pushbutton.

k) On the Workflow Builder - Change 'Zwf_dysel_##' screen, choose Ihe Create agentassi gnment pushbutton.

l) ln the Choose agent type dialog box, double-click User in the Oblect type field.

m) On the Choose User dialog box, choose BIT6OIMAT-## in the Search ferm field.

n) ln the User dialog box, choose your material checker and choose lhe transferpushbutton.

o) Go back to the Workflow Builder - Change 'ZWF_dysel_##'screen.

Task 5

L Activate your workflow and test the processing.

a) On lhe Workf low Builder - Change 'ZWF_dysel_##' screen, choose the Generate andactivate runtime version pushbutton.

b) Choose the fest pushbutton.

c) On the Test Workflovy screen, choose the Load pushbutton.

d) Choose Execute.

@ Copyright. All rights reserved

Page 240: SAP Workflow Bit601 en Col10

Unit 7: Ad Hoc Processing Options

Note:A dialog box appears in which you can select the agents to display yourchange documents. The TS30200146 task generated this dialog box.

e) Choose an agent and continue to run the workflow

226 @ Copyright . All rights reserved

Page 241: SAP Workflow Bit601 en Col10

Lesson: Defining Agents and Tasks Dynamtcally

r"ir''r: :,r.ii LESSON SUMMARY::: " You should now be able to:

. Define agents and tasks dynamically

@ Copyright. All rights reserved.

Page 242: SAP Workflow Bit601 en Col10

Enhancing Workflows Using the Step Type AdHoc Anchor

LESSON OVERVIEWThis lesson shows you how to extend a workflow definition by adding an additional workflowusing the step type ad hoc anchor.

Business Example

ln your workflow for changing the material master data, you want to start an additionalworkflow to display the material for a particular agent optionally. This agent should thencheck that the process has run correctly so far and provide written confirmation. For thisreason, you require the following knowledge:

. How to use the Ad hoc anchor step type to extend workflow definition by adding anadditional workf low

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Enhance workflows using step type ad hoc anchor

Workflow Extensions With Ad Hoc Anchors

Procedure:1. Selectthe anchor step.2. Click the icon with the anchor symbol.3. Ghoose the workflowto be executed.

228 O Copyright . All rights reserved,

Page 243: SAP Workflow Bit601 en Col10

Lesson: Enhancing Workflows Using the Step Type Ad Hoc Anchor

At definition time, create an ad hoc anchor in the location in your workflow definition where auser should be able to enhance the definition at runtime. ln the ad hoc anchor step type, enterthe workflows that the user can potentially execute instead of the ad hoc anchor.

At runtime, change to the graphical workflow log of the workf low you want to extend. Selectthe ad hoc anchor you want to replace with the defined workflow and select the icon with theanchor symbol.

The Se/ect task dialog box appears. Double-click to select a workflow. The ad hoc anchor is

replaced by the steps for the inserted workflow.

,i&, Caution:

*** You can only implement an enhancement if the execution still occurs before thead hoc anchor.

To extend a workflow with ad hoc anchors

1.. Select the anchor step

2. Click the icon with the anchor symbol

3. Choose the workflow to be executed

Development and implementation of review workflows

Using a review workflow, you can display data at runtime from the process you are reviewing.To create a review workflow, you have to perform the following steps:

. Define a workflow according to your own requirements and specify which workflow (review

workflow) you want to carry out a review process for under the Reviewer tab in the version-dependent basic data.

@ Copyright. All rights reserved. 229

Page 244: SAP Workflow Bit601 en Col10

Unit 7: Ad Hoc Processing Options

. You define a workflow that should be used as a review workflow. This workflow must beidentified as a review workflow in the Workflow settings tab in the basic data.

. As soon as you set this indicator, the system creates a new element in the workf lowcontainer: ReviewedWorkf low. ReviewedWorkf low.

. You can use a BOR object review and the TS7450B4B1task to carry out reviews.

. n the review workflow, the binding from the monitored workflow on the task T574508481occurs using the elements ReviewedWorkflow-* ReviewedProcesReviewedWorkflow--+Reviewed Process.

. The review workf low must have authorized agents. Call the basic data from the WorkflowBuilder for this and maintain the possible agents for the workflow using the Agentassignment for task option on the basic screenAgent assignment for task option on thebasic screen.

The agents for the actual review (TS745OB4B1) can be defined dynamically or specificallyusing ad hoc agents.

To run the review workflow perform the following steps

. Start the Workflow

. At the point where you want to execute the review process, go to the graphical log.

. On the left of the screen, you can start the review process and specify agents provided youhave defined ad hoc agents.

. The process data to be reviewed is displayed in the review process.

. You can create attachments which are then part of the process for which you are runningthe review.

F,'v'i ,ivcu"t

\ Jp Otu^ !"\t) [v't- k

Started Workflow I - Graphic Log

Start of review workflow

I -\ r___ Datadisplayedr..+- .r |-.- '"il-_'.la-ffi*#;;;"i Afrpfov€ :..- i t"4*,:*- I \lTilffqT..'1,*T*j i *--=--t- 'Atrachment

t-- I I generated

I;EH.I-_] tl;;ffi-tr-l I

inJiroiionotausencci.___-1 i' :..cgntlg :.j Ilr ;. :i1 i I 'rlttlt

Attachment from reviewer workflow in Workflow I displayed

Ut

.r6,t t'i"[ft1

ggi'tl''

@ Copyright . All rights reserved

Page 245: SAP Workflow Bit601 en Col10

Enhance Workflows Using the Step Type AdHoc Anchor

Business Example

You want to keep your workf low for material master changes flexible. You want to insert ananchor step in the Back to person who made the change branch after the user decision Notokay to change material master.

A workflow appears behind the anchor step which displays the currently processed materialmaster for a material checker agent. lf required, you can also run this workflow if you selectedthe Back to person who made the change branch after the user decision Not okay to changematerial master.

Task 1

1. Call your workflow for the material master change.

Task2

1, Creaie an Ad hoc anchor step in the Back outcome of the user decision Not okay to changematerial master. Enter the following data:

Field Name Entry

Step Name Ma ter i aI_ma s ter_to_checker

Outcome name started

Find the relevant workf low for your group using the z#*_awcnoR abbreviation. This

workflow contains a Display material step for your group-specif ic material for aB lT 601M AT - # # materid checker user.

Task 3

L. Activate your workflow.

Task 4

1. Test the workflow, After you display the change documents, call the workflow log. Go tothe graphical log. Select the anchor. Choose Make ad hoc enhancement.ln the dialog boxthat is displayed, select the workflow that you want to start ad hoc.

Task 5

1. Test the inserted workflow.

@ Copyright. All rights reserved.

Page 246: SAP Workflow Bit601 en Col10

Unit 7: Ad Hoc Processing OPtions

Return to the workplace of the user with the work item for displaying the material master,

and continue to run the workflow, ln the user decision Not okay to change material master,

choose lhe Back to person who made the change branch'

Task 6

1. Use the workflow log to check that the ad hoc step you selected in the graphical log using

the anchor has started.

t2') @ Copyright. All rights reserved

Page 247: SAP Workflow Bit601 en Col10

Enhance Workflows Using the Step Type AdHoc Anchor

Business Example

You want to keep your workflow for material master changes flexible. You want to insert ananchor step in the Back to person who made the change branch after the user decision Notokay to change material master.

A workflow appears behind the anchor step which displays the currently processed materialmaster for a material checker agent. lf required, you can also run this workflow if you selectedthe Back to person who made the change branch after the user decision Not okay to changematerialmaster.

Task 1

1. Call your workflow for the material master change.

a) On the SAP EasyAccess screen, choose fools -+ BuslnessWorkf low ---+ Development -+ Definition toois * Workflow Builder -+ Workflow Builder( swnn).

b) ln the Workflow template (1) dialog box, enter zwF_rEsrl 28 in the Search Term field.

Task 2

1. Create an Ad hoc anchor step in lhe Back outcome of the user decision Not okay to changematerial master. Enter the following data:

Field Name Entry

Step Name t'lateria.]. master to checker

Outcome name started

Find the relevant workflow for your group using the z##_ANcHoR abbreviation. This

workflow contains a Display material step for your group-specific material for aB|T601M AT-## material checker user.

a) On lhe Workflow Builder - Change 'ZWF_TESTL_##'screen, choose the Decislon tabpage.

b) ln the Decision Options pane, choose the row with Back in the Outco me Name field.

c) Choose Material master changes not okay in the Navtgation area pane.

d) ln the context menu of Material master changes not okay choose the Create step.

e) ln the Step Se/ection dialog box, double-click Ad Hoc Anchor.

@ Copyright . All rights reserved

Page 248: SAP Workflow Bit601 en Col10

Unit 7: Ad Hoc Processing Options

f) On the Controltab page, enter the following data:

Field Name Entry

Sfep Name t"la teri a I_ma s ter_to_checker

Outcome name started

g) Press ENTER.

h) On lhe Workf low screen, choose the workf low with Z##-ANCHOR abbreviation and

transfer it to step,

i) Choose the Transfer and to graphlc pushbutton to return Iolhe Workflow Builder -Ch ange' ZW F _T EST 1-##' screen.

Task 3

1. Activate your workflow.

a) On lhe Workflow Builder - Change 'ZWF_TESTI-##' screen, choose lhe Generate and

activate ru ntime version pushbutton.

Task 4

1. Test the workflow. After you display the change documents, call the workf low log. Go tothe graphical log. Select the anchor. Choose Make ad hoc enhancement.ln the dialog box

that is displayed, select the workflow that you want to start ad hoc.

a) On lhe Workftow Buitder - Change 'ZWF-TESTI-##'screen, choose the festpushbutton.

b) On the fesf Workf low screen, choose the Load pushbutton.

c) Choose Execute. The change documents are now displayed.

d) Go back to exit the display.

e) On the Iesf Workflow screen, choose theWorkflow Log pushbutton.

f) On the Workf tow Log screen, choose lhe Graphical workflow /og pushbutton.

g) On lhe Display Workflow Log for 'ZWF-TESTL-##' screen, choose the Ad hoc anchor in

lhe Graphical workf low /og pane.

h) Choose the Execute Ad Hoc Extension pushbutton.

i) Choose the workflow that you want to start and choose Continue. The workf low is

inserted where the anchor is located in the log.

j) Go back to exit the graphical log.

Task 5

1. Test the inserted workflow.

Return to the workplace of the user with the work item for displaying the material master,

and continue to run the workflow, ln the user decision Not okay to change material master,

choose lhe Back to person who made the change branch'

234 @ Copyright . All rights reserved

Page 249: SAP Workflow Bit601 en Col10

Lesson: Enhancing Workflows Using the Step Type Ad Hoc Anchor

a) On lhe Workflow Builder - Change 'ZWF-TESTI_##'screen, choose Material masterchange not okay in the Navrgation area field.

b) Continue to run the workflow by executing the work item.

c) On the Decision tab page, choose the Back to person who made the change branch.

d) Choose Save.

Task 6

1. Use the workf low log to check that ihe ad hoc step you selected in the graphical log usingthe anchor has started.

a) Go to the Business Workplace of 8lT601_##.

b) Choose Work items executed by me.

c) Choose the Refresh pushbutton.

d) Choose the work item that was executed and chooselhe Display workflow logpushbutton. You see that a new work item was generated to display the materialmaster. When you check the agent, you see that it is the B|T60LMAT-## user.

@ Copyright. AII rights reserved.

Page 250: SAP Workflow Bit601 en Col10

Unit 7: Ad Hoc Processing Options

,l ],.,',.l......l.l.ll LESSON SUMMARY

rir " You should now be able to:

. Enhance workflows using step type ad hoc anchor

236 @ Copyright . All rights reserved.

Page 251: SAP Workflow Bit601 en Col10

Learning Assessment

1. Using which of the following wizards can you insert an activity to allow a user to determineat runtime which task should be used in the workflow?

Choose the correct answer.

t n Model deadline monitoring

L4 B Ad Hoc - Exchange Task

I C Select agent

in your workflow definition.

fr A create an ad hoc anchor

f] B select an anchor step

I C choose the workflow to be executed

O Copyright. All rights reserved.

Page 252: SAP Workflow Bit601 en Col10

Learning Assessment - Answers

1. Using which of the following wizards can you insert an activiiy to allow a user to determineat runtime which task should be used in the workflow?

Choose the correct answer.

f n Modeldeadline monitoring

E B Ad Hoc - Exchange Task

I C Select agent

2. At definition time, you should

Choose the correct answer.

I n create an ad hoc anchor

f B selectananchorstep

I C choose the workflow to be executed

in your workflow definition.

238 @ Copyright. All rights reserved

Page 253: SAP Workflow Bit601 en Col10

Lesson L

Using Simple Deadline MonitoringExercise 17: Create a Simple Deadline

Lesson 2

Using Modeled Deadline MonitoringExercise 18: Create a Modeled Deadline using a Wizard

240243

249255

UNIT OBJECTIVES

. Use simple deadline monitoring

. Use modeled deadline monitoring

@ Copyright . All rights reserved. 239

Page 254: SAP Workflow Bit601 en Col10

Using Simple Deadline Monitoring

LESSON OVERVIEWThis lesson explains the use of simple deadline monitoring methods to monitor deadlines forbusiness process steps.

Business Example

You want your business process for displaying material master data to be completed withinone day, if possible, and definitely within three days. This lesson describes how you canmaintain this deadline monitoring. For this reason, you require the following knowledge:

. How to define and test a simple deadline for a workflow step

.l.ll.,lr.r.. LESSON OBJECTIVES

. Use simple deadline monitoring

Possible Deadlines

The following are possible deadlines when managing the completion of businessprocesses:. Requested start

This is the earliest possible time for the start of processing. The work item does notbecome visible in the Business Workplace of the recipient until this time.

. Latest start

Possible deadlines

r Requested start

r Latest start

r Requested end

r Latest end

Each deadline has

r An individualreference point

r A notification agentfor misseddeadlines exception:requested start)

r A notification text(exception:requested start)

Figure 71: Simple Deadlines

24Q @ Copyright. All rights reserved.

Page 255: SAP Workflow Bit601 en Col10

Lesson: Using Simple Deadline Monitoring

This is the latest deadline for starting the processing of a work item. The status of the workitem must change from Ready to ln Process.

. Requested end

This is the requested deadline for completing the processing of a work item.

. Latest end

This is the latest deadline for completing the processing of a work item.

The deadline is defined in the workf low step under the relevant tab page.

You maintain the following information on these tab pages:. Reference deadline: The time (which you also maintain on the tab) starts as of this date

(create work item, create workf low, and date in a workflow container expression).

. The list of recipients to receive text when a simple deadline is missed.

. The text to be sent to the specified recipients if a simple deadline is missed.

The definition of the text sent is part of the task definition maintained under the Descriptiontab page of a task.

The missed deadline is evaluated by the lob SWWDHEX.

Simple Deadline Monitoring in a Workflow Step

You can define deadline monitoring in the context of a workflow step.

You define deadline monitoring when integrating a task in a workflow using a workflow step.

The definition is made in the workflow step on the tab page of the requested deadline. Here,

you can determine the time that can expire and the reference point for the calculation.

You establish that this is a simple deadline. For doing this, you choose Send Text on the

Action tab page. You also determine who should receive the work item whose deadline is

missed.

My_partmessagegrjsbtk"EgfNew_part

Material:Send reminderOld materiah

Wrile change document

A Triggersevent

I l--------__li:-l*i t>),"t;";

+

Wo*flow slepDisplay material

Recipient anddeadline defrne4

Display material

Tetrtfor misscddeadline

Time offset forrequested end

*ri Figure 72'. Example of a S mpie Deadiine Escalation

@ Copyright. All rights reserved

Page 256: SAP Workflow Bit601 en Col10

Unii B: Options for Simple and Modeled Deadline Monitoring

For a simple deadline, the runtime behavior is as follows:

. The work item remains in the Business Workplace after time has run out, and can be

accessed anytime, even past the deadline. The status of the work item does not change'

. A work item whose deadline is missed is sent to the specified recipient. The work item text

is def ined in the underlying task.

. The recipient finds the work item in the Business Workplace by choosing lnbox - Deadline

Messages.

For a simple deadline, the prerequisites are as follows:

. The job SWWDHEX is scheduled.

Schedule this job periodically in Workflow Engine Customizing using transaction code

SWU3.

242 @ Copyright. All rights reserved.

Page 257: SAP Workflow Bit601 en Col10

Create a Simple Deadline

Business Example

You can monitor Ihe Display change documents step using a simple deadline. For this step,use the deadline Requested end. As soon as this deadline has been missed, the system shouldsend a notification text to the Deadline messages folder of the lnbox of user B|T601MAT-##(where ## isyour group number). The agent who let the deadline expire receives a

notification in his or her Overdue Deadlines folder.

Task IMaintain the deadline Requesfed end f or the step Change documents for material, group ##.Use a simple deadline. ln the test, the step Change documents for material, group ## is to becompleted within one minute, otherwise the subsequent processing starts and the userBlT60lMAT-## receives a deadline monitoring notification.

1. Call your workflow for the material master change inthe Workflow Builder.

Task 2

Monitor lhe Change documents for material, group ## step together with a simple deadline.Use Requested end as the deadline type. lf the deadline has been missed, the B|T60LMAT-##user should receive a notification text.

1, Add a deadline to control the Requested end allowed for completing the work item.

2. The reference point for the calculation should be the creation of the work item.Give the agent 1 minute to complete the process after the work item has entered his or herBuslness Workplace.

3. Specify Ihe BIT60IMAT-## user as the recipient of the notification.

4, Enter the notification text: The step change docunents for maleriar, group ##waE not executed on time.

Task 3

1. Activate and test the workflow. To simplify the test, deselect the Advance with dialogcheckbox from the Change documents for material, group ## step.

Task 4

1, Check deadline monitoring, Display your work item to display the change documents inthe Technical Work ltem display and wait until it has been identified as having expired. The

SWWDHEX job periodically checks whether the deadlines for work items have beenmissed.

@ Copyright . All rights reserved

Page 258: SAP Workflow Bit601 en Col10

Unit B: Options for Simple and Modeled Deadline Monitortng

Then display the notif ication in the Deadline messages folder for the user BIT6OIMAT-##.Make sure that the work item agent who let ihe deadline expire has received an

information notification in his or her Overdue deadlines folder.

244 @ Copyright. All rights reserved.

Page 259: SAP Workflow Bit601 en Col10

Greate a Simple Deadline

Business Example

You can monitor Ihe Display change documents step using a simple deadline. For this step,

use the deadline Requested end. As soon as this deadline has been missed, the system should

send a notif ication text to the Deadtine rnessages folder of the lnbox of user BIT5OLMAT-##

(where ## is your group number). The agent who let the deadline expire receives a

notification in his or her Overdue Deadlines folder.

Task 1

Maintain the deadline Requested end for the step Change documents for material, group ##Use a simple deadline. ln the test, the step Change documents for material, group ## is to be

completed within one minute, otherwise the subsequent processing starts and the user

BlT60lMAT-## receives a deadline monitoring notification.

1. Call your workflow for the material master change intheWorkflow Builder.

a) On the SAP EasyAccess screen, choose fools --- Buslness

Workftow --- Development ---+ Definition too/s --+ Workflow Builder -+Workflow Builder.

b) lf your workf low is not displayed, choose Other Workflow/Version. Use the

abbreviation zwf *** to search for your workf low'

Task 2

Monitor lhe Change documents for material, group ## step together with a simple deadline.

Use Request ed end as the deadline type. lf the deadline has been missed, lhe BIT60IMAT-##user should receive a notification text.

1. Add a deadline to control the Requested end allowed for completing the work item.

a) On the Workftow Builder - Change'ZWF-TESTI-##'screen, choose Change document

for material, group ## in the Navigation area pane.

b) Choose the Requested end tab page.

2. fhe reference point for the calculation should be the creation of the work item.

Give the agent 1 minute to complete the process after the work item has entered his or her

Business Workplace.

a) On the Requested end Lab page, enterwork rtem Creation in the Refer date/time

f ield.

b) Enter r in the Minute(s)tield.

3. Specify lhe BtT6OlMAr-## user as the recipient of the notification.

a) ln the Display iext pane, enter user in the Reciplent of message when requested end

missed field.

@ Copyright . All rights reserved.

Page 260: SAP Workflow Bit601 en Col10

Unit B: Options for Simple and Modeled Deadline Monitoring

b) Enter 811601l,rAT## in the User field.

4, Enterthenotificationtext: The step change documents for material , group ##

was not executed on time.

a) On the Workf tow Buitder - Change 'ZWF_TESTI-##' screen, choose Text sent when

requested end reached - ctick here to go to a task. The underlying standard task is

displayed.

b) On Ihe Standard Task: Disptay screen, choose Standard task- , Display<->Change.

c) On the Description tab page, enter Requesled end text in the fext fype field.

d) Choose IheChange text pushbutton.

e) On the Requested end text ChangeScreen, enter the step change documents

for material, group## was not executed in tine.

f) Press ENTER.

g) Go back to the Standard Task: Change screen.

h) Choose Save.

i) Go back tothe Workflow Builder - Change 'ZWF-TESTI-##'screen, and choose Save.

Task 3

1. Activate and test the workflow. To simplify the test, deselect Ihe Advance with dialog

checkbox from the Change documents for material, group ## step'

a) On lhe Workflow Builder - Change 'ZWF-TESTI-##'screen, choose the Detalls tab

page.

b) ln the Work ltem Response pane, deseleclthe Advance with dialog checkbox.

c) Return from the step to the basic screen of the Workflow Builder'

d) On Ihe Workftow Builder - Change 'ZWF-TESTI-##' screen, choose Ihe Generate and

activate runtime version pushbutton.

e) Choose the lest pushbutton.

f) On the Test Workflow screen, choose the Load pushbutton.

g) Choose Execute.

Task 4

1, Check deadline monitoring. Display your work item to display the change documents in

the Technical Work ltem display and wait until it has been identified as having expired. The

SWWDHEX job periodically checks whether the deadlines for work items have been

missed,

Then display the notification in the Deadline messag'es folder for the user B|T60LMAT-## '

Make sure that the work item agent who let the deadline expire has received an

information notification in his or her Overdue deadlines folder'

a) on the rest workftow screen, choose Iheworkflow Log pushbutton.

246 O Copyright. All rights reserved.

Page 261: SAP Workflow Bit601 en Col10

Lesson: Using Simple Deadline Monitoring

b) On theWorkflow Log screen, choose Material master change ok? in the Workflow andtask field.

c) On the Workflow material master change group ## screen, choose Goto ---, Technicalwork item display.

d) On the Display work item screen, the monitored deadline is displayed. Wait until theSWWDHEX job that is running periodically has recognized the missed deadline. To dothis, exit the work item display afler 2 minutes or 3 minutes and then call it again.

e) Repeat this process until a bell appears beside your end date.

f) Then exit the work item display and the Business Workplace.

g) Callthe Buslness Workplace again and choose Inbox.

h) Choose overdue entries, you will find a note informing that the item was not executedin sufficient time.

i) Display Ihe B\T60IMAT-## user workplace.

j) Choose lnbox.

k) The user must have a work item in the Deadline messages folder that displays thedefined text.

@ Copyright . All rights reserved

Page 262: SAP Workflow Bit601 en Col10

Unit B: Options for Simple and Modeled Deadline Monitoring

;ri l.:r,r.,,,..,,.l LESSON SUMMARY':i::lr' You should now be able to:

. Use simPle deadline monitoring

248O Copyright. All rights reserved.

Page 263: SAP Workflow Bit601 en Col10

Using Modeled Deadline Monitoring

LESSON OVERVIEWThis lesson shows you how to use modeled deadline monitoring.

Business Example

This lesson describes how you can maintain the modeled deadline monitoring. You want tostart an action when the preceding work item's deadline has exceeded. For this, you can

maintain a modeled deadline using a Wizard. For this reason, you require the followingknowledge:

. How to maintain modeled deadlines manually

. How to create a modeled deadline using wizards

. How to delete modeled deadline monitoring

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Use modeled deadline monitoring

Modeled Deadlines - Manually Maintained

Deadline monitoring always refers to a workflow step. lf you choose a modeled deadline, the

system automatically generates additional branches in the workflow definition. Modeled

deadlines can be transferred into the workflow step manually or using awizard.

r Possible deadlines

r Requested start

r Latest start

r Requested end

r Latest end

r Each deadline has

r An individualreference point

r A customer-specificaction that isexecuted when thedeadline is reached

Figre 73: Modeied Deadlines

O Copyright . AII rights reserved

Page 264: SAP Workflow Bit601 en Col10

Unit B: Options for Simple and Modeled Deadline Monitoring

Maintain Modeled Deadlines

Deadline-monitored step,modeled without wizard

Ouieome if lalestend reached

The workflowmay have two

outcomes.

Figure74. Modeled Deadlines - Manually Marnta ned

The procedure for maintaining a modeled deadline without using the wizard is as follows:

1. lntegrate your task into a workflow.

2. Define deadline monitoring for the step on the required tab page.

3. On the corresponding tab page, choose Possib/e Actions, choose lhe Modeled tab page.

4. The system generates an additional outcome for the step, such as the name of thedeadline reached, for example, Latest end reached and required end reached'

5, ln this branch, integrate the processing that you want should take place after the deadline

has been missed.

6. The missed deadline does not complete the monitored work item. This means that your

workflow potentially has two outcomes.

You can use the step type process control to intervene in the control of the process.

Types of process control steps are as follows:. End or terminate work item.

. End or terminate workflow.

250 @ Copyright. All rights reserved.

Page 265: SAP Workflow Bit601 en Col10

Lesson: Using Modeled Deadline Monitoring

Caution:Modeled deadline monitoring without awizard does not terminate the deadlinemonitoring step. ln the newly created branch, for which you provide a new nameas of SAP Enterprise Resource Planning (ERP), you can define one or severalactions that you want to execute in the workflow.

However, the process does not immediately continue as it was originally defined.The workflow potentially has two outcomes. The actual outcome depends onhow you define the process and the reaction to the missed deadline.

Wizard-Modeled Deadl ines

The results which occur when deadline monitoring is implemented using a wizard are as

follows:

L. The wizard generates two new outcomes in the workflow def inition, Deadline reached andobso/ete.

2. When the deadline is reached, the monitored work item is set to obso/ete'

3. The workflow goes to the branch behind the obso/ete outcome.

4. The customer-specific action can be defined in this outcome.

5. The original work item can no longer be executed.

The SWWDHEX job evaluates the missed deadline.

While modeling deadlines with the wizard, if you miss a defined deadline, modeled subsequentactions should be run that render further processing of the monitored work item superfluous.

When def ining the monitored step, the exception processing obsolete is to be selected and

any appropriate subsequent steps must be implemented. The data on deadline setting is to

be maintained.

,1,

w Userdecision

d reached

Set "Deadline

Alternative step(defined as required)

is executed

ffi"o

l."t1

reached" indicator

Work item setto "obsolete"

Work item setto "obsolete"w

Iir'trra F gure 75: Modeling Deadline Monrtorrng Us ng a Wizard

@ Copyright. All rights reserved. 251

Page 266: SAP Workflow Bit601 en Col10

Unit B: Options for Simple and Modeled Deadline Monitoring

The Modet deadline monitoring wizard helps you to integrate the necessary steps. Select thestep you want to monitor in the Workflow Builder. Then, open Ihe Workflow Wizards section

on the left of the Workflow Builder and-execute lhe Model deadline monitoring wizard from the

miscellaneous folder,

The wizard queries the data on the deadline monitoring.

lf you do not select a task when you call the wizard, the system also asks you for which task

you want to model a deadline.

Caution:As a result of the modeled deadline monitoring with the wizard, the deadline

monitored step always terminates. The workflow ihen executes one or several

actions (or even no action) that you (as the customer) define in the newly

inserted branch obso/efe. The process then continues as it was originally defined.

The workflow has one single outcome.

Example of a Modeled Deadline Escalation

You can also create modeled deadline monitoring without using a wizard.

Delete Modeled Deadline Monitoring

The steps for deleting modeled deadline monitoring are as follows:

L. Call the monitored step in the Workflow Builder and open the tab page that you require.

2. Set the entry to No Deadline Monitoring Active'

3. Switch from modeled to Display text.

4. Leave this step and choose Yes to confirm all of the dialog boxes that are displayed.

lf you model deadline monitoring with a wizard, remove the obso/ete branch from the

workflow definition.

Terminate old work item and start a new work item

Material:, My3art

Old material: :>-'€Original_part

Change Documents{*&.

Workflow

Recipient

Figure 76: Example of a Modeled Deadline Escalatlon

: ,..

:' organizational PlariIlesign department

Designerposition

-L Holder: MaryMaterial Manager position

:t

&l rnyescalation step

252 @ Copyright. All rights reserved

Page 267: SAP Workflow Bit601 en Col10

Lesson: Using Modeled Deadline Monitoring

The steps for deleting the obsolete branch from the workflow definition are as follows:

1. Call the step that was previously monitored.

2. Switch to the Outcomes tab.

3. Click the green icon to deactivate Processing obso/ete.

4. Leave this step and again choose Yes to confirm all of the dialog boxes.

@ Copyright . All rights reserved. 253

Page 268: SAP Workflow Bit601 en Col10

Unit B: Options for Simple and Modeled Deadline Monitoring

254 @ Copyright. All rights reserved

Page 269: SAP Workflow Bit601 en Col10

Create a Modeled Deadline using aWizard

Business Example:

You want to monitor the deadlines for your business process step Display Material Master toensure that the changes to the material master are made on time. You want to end the stepwhen the deadline is exceeded. You will create a modeled deadline using the \Nizard, and useLatest End.

After the work item terminates, the workf low sends a mail to the agent B\T60IMAT-##.Theuser locates this mail in the Office Inbox (documents) in the Buslness Workplace.

Task 1

Call your workflow for the material master change. ln this workflow, you want to entermodeled deadline monitoring for a step.

1. Call your workflow for the material master change inthe Workflow Builder.

Task 2

Monitor the process step Display material master, group ## using a modeled deadline. You

should monitor the task using the deadline type latest End. lf the deadline has been

reached, the work item is to be set to Obso/ete and you can include a new branch Obso/ete inthe processing. Create this modeled deadline monitoring using the wizard for deadlinemodeling.

1. ln the step Display material master, add a deadline to control the Latest end allowed forcompleting the work item.

2. Give the agent 1 minute to complete the process after the work item has entered theBusiness Workplace of the agent.

Task 3

L. ln the newly created branch Obsolete, define a subsequent process that starts when thedeadline has been missed. A mail is to be sent to the user who works as the materialchecker. The user has the lD B|T601MAT-##.

Enterthe step description:uaterial display not executed on time. Enterthemail text: The material was not dispJ-ayed on tine. The system creates a new

taskfortheSend Maillask. Enterthe lD:z##_Mail. Enterthe/ongfext:t'tail toobsorete *#. Exit the step and activate the workflow.

Task 4

1., Activate and test the workflow.

O Copyright . All rights reserved.

Page 270: SAP Workflow Bit601 en Col10

Unit B: Options for Simple and Modeled Deadline Monitoring

Task 5

1. Check deadline monitoring. Navigate from the test transaction swus to the workflow log to

display the effects of the deadline monitoring. The SWWDHEX job periodically checks

whether the deadlines for work items have been missed. Wait a couple of minutes, refresh

the workflow log and observe what happens.

256 @ Copyright . All rights reserved.

Page 271: SAP Workflow Bit601 en Col10

Create a Modeled Deadline using aWizard

Business Example:

You want to monitor the deadlines for your business process step Display Material Master loensure that the changes to the material master are made on time. You want to end the stepwhen the deadline is exceeded. You will create a modeled deadline using the Wizard, and useLatest End.

After the work item terminates, the workflow sends a mail to the agent BIT6OIMAT-##.Theuser locates this mail in the Office lnbox (documents) in the Euslness Workplace.

Task 1

Call your workflow for the material master change. ln this workflow, you want to entermodeled deadline monitoring for a step.

1. Call your workflow for the material master change inlhe Workflow Builder.

a) On the SAP Easy Access screen, choose Tools ---+ BuslnessWorkflow ---+ Development ---+ Definition fools --' Workflow Builder ---+ Workflow Builder.

b) lf your workflow is not displayed, choose Other Workflow/Version. Use theabbreviation zwf *** to search for your workflow.

Task2

Monitor the process step Dlsp/ay material master, group ## using a modeled deadline. You

should monitor the task using the deadline type r,atest End. lf the deadline has been

reached, the work item is to be set to Obso/ete and you can include a new branch Obso/ete inthe processing. Create this modeled deadline monitoring using the wizard for deadlinemodeling.

1. ln the step Display material master, add a deadline to control the Latest end allowed forcompleting the work item.

a) On Ihe Workflow Builder - Change 'ZWF-TESTL-##'screen, choose Change

documents for material, group ## in the Navigation area pane.

b) On the left-hand side screen, choose Workflow Wizards in the selection menu.

c) Choose Modeling Support in lhe Wizard pane.

d) Double-click Model Deadline Monitoring.

e) ln the Model Deadtine Monitoring dialog box, choose Ihe Continue pushbutton.

f) Enter Ts302oo14 e in the Iask f ield and choose Ihe Continue pushbutton.

g) Select the Latest end radio button as the deadline to be monitored and choose theContinue pushbutton.

O Copyright . All rights reserved.

Page 272: SAP Workflow Bit601 en Col10

Unit B: Options for Simple and Modeled Deadline Monitoring

2, Give the agent 1 minute to complete the process after the work item has entered the

Business Workplace of the agent.

a) Select theWork ltem Creation radio button and enter 1 in the Timelntrvlfield and

choose the Contlnue Pushbutton,

b) Choose the Complete pushbutton to enable the wizard to complete the process.

Task 3

1. ln the newly created branch Obso/ete, define a subsequent process that starts when the

deadline has been missed. A mail is to be sent to the user who works as the material

checker. The user has the lD BIT5OLMAT'## '

Enter the step description: r'raterial display not execuLed on time. Enter the

mail text: The material was not disp].ayed on time. The system creates a new

task for the Send MailI"ask. Enter the lD: z#*_l'rait. Enter the /ong text:l'rair toobsofete #*. Exit the step and activate the workflow.

a) On the Workflow Builder - Change'ZWF-TEST1-##'screen, choose Undefined inlheNavigation area pane after the Obsolete outcome inlhe Workflow Builder'

b) ln the Graphical Modelpane, choosethe Create step pushbutton'

c) ln the Step Se/ection dialog box, double-click Send Mailin the Step Type pane.

d) On the Mailtab page, enter the following data:

Field Name Entry

Sublect Material displaY not executedon tine

Mail text The material was not displaYedon time

ln the Reclplents pane, choose User in the Reclplent type field'

on the Give your new task a name dialog box, enter the following data:

ln the Create Object Directory Entry dialog box, choose the Local Obiect pushbutton.

ln the User f ield, enter BIT601!tAT-#* as the recipient of the notif ication.

Caution:To define the user as the recipient of the mail, switch from Expresslon to

user. At this point, the system may request the data under which you

want to create the new task for Send Mail'

i) Choose lhe Transfer and to graphlc pushbutton to exit the step'

e)

D

s)

h)

Field Name Entry

Abbr, z#*_mail

Name t'Iai]. to obsolete ##

258 @ Copyright. All rights reserved

Page 273: SAP Workflow Bit601 en Col10

Lesson: Using Modeled Deadline Monitoring

Task 4

1. Activate and test the workflow.

a) On lheWorkflow Builder - Change'ZWF_TESTI_##'screen, choose the Generate andactivate ru nti me version pushbutton.

b) Choose the fest pushbutton, and transfer your material and start the execution.

A list of material changes is displayed. Process this work item by exiting the list andchoosing lhe Complete workifem pushbutton. When you do this, you reach the step in

the workflow in which deadline monitoring occurs.

Task 5

1. Check deadline monitoring. Navigate from the test transaction swus to the workflow log todisplay the effects of the deadline monitoring. The SWWDHEX job periodically checkswhether the deadlines for work items have been missed. Wait a couple of minutes, refreshthe workflow log and observe what happens.

a) On the fest Workflow screen, choose Execute.

b) Choose the Workflow Log pushbutton to monitor the workf low processing in theWorkf low Chronicle view. You can display the deadline data in the technical view of thework item easily.

c) On lhe Workflow Log screen, choose Workflow material master change group ## in theWorkflow and fask field.

d) On lhe Workflow material master change screen, choose Goto --+ Technical work itemdisplay.

e) On lhe Display work item screen, afler 4 minutes or 5 minutes, choose the Refreshpushbutton and check in the workf low log whether the missed Latest end has actuallybeen reached. ln the log, the entry Completed is displayed under the status, and MailSenf is displayed under the result.

@ Copyright. All rights reserved. 259

Page 274: SAP Workflow Bit601 en Col10

Unit B: Options for Simple and Modeled Deadline Monitoring

LESSON SUMMARYYou should now be able to:

. Use modeled deadline monitoring

260 O Copyright . All rights reserved.

Page 275: SAP Workflow Bit601 en Col10

\ti

Learning Assessment

Which deadline can be used for indicating the end of the processing time of a work item.

Choose the correct answer.

A Requested start

B Latest start

C Requested end

D Latest end

When you create modeled deadlines using the workflow wizard, the wizard generateswhich of the following outcomes?

Choose the correct answers.

A Deadline reached

B Latest end reached

C Obsolete

D Required end reached

3, Modeled deadlines with a wizard set a work item to obsolete and go to a new branch in theworkflow.

Determine whether this statement is true or false.

True

False

4. Modeled deadlines without awizard insert a new branch into the workf low, and continueprocessing from there. The original work item still exists.

Determine whether this statement is true or false.

True

False

TT!w

TnrT

X

L

ft L-L

E!

dT

@ Copyright. All rights reserved 26t

Page 276: SAP Workflow Bit601 en Col10

' ' ':,lr:llllllr. 'r.::::.llr .l.r-::lirll l

,.,.'9X1I,.8 r

i]r].]l;l'l : l:::l:', ' ,].t:t,.... .:l:,t,,.1...]t:

TTEl

I D Required end reached

3. Modeled deadlines with a wizard set a work item to obsolete and go to a new branch in the

workf low.

Determine whether thls statement is true or false'

True

False

4. Modeled deadlines without awizard insert a new branch into the workf low, and continue

processing from there. The original work item still exists.

Determine whether this statement is true or false'

En

En

True

False

Learning Assessment - Answers

L Which deadline can be used for indicating the end of the processing time of a work item

Choose the correct answer.

A Requested start

B Latest start

C Requested end

D Latest end

2. When you create modeled deadlines using the workf low wizard, the wizard generates

which of the following outcomes?

Choose the correct answers.

A Deadline reached

B Latest end reached

C Obsolete

262 O Copyright. All rights reserved

Page 277: SAP Workflow Bit601 en Col10

.fifl]$llffifkf16 lllilllt X$$|lii::ll'ii}lowl6:.. . -. :.,rri: . i::l jrirri r'.;-.':: ::,.'i.rul.::r:.r.,:,r rr. r r, !.. r :

Lesson 1

Defining Events in the BOR

Lesson 2

Linking the Workflow and the Triggering Event

fxercise 19: Link a Triggering Event to the workflow

Lesson 3

Triggering Events in the Application

Exercise 20: Trigger an Event using Change Documents

Lesson 4

Defining Additional Start Conditions and Using the Event Queue

Exercise 2L: Define an Additional Start Condition

Lesson 5

Testing in the Event Environment and During Workflow lmplementation

264

268271

275

283

2BB

2g5

300

,, UNtT OBJECTIVES:t, . Explain processing logic and definition of events in the BOR

. Link the workflow and the triggering event

. Trigger events in the application

. Define additional start conditions and use the event queue

. Test in the event environment and during workflow implementation

@ Copyright , All rights reserved. 263

Page 278: SAP Workflow Bit601 en Col10

Defining Events in the BOR

LESSON OVERVIEWBusiness processes start when a specific action takes place in the system. The actions in thesystem are represented by events, which can be used by workflows or work items. This lesson

provides an overview of the underlying interaction between the application and the workflow,and explains which steps must be completed so that the Workflow Engine can work withevents.

Business Example

Your workflow is completed and runs smoothly in the test transaction. Now, you only need theconnection to an external triggering event from the application transaction that starts theworkflow. You need to understand the basics of how the application and the Workflow Engine

work together. You have already defined an event for your material object type in theBusiness Object Repository (BOR). For this reason, you require the following knowledge:

. An understanding of event creators and receivers

. An understanding of events in the BOR

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Explain processing logic and def inition of events in the BOR

Event Creators and Receivers

Publish and subscribe - lnteraction between event generator and recipient

"Edit Material Master" transaction(basic view) Creation of change

documentsI

IGonfiguration transaction

SWEC

Material: My_part

Old material: @rra{€'New-part

iae;**-."* i. ,r:..,.

l| -. ..t

Organlzational plani

i

I

pesign departmentLpesigner position

LHolder: Mary workllowMalerial change

flroduct Management unitLProduct Manager PositionL Holder: Jones

FigureTT. Example: Triggering Event for a Workf ow

264 @ Copyright. All rights reserved.

Page 279: SAP Workflow Bit601 en Col10

Lesson: Defining Events in the BOR

Object type events can be used to trigger tasks or workflows. You need to have defined thecorresponding event in the BOR for the object type. The example uses the eventold_material_changed. When a change document is written in the system, you have the optionto trigger an event.

The SAP system logs the changes to master data information, and sometimes also thechanges to transactional document data in Change Documents. Check whether changedocuments will be written for the scheduled data changesin your application. lf not, you willhave to trigger the event in another way.

You can use the menu Workflow ---+ Events to view a list of existing change document objectsand when they were written. Also see: Basic menu --+ Tools ---+ Buslness Workflow --+

Development --> Definition fools--+ fools --+ Business Workflow --+ Development --+ Definitionfools-- Events -- Event creation --+ Change documents --+ Overview or Workflow properties.You can activate the triggering of an event based on a change to the material master by usingtransaction SWEC, or awizard.ln the next step, you have to create the event as a triggeringevent in your workflow, and set the event linkage to active.

You would need to specify the following to create an event in the BOR:

. The object type, whose status change the event relates to (for example, invoice, material,and so on)

. A technical name (for example, created, released, deleted, and so on)

At runtime, the application must create the event when the specified change of status occurs.This does not necessarily happen by default. A slide in this unit shows the options that you

can use to trigger events in the application. Events contain information from the context oftheir creation. This information is stored in the event container and is available for the eventreceiver.

ln the event receiver linkage, the reactions to the occurrence of an event are defined outsidethe standard application. The receiver of the event can be a workflow or any appropriatefunction module provided by SAP, the customer, or a third-party provider.

The event receiver linkage follows a publish-and-subscribe approach. ln this approach, theevent is created and the event manager is notified that the event has been published. The

Applicationgenerates

events

Flexible linkage,can be defined

independently ofthe application

I

l

lny number of l

recipients ]

,"'tt"

1

)

Event manager

Frgure 78: Event Creators and Receivers

@ Copyright. All rights reserved 265

Page 280: SAP Workflow Bit601 en Col10

Unit 9: Events and Workflow

event-creating object does not need to know about potential interested parties or receivers of

the event. lnterested receivers enter themselves in a linkage table or subscribe to an event.

The event manager checks the entries in the linkage table and ailocates the assignment. An

event can have several receivers, and a workflow can also start on several events.

Event Processing in the Workflow

lmplement the following when you start working with an event:

f ade2'. Event Processing in Workflow

A task must define a terminating event if it is based on an asynchronous method.

Events in the Business Object Repository

An event describes a possible status change for an object in the SAP system. Before an event

can be used in a workf low, it must be defined in the BOR for the object type. The definition,

however, does not mean that the event is created in the SAP system by default.

Events are triggered explicitly. The application itself can be the triggering agent. lf a workflow

reacts to an event that is not in the application, you can customize the SAP system so that the

required event is published in the system.

Which Steps must be Performed Where ls the Setting lmplemented

The event must be defined in the repositoryfor the object type.

BOR

Subscribe

The workflow and the triggering event mustbe actively linked, or tasks must def ine

terminating events.

The Workflow Builder - basic dataWorkflow Template

Task def inition

Publish

The application must generate the event in

the system.

Different options (see following units and

SAP documentation)

Parked document posted

Recruitment freezer

Budget limit reached I til object tYPe. evenr

Order canceled ,. --,,''

Project milestone reached :

9s-t9r: ::1e9' {lF:lllsgd j

i,:..J f igure 79: Events Defined for an Oblect Type in the Business Object Repository

266 O Copyright . All rights reserved

Page 281: SAP Workflow Bit601 en Col10

Lesson: Defining Events in the BOR

LESSON SUMMARYYou should now be able to:

. Explain processing logic and definition of events in the BOR

@ Copyright. All rights reserved,

Page 282: SAP Workflow Bit601 en Col10

Linking the Workflow and the Triggering Event

LESSON OVERVIEW

This lesson explains how you can define an event as a triggering event for a workflow.

Business Example

Your workflow is completed and runs smoothly in the test transaction. You have defined an

event in the Business Object Repository (BOR) for your object type and now you need tounderstand how you can actively link your workflow to that event. For this reason, you require

the following knowledge:

. An understanding of how to define an event as a triggering event for a workflow

. An understanding of event binding

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Link the workflow and the triggering event

The Triggering Event Definition Process

The following are the steps for a triggering event to be linked to a workflow:

1. Ensure that a variable, which can include the object reference from ihe event, exists in the

workflow container.

Start the Workflow Builder and in the existing variable with the correct type (the object

type of the triggering event) in the workflow container, choose the Import and Obligatory

checkboxes. lf you had not already created it, you would need to create it now.

2. ln the header basic data section of the workflow template, enter the event as a triggering

event.

3. Check the binding between the event container and the workflow container. The binding

should be as follows:

-WF-l nitiator <-

-EVT-C R EATO R

<object variable> <-- -EVT-OBJECT

4, ln the header basic data section of the workflow template, activate the event linkage.

5. Test the linkage between the event and the workflow using transaction swue.

Alternatively, on the SAP Easy Access screen, choose

Iools --+ Workflow --+ Development ---+ lJtilities -+ Events '- Generate Event.

Events always occur in association with one particular object. For example, at runtime the

event material master changed refers to the material P-100 or fD-4958-AZ or LZN-6099. The

event customer master created can refer to the customer Jones, Hillberg, or Parelzky

268 @ Copyright. All rights reserved

Page 283: SAP Workflow Bit601 en Col10

Lesson: Linking the Workf low and the Triggering Event

lf a workflow is to react to an event, it must know the runtime-specif ic object. lt is transferredfrom the event manager in the variable _EVT_OBJECT. ln the workflow container, a variablemust exist for recognizing the object. This variable must relate to the required object type.Select the lmport and Mandatory checkboxes also.

Entering a Triggering Event for a Workflow

The triggering event is entered in the workflow in the Triggering Events tab page.

As of Release 4.68, on the SAP Easy Access screen, choose Iools ---+ BusinessWorkflow ---+ Development --+ Definition fools -' Tasks/Task groups -, Task type: Workflowtemplate, choose the number of the workflow and choose Change ---+ Triggering Events.

As of Release 4.6C, on the SAP Easy Access screen, choose Iools --- BuslnessWorkflow --+ Development --+ Definition Tools --+ Workflow Builder. Enter the workflow to beprocessed. Choose Goto --' Basic Data.

ln Release 6.20, choose the Start Events tab page.

The input data is always the object type and the triggering event.

The system automatically generates a binding between the event container and the workflowcontainer. For this binding there should be a variable in the workflow container, which is of thesame type as that of the triggering events object. This binding must correspond to the entryon the slide. To check this, use the green binding def ined pushbutton or Binding pushbuttonbeside the object category entry.

The event is now correctly bound to the workflow. However, the linkage is not yet active,which means that the workflow will not start when the event is created in the system.

Activate the event linkage explicitly.

Activating the Event Linkage

The following are the different options for activating the event linkage:. Execute transaction pFWS, on lhe Workf low Builder screen, choose Workflow

Template --+ Triggering Events tab page. Choose the active or not active red pushbuttonnext to the entry for the object type (before 4.6C).

. Start the Workflow Builder, choose Basic Data --+ Start Events tab page (6.20) or Start(4.6C).

Caution:ln Release 4.6C, the_EVT_CREATOR is not automatically transferred to the_WF_lNlT|ATOR. Display the element by choosing the Display /lnespushbutton and enter values for the binding yourself.

A workflow can have more than one triggering event.

@ Copyright . All rights reserved.

Page 284: SAP Workflow Bit601 en Col10

Unit 9: Events and Workflow

Event Binding

The application activates the event 'Production order was released'.

This event contains the following information in its event container:. The event object for the production order.

. The user who executes the application and becomes the event creator.

Active the event linkage in order for this workflow to be started.

When the workflow starts, the necessary information is transferred from the event containerto the workflow container.

The data must be transferred from the workflow container to the task container.

The application triggered by this task at runtime eventually raises the event production order

technically complete.

Requestreleased

I

iz.t

'i::r: FlgL

ia. I:il

.-"Technically -' "

5.

Bl.-ldr-lg r"d E""*

wWF container

270 @ Copyright . All rights reserved

Page 285: SAP Workflow Bit601 en Col10

Link a Triggering Event to the workflow

Business Example:

The workflow is running correctly in the test transaction swus. You now want to define and

test the event olo_uerERrAt_cHANGED as a triggering event for the workflow.

Link your workflow actively to the or.o_uarERrAr_cnANeso event. For a workf low to react to

a published event, it must be actively linked to this event. Create the link between yourworkflow and the oLD_MArERrAt_cHANcso event for your object type. To do this, follow the

steps described in the training material in the graphics Workf low Linkage - Triggering Events,

L. Ensure that a variable, which can include the object reference from the event, exists in the

workflow container.

2. Enter the event as a triggering event in the workflow template.

3. Verify the binding from the event container to the workflow container. Transfer

_EVT-OBJ ECT and -EVT-C R EATOR.

4. Activate the event linkage and the workflow.

5. Test the event linkage in the Creafe Event test transaction swus. A work item should

appear in your Workplace.

@ Copyright . All rights reserved

Page 286: SAP Workflow Bit601 en Col10

Link a Triggering Event to the workflow

Business Example:

The workflow is running correctly in the test transaction swus. You now want to define and

test the event OI,p_I',IRTERIAL_CIIANGED as a triggering event for the workflow.

Link your workflow actively to the or,o_uR.rERrAr_cHANGsp event. For a workflow to react to

a published event, it must be actively linked to this event. Create the link between your

workflow and the oLD_MArERrAr_cHANcEo event for your object type. To do this, follow the

steps described in the training material in the graphics Workflow Linkage - Triggering Events.

1. Ensure that a variable, which can include the object reference from the event, exists in the

workflow container.

a) The element for the object reference in the workf low container has already been set to

lmport and Obligatory, so that data is transferred in the test transaction swus.

2. Enter the event as a triggering event in the workflow template.

a) On lhe Workf low Buitder - Change 'ZWF-TESTL-##' screen, choose Goto --- Baslc

data.

b) Choose the Start Events tab page and enter the following data:

Field Name Value

Object Category BO

Object Type Y*#MARA

Event of the object OLD I'IATERIAL CHANGED

c) Press ENTER.

3, Verify the binding from the event container to the workflow container. Transfer

-EVT-OBJ ECT and -EVT-CREATOR.

a) On Ihe Workf low Builder - Change 'ZWF-TESTI-##' screen, choose Ihe Binding

(Exists) pushbutton. The workflow container element &-WF-INITIATOR& is provided

with data from the event container element &-EVT-CREATOR&. The workf low

container element for your material object must receive data from the

&-EVT-OBJ ECT& event container element.

b) ln the Change Binding for Workf low dialog box, check if the binding is correct, if it is

incorrect, then correct as necessary.

c) Choose the Exlt Binding Editor pushbutton.

4. Activate the event linkage and the workflow'

272 @ Copyright , All rights reserved.

Page 287: SAP Workflow Bit601 en Col10

Lesson: Linking the Workf low and the Triggering Event

a) On lheWorkflow Builder - Change 'ZWF-TESTI-##'screen, choose the Active (Status;

lnactive) pushbutton. The event linkage is active as soon as a green dot is displayed.

b) Go back to lhe Workflow Builder -Change'ZWF-TESTI-##' screen.

c) Choose the Generate and activate runtime version pushbutton.

5. Test the event linkage in the Create Event test transaction swuE. A work item should

appear in your Workplace.

a) On the SAP Easy,Access screen, choose fools --- Business

Workftow --+ Developmerlt'-+ lJtilities ---+ Events ---, Create Event'

b) On the Create Event screen, enter the following data:

Field Name Value

Object Category BOR Object \pe

Object Type Y##l"rARA

Event OLD TVIATERIAI CHANGED

c) Choose the Obiect key pushbutton.

d) ln the Bus1001-Groupnr-## dialog box, enter r-eeo## inlhe Material field.

e) Press ENTER.

f) On the Create Event screen, choose the Create Evenf pushbutton.

g) Go back to the SAP Easy Access screen.

h) On the Buslness Workptace of BtT601-## screen, a new work item should appear in the

inbox folder of the business workplace following the event.

O Copyright , All rights reserved.

Page 288: SAP Workflow Bit601 en Col10

Unit 9: Events and Workflow

LESSON SUMMARYYou should now be able to:

. Link the workflow and the triggering event

274 O Copyright . All rights reserved.

Page 289: SAP Workflow Bit601 en Col10

Triggering Events in the Application

LESSON OVERVIEWThis lesson describes the options for triggering events in applications. lt describes the optionsfor triggering events in applications. lt also shows that the business process is implementedand linked to the triggering of an event.

Business Example

Your workflow is complete and runs smoothly in the test transaction. You have defined an

event in the Business Object Repository (BOR), and actively linked the event to the workflowas a triggering event. You now need to understand how to trigger events within an application.

For this reason, you require the following knowledge:

. An understanding of the options for triggering events in the different applications

. An understanding of using different methods to trigger events

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Trigger events in the application

Trigger Events

The possible options for triggering an event in the application are as follows:. The application triggers the event in the standard system.

. lf the application does not trigger the desired event by default, the following options are

available to trigger an event:

- Link to the writing of change documents (wizard)

- Link to status management

- Link to message control

- SAP Human Resource Module (HR) tables T779W (SAP) andf779X (customer)

- Release 4.6 onwards, connection to the open Fl interface wizard

- Release 4.6 onwards, connection to Logistic lnformation System (LlS) exceptions

wizard

. lf no connection is possible using Customizing, it is possible to trigger the event using the

function module SWE_EVENT_CREATE in the application using enhancements, forexample user exits, customer exits, BAdls, or enhancement points.

You can use the Event trace to see whether the application triggers an event by default.

Activate the event trace, and execute the required function in the SAP system. Then, view the

@ Copyright . All rights reserved ,*ffi

Page 290: SAP Workflow Bit601 en Col10

Unit 9: Events and Workflow

created events by choosing the SAP Easy Access screen, choose Tools -- Business

Workflow --+ Development ---+ Utilities ---+ Events ---+ EventTrace.

To start a workflow from a system error message line, perform the following steps:

. At runtime, a user can start a specific workflow afler a certain error has occurred. Use the

workf low wizard to generate the workf low. From the SAP Easy Access screen, choose

fools -- Buslness Workftow -- Development --+ Definition foo/s --+ Wizard. Choose Create

Workflow Message Linkage (transaction code swuv). ln 4.6,Ihe Create Workflow Message

Linkage is in the wizard folder under Definition tools.

. The consequences of using the wizard are as follows:

- Enter the work area, error number, and workflow to be started in the T1OOW table.

- The system generates the workflow, which you can then edit as you wish.

- A new icon is entered in the technical help text, which can be called when the error

message is displayed in the system.

- When an error occurs, call the technical error display and click Start Workflow.

An exception is the starting of a workflow by a change of status in the Document Management

System (DMS). The workflow template is specified directly in the definition of the document

type. To do this, run the transaction code spRo, then choose SAP Reference IMG -- Cross-

Application Components ---+ Document Management System ---+ Control Data --+ Define

Document Types ---, Define Document Siafus --+ Document Status.

Trigger Events in HR and LIS Using Business Transaction Events

Options to trigger a workflow in HR and LIS are as follows:. HR Tables

ln the T779W (SAP) andf779X (customer) tables, you can define events that are triggered

when an infotype record of an HR object type is created, changed or deleted.

. LIS exceptions

A wizard models the relationship between an LIS exception and the event for a business

object type.

. Open Fl interface

A wizard models the relationship between an open Fl event and the event for a business

object type.

The events in the area of HR refer to infotype operations. Events that publish the status

changes of HR info types are created in the infotype update. As a prerequisite for this,

activate the event creation in the control table T77SO (Entry WORKF ACTIV = X).

From the T7771BO table, the update reads for which business object type an event should be

created. The assignment is done by SAP or the user in the table T777IBO' This is used by the

SAp system to decide which event to trigger in case of an infotype or sub type or HR object

type modification.

ln the T779W (SAP) andT779X(customers) tables, in some cases the system defines the

events for standard infotypes by SAP and for custom infotypes the workflow designer or the

administrator has to def ine the events.

lf you specify a function module, you can perform additional checks. Therefore, you can

.orpur" the data from before and after the infotype maintenance and you can determine

which event to create if you change a certain field of the infotype'

276 O Copyright . All rights reserved.

Page 291: SAP Workflow Bit601 en Col10

Lesson: Triggering Events in the Application

An LIS exception could be, for example 'Orders with unscheduled waste'. While using thewizard you can view the exceptions using the input help.

To access the wizard, on the SAP Easy Access screen, choose fools --+ BuslnessWorkf low --+ Developm€fit ---+ Definition too/s --+ Events -- Event creation --+ Set Up withWizard ---+ Logistlcs Information System.

The open Fl interface contains the following events for the workflow wizard:-. Creditor master data

. Debtor master data

. Post document

. Reset or clearing

. Credit management

. Change document

To access the wizard, on the SAP Easy Access screen, choose fools --- BusinessWorkflow ---+ Developmefit ---+ Definition fools --+ Events ---+ Event creation -- Set Up withWizard -+ Business Transaction Events.

For Business Transaction Events, activate an existing event, for example, the BKPF CREATEDevent for Post document.

Hint:i The Business Transaction Events provide events in the financials application. A

list of the events is located in transaction code nlsr, under the menu path

Environmenf ---+ lnfosystem --+ Execute (FB).

A workflow may react directly to any of the named events without having totrigger another workflow event. For each Fl event, the application provides a

sample function module that you can enhance and start a workflow. Appendix 3(Triggering events in the application) contains a more-detailed description of theBuslness Transaction Events framework.

O Copyright . All rights reserved * rrrrtdG

Page 292: SAP Workflow Bit601 en Col10

Unit 9: Events and Workf low

Fl Mabriat asent

lI*rChangeln master data of a particularmaterial

To be implemenied ascustomer-defined eventcreation

Production

lnformationFrom responsible employee in

9$i!99r19 9[99 _

Figure 81: Tr gger ng Events - Change in Mater al Master (1)

Trigger Events Using the Change Document Description

Changing a f ield in the master data of a particular material should, in the simplest of cases,mean that an agent from Materials Management is informed of the change using a work item.

The changed event is defined for the ZBU51001 Material object type. This event is defined as

a triggering event for the Display material master workflow. Whenever a material is changedthe SAP standard functionality automatically logs the change in the system using a changedocument object.

Creating an event when writing change documents is implemented as a customer-definedextension. Workflow and creation of change documents are independent tools. lf you want totrigger a workflow event, you need to know the change document object.

As of Release 4.6, the system provides an overview of the change document objects, and

when an application writes a document. To access it, on the SAP Easy Access screen, choosefools --+ Business Workflow --+ Development ---+ Definition fools --+ Evenfs ---, Event

creation -, Change documents ---+ Overview or Workflow Properties.

278 @ Copyright. All rights reserved

Page 293: SAP Workflow Bit601 en Col10

Lesson: Triggering Events in the Application

Triggering Events - Change in Material Master (2)

For generating the triggering of an event, you can call a wizard. To perform this action, on theSAP Easy Access screen, choose Tools --, Buslness Workflow -+ Developmafit ---+ Definitiontools --+ Events --+ Event creation --- Set Up with Wizard ---+ Change Documents.

For creating the linkage between a workflow event and a change document object typemanually without using a wizard, on the SAP Easy Access screen, choose Iools --+ BusinessWorkflow ---+ Developmeflt ---+ Definition tools ---+ Events -> Event creation -- Changedocuments --+ Linkage.

As an example the change document object 'Material' is taken. Enter your object type and theevent also. You can set conditions to state, which changes to which fields should trigger theworkf low. Select the desired entries in the linkage table for the change documents usingtransaction code swuc. Then, go to the f ield restrictions, and use the New Entries pushbutton

to enter your desired database field and the desired entries.

Caution:lf you name more than one field, the fields are linked with AND. The fields mustthen occur in a logical unit.

From Release 4.6 onwards, you can define complex conditions for the f ield restrictions usingthe Condi tio n editor pushbutton.

With conditions, you can only refer to those fields that were changed.

lf the MAM-WRKST tablefield is changed, ...change doc. object IfrIFEnhl:

Field {Yatues) tor event llnlrage

Object type tzBrjsloolEvent . I wRKsTchanged

Trigger event for

Change I X

... then the "WRKSTChanged" event ofthe objecttype ZBUS1001 is created.A reference to the changed object fortype ZBUS1001 can then be found in theevent container.

Figure82: Trlgger ng Events - Change in Material Master (2)

O Copyright . All rights reserved

Page 294: SAP Workflow Bit601 en Col10

Unit 9: Events and Workflow

SAP Business Object Type:Production Order i

I

wI

m Publishedevents

of production order

Flgure 83: Tr ggerlng Events - Status Management

Trigger Events Using Status Management and Message Control

Status management is another option for triggering events. Event triggering using statusmanagement can be accessed on the SAP Easy Access screen, choose fools ---+ BusinessWorkflow --> Development ---+ Def inition fools -- Events ---+ Event creation + Sfafusmanagement.

To trigger events using status management, perform the following steps:

1.. Enter the required status object, for example, ORH for order header.

2. Assign the status object to a schema (F4 help).

3. Specify which event of which object type you want to trigger. lf you do not specify any

other restrictions, the event is triggered every time the status of the object changes.

4. To restrict the status, select the entry and under Status restrictions, specify the statusthat should trigger the event, for example, 10002 for released.

You will find the system status, schemata, and status objects using transaction codes es22,es12, and BSo2. Selecting the appropriate status requires knowledge of the application.Therefore, map out the status life cycle of your object and describe the different stages usingthe SAP or customer-specific status.

Next to each status, write its SAP name, number, and name of this status as you use it in yourbusiness language. This chart becomes an important decoding tool. Each status on thisdiagram can become an event in a workflow.

Trigger Events Using Message Control

To trigger events using message control, perform the following steps:

1, Create a separate output type, and declare 9 (workflow event) as the transmissionmedium.

2. Create a condition table.

3. Create an access sequence.

4. Assign the access sequence to the defined output type for a workflow event.

280 @ Copyright. All rights reserved.

Page 295: SAP Workflow Bit601 en Col10

Lesson: Triggering Events in the Application

5. Def ine condition records and declare the event.

6, Assign the output type to a procedure.

You can trigger an event using message control with NAST. Create a new message type for a

workf low event, and maintain it like every other message type. This requires knowledge ofmessage control maintenance so, use your message control experts for.

Follow the steps described in the graphic and in message control. On the SAP EasyAccessscreen, choose Iools --+ Business Workflow --+ Development --+ DefinitionIools --+ Events ---+ Event Generation ---+ Message Control .

The actual linkage with the event happens in the condition records. Select the conditionrecord with which the event should be iriggered, and choose the menu optionGoto ---+ Communication or Ihe Communication pushbutton. You can enter an object type andan event that are created when the condition occurs.

@ Copyright. All rights reserved, 28r

Page 296: SAP Workflow Bit601 en Col10

Unit 9: Events and Workflow

282 @ Copyright. Allrights reserved.

Page 297: SAP Workflow Bit601 en Col10

Trigger an Event using Change Documents

Business Example:

Your workf low reacts to the event Old_material_changed when it is generated under testconditions in the test transaction swun. However, you wani the event to be published as soon

as a user changes the o/d material number f ield in a material master in transaction vn,to2. One

option is to generate the event through change documents.

Task ITrigger lhe Old_material_changed event in the application using the creation of changedocuments option. Ensure that the application actually creates the event for a materialmaster change. ln this example, we use the connection to the creation of change documents.

L. Use awizard to activate the event Old_material_changed. Make sure that the event is

triggered when a change document is created. This only involves the change documentscreated when a material is changed. Call the corresponding wizard.

2, Follow the instructions in the wizard. Enter r"rersRrAt as the Change document object and

enter your object type Y*#MARA as the Business obiect type. Select your event

O I d_M ate r i a I _C h a n ged.

Caution:All events for your object type are displayed. Remove the Create new eventcheckbox at the end of the list.

3, Define a field restriction. To prevent your workflow starting each time a group changes a

material master, def ine a field restriction. The event should be activated if the value for theOld material number field in the Easlc datal view is changed f rom its former value to thevalue e#*. Refer to the Mana-ersut f ield in the def inition for field restrictions.

Task 2

Test the event trigger and the event linkage together.

1. Change your material in transaction MMO2. Call transaction mrtoz, enter your material r-BBD##, and select the Baslc Datal view. Change the va lue in the O/d material number fieldto c**. Then call the workplace of the user who implemented the change. A work item

appears here. Execute this work item. The change documents for your material are now

displayed.

2. Display your published event in the event trace.

@ Copyright. All rights reserved

Page 298: SAP Workflow Bit601 en Col10

Trigger an Event using Change Documents

Business Example:

Your workf low reacts to the event Old_material-changed when it is generated under testconditions in the test transaction swuB. However, you want the event to be published as soon

as a user changes the o/d material numberfield in a material master in transaction ro4o2. One

option is to generate the event through change documents.

Task ITrigger lhe Old_material_changed event in the application using the creation of change

documents option. Ensure that the application actually creates the event for a material

master change. ln this example, we use the connection to the creation of change documents.

L. Use a wizard to activate the event Old_material-changed. Make sure that the event is

triggered when a change document is created. This only involves the change documentscreated when a material is changed. Callthe correspondingwizard.

a) On the SAP EasyAccess screen, choose fools -' Buslness

Workflow --+ Development --+ Def inition Ioois -- Events --- Event creation --' Set Up with

Wizard -- Change Documents.

b) Choose the Contlnue pushbutton in the Sef up event creation (change document)dialog box.

2. Followthe instructions inthe wizard. Entert{ArsRrArJas lheChangedocument obiectand

enter your object type t##vana as the Buslness obiect type. Select your event

Ol d_M ate ri a l_Ch an ged.

Caution:All events for your object type are displayed. Remove lhe Create new event

checkbox at the end of the list.

ln the Set up event creation (change document) dialog box, enter Y##MARA in the

Object Type field.

Press ENTER.

All events for this object type are displayed.

Deselect the Extend obiect type with event checkbox.

ln the Events pane, choose the row with OLD-MATERIAL-CHANGED in the Event field

Choose the Contlnue pushbutton.

Entert"tateriar in the Change doc. obiectfield,

a)

b)

c)

d)

e)

0g)

284 O Copyright. All rights reserved

Page 299: SAP Workflow Bit601 en Col10

Lesson: Triggering Events in the Application

h) Press ENTER.

i) Select the Fvent upon change radio button inlhe Date/time of event pane.

j) Choose the Contlnue pushbution.

k) Check all the entries you included in the wizard for creating the event.

l) Choose the Complete pushbutton.

3, Def ine a field restriction. To prevent your workflow starting each time a group changes a

material master, define a field restriction. The event should be activated if the value for theOId material number f ield in the Baslc datal view is changed f rom its former value to thevalue e##. Refer to the Mana-ersut field in the definition for field restrictions.

a) On the SAP Easy Access screen, choose Iools -' EuslnessWorkflow ---> Development - Definition fools -+ Events - Event creation ---+ Changedocuments ---+ Linkage.

b) OnlheChangeView"EventsforChangeDocument":Overviewscreen,choosetherowwiIhY##MARA in the Business Obj. Type field and OLD_MATERIAL_CHANGED in theEvent field.

c) ln the Dialog Structure pane, double-click Field Restrictions.

d) On lhe Change View " Field Restrlctions " : Overview screen, enter the following data:

Field Name Entry

Table IVIAR,A

Field Name BISMT

OId Value *

New Value c##

Choose Save.

Go back to the SAP Easy Access screen.

Task 2

Test the event trigger and the event linkage together.

1. Change your material in transaction MMO2, Call transaction l,DI02, enter your material r-eeo**, and select the Baslc Datal view. Change the value in the O/d material number fieldto c##. Then call the workplace of the user who implemented the change. A work item

appears here. Execute this work item. The change documents for your material are nowdisplayed.

a) On the SAP EasyAccess screen, run the transaction code m.loz.

b) On lhe Change Material (lnitial Screen), enter t-eep#* in the Material field.

c) Choose the Se/ecf view(s) pushbutton.

d) ln the Se/ect View(s) dialog box, choose Basic Data J in the View field.

e) Choose Continue.

e)

f)

@ Copyright, All rights reserved.

Page 300: SAP Workflow Bit601 en Col10

Unit 9: Events and Workflow

f) On the Change MaterialT-BBD## (semi-finished product) screen, enter e*# in the O/dmaterial number field.

g) Choose Save.

h) Go back to the SAP Easy Access screen.

i) On the Buslness Workplace of 8lT601-## screen, choose Inbox and choose Workflow.

A work item appears, execute the work item.

2. Display your published event in the event trace.

a) On the SAP EasyAccess screen, choose fools --+ BusinessWorkflow --+ Developm€Dt ---+ Utilities --+ Eyents -+ Event Trace -- Display Event Trace.

b) On the Display Event Trace screen, enter v*#l'rana in the 'Creaf or' object type field.

c) Choose Execute.

Hint:

', . Activate the event trace using, Iools -- BuslnessWorkflow ---+ Development -* IJtitities --+ Events -+ Event Trace - SwitchEvent Trace On.

286 O Copyright . All rights reserved

Page 301: SAP Workflow Bit601 en Col10

Lesson: Triggering Events in the Application

,,,,,,11t',,, .',, LESSON SUMMARY' ' You should now be able to:

. Trigger events in the application

@ Copyright. All rights reserved.

Page 302: SAP Workflow Bit601 en Col10

Defining Additional Start Conditions and Usingthe Event Queue

LESSON OVERVIEWEvents that are generated in applications start workflows. You can specify that events aregenerated only under certain condrtions. However, if an event is published in the system, all

actively linked workflows are started.

This lesson describes the check function modules that are triggered when a workflow is foundas a receiver of an event. ln the check function module, you can store conditions thatdetermine whether an actively linked workflow should actually be started.

Business Example

Your workflow is complete and the connection with the triggering event Change materialmaster is working smoothly. You can now ensure that the workflow only starts if the affectedmaterial is from the chemistry industry. This is possible using additional start conditions thatare evaluated when the event takes place. For this reason, you require the followingknowledge:

. An understanding of additional start conditions

. An understanding of the events used as terminating events

. An understanding of the event queue

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Define additional start conditions and use the event queue

Additional Start Conditions

288 @ Copyright All rights reserved.

Page 303: SAP Workflow Bit601 en Col10

Lesson: Defining Additional Start Conditions and Using the Event Queue

Events

TRIGGERING an event can be linkedtoconditions.

Additional starl conditions for the workflow are only createdafter the workflow is found as the event receiver forthe triggering event.

The results of a condition request willdetemine whether or notThe workflow starts.

Figure 84: Addltional Start Conditions for Workf lows (1)

:-___...._--- -_-'--'i

I Aetively Ii r:-r-- r I

Additional start conditions for the workflow are only created after the workflow is found as theevent receiver for the trigering event. The results of a condition request will determinewhether or not the workflow starts.

Triggering an event can be linked to specific conditions. For example, the Changed materialevent is only triggered using the creation of change document, if the change occurs in the Oldmaterial number field.

A workflow starts when an event is triggered and the event manager has found the workflowas the event receiver. Work items are completed when the event is defined as the terminatingevent of the step. However, additional start conditions can deactivate this automatic action. A

function module is used to create start conditions.

As of Release 4.6, you can generate this function module for simple conditions. You canmaintain these conditions using the Condition Editor.

@ Copyright. All rights reserved 289

Page 304: SAP Workflow Bit601 en Col10

Unit 9: Events and Workflow

Additional Start Conditions for Workflows (2)

ln Release 4.68, you define this start condition, on the SAP Easy Access screen, choose

fools + Business Workflow --+ Development --+ Definition lools --+ Events -+ Event

Linkages ---+ Workflow Start Conditions (SWB-COND)

To work with start conditions:

. You can use your object type or workflow to search for the event linkage for which you

want to define an additional start condition.

. Choose Create --+ Event, and def ine the required condition in the condition editor. Choose

the Enfer pushbutton to save the start condition.

. Do not forget to activate the start condition.

As of Releas e 4.6C, you can also def ine the start condition in the basic data of the workf low

template when you specify the triggering event. You are then, immediately in the linkage for

which you want to define an additional start condition'

The system generates a check function module and enters this in the linkage table.

Effects on the Event Linkage Table

290 @ Copyright , All rights reserved

Page 305: SAP Workflow Bit601 en Col10

Lesson: Defining Additional Start Conditions and Using the Event Queue

"WIWtwaaWt

Chtltlc Wy lnyaoc ,y9. Lior.sat't A9,tt :-rs,." )Glc/8J&l

.''-'.''''..

kr* Plba (iar R@l

Figure 86: Effect on Type Linkage Table

This check functionmodule evaluales the

start condition atruntime.

A green light in the start condition or the triggering event in the workf low sets the type linkageto active.

When you define a triggering event in a workflow or when you define a terminating event in a

task, the system creates an entry in the SWETYPECOU linkage table.

To display the triggering events, on the SAP Easy Access screen, choose Tools -- Business

Workflow ---+ Development ---+ Utilities ---+ Events --+ Type Linkages.

To display the terminating events, on the SAP Easy Access screen, choose fools -+ BusinessWorkflow ---, Development ---+ Utiilties ---+ Events --+ lnstance Linkages.

ln Releases before 4.6C, on the SAP Easy Access screen, choose fools --+ BusinessWorkflow ---+ Developmefit --+ Utilities -+ Events.

Type linkages start terminating events as well as triggering events.

You can tell whether an event is a triggering event or a terminating event from the receivertype and the global indicator. For a triggering event, the receiver type is a workflow and theglobal indicator is selected in the details display. For a terminating event, the receiver type is a

work item and the Global flag is not set.

Caution:The Global indicator cannot be maintained manually. As of Release 4.6C, it is nolonger included in the maintenance mode.

Events Used at Terminating Events

Certain events can also be terminating events. To work with terminating events you needto know the following:. ln the task definition, enter the event as the terminating event for a task.

@ Copyright All rights reserved. 29r

Page 306: SAP Workflow Bit601 en Col10

Unit 9: Events and Workflow

' Terminating events describe the processing results from the application that is started bythe task.

' ln binding, the terminating event parameter can return information to the task container.

. A task can have more than one terminating event.

A task based on an asynchronous method requires at least one terminating event. Otherwisethe corresponding work item cannot be terminated at runtime.

For each terminating event you have to specify the following three parameters in the taskbinding:

. Object Type: Use the same object type as used for the method.

. Event: Use the input help to ensure correct spelling.

. Element of the task container that contains the object reference, the variable_Wl_Object_lD.

lf you transfer the object reference, the system would know at runtime which work item of atask should be terminated.

lf the method that is the basis of the task is a synchronous method, the terminating event isonly evaluated in addition to the normal end of the method. This means that if a user executesthe work item and their processing of the object does not create the terminating event, thework item is completed anyway. The method was correctly executed.

lf a work item should only be completed by a particular event, the method up to and includingRelease 4.6C must be asynchronous.

ln Release 6.20, you can agree additional conditions for a step, which are checked at the endof the method execution.

The Event Queue

To use the event queue you need to know the following:. What is the event queue?

- An event does not start a workflow immediately. lnstead, it buffers the workflow start ina queue.

- The queue is processed in parts and this rectifies the event processing.

. What you should do?

- Activate the event queue.

- Set the basic data.

- Configure the background job and the event creation.

- Specify the default behavior of linkages if an error occurs during delivery.

- Activate the workflow linkage or task linkage for the queue.

The event queue releases the events buffered in the queue for subsequent events processing.

Activate the queue and schedule the background job so that the event queue can be used. Toactivate the event queue, On the SAP Easy Access screen, choose Tools ---+ BuslnessWorkflow ---+ Development ---+ Administration ---+ Event Manager ---+ Event Queue(SWEQADM) ---+ Tab page activation.

292 @ Copyright. All rights reserved.

Page 307: SAP Workflow Bit601 en Col10

Lesson: Defining Additional Start Conditions and Using the Event Queue

Also, release the workflow in the linkage table entry or enable the task explicitly for the queue

(indicator Enable event queue).

Any errors that occur when the event is being created cause a mail to be sent to the queue

administrator. A system-wide default value can be specified (which in turn can be individuallyredefined on each linkage) for the behavior of event linkages when errors occur.

The possible settings are as follows:. Deactivation of the linkage

The event linkage is deactivated, The event cannotnot evaluated for future events.

be processed again and the linkage is

. ldentify linkage as incorrect

Event is in the queue with the status waiting due to error. The event in question can be

created again (manually) and place all future events in the queue.

. Do not change linkage

The event is entered in the queue with the status waiting due to error status and can be

created again (manually). Future events are processed as normal.

Caution:This setting can cause many mails to be sent to the administrator if errors occur.

@ Copyright , All rights reserved 293

Page 308: SAP Workflow Bit601 en Col10

Unit 9: Events and Workf low

294 O Copyright . All rights reserved

Page 309: SAP Workflow Bit601 en Col10

Define an Additional Start Condition

Business Example

Using an additional start condition, you can ensure that your workf low only starts if the objectcurrently processed has specific characteristics. You want to execute your workflow only ifthe Basic materialf ield contains the value cn25.

Task 1

Create an additional start condition. Your workflow should only start if the value cR25 appearsin the Easlc materialattribute (Baslc data 2) for the material,

L. Create an additional start condition in the Workflow Builder. Condition: Attribute Basicmaterial must be cR25.

Task 2

Test your workf low again. Check the case in which the workflow starts and also the case inwhich the workflow does not start but the check function module ends with an exception.

1. Test the case in which your workf low starts because of a change to the material master.Use transaction m,toz to delete the value G## in your material T-BBD## (## stands foryour group number). Change your material T-BBD## again.

To trigger your event again, set the value cnes for basic material in Baslc Data 2 and setthe value c## for the old material number in Basic Data L Save the material and call theWorkplace of the user who implemented the change. A work item appears here.

2. Test the case in which your workflow does not start because of a change to the materialmaster. Change the material again to a value other than ct€5 for the Baslc materialf ield in

the Basic data 2 view. First delete the value e##, and then set it again, so that the event is

triggered.

3. ln the event trace, check that your event was triggered but that your workflow did not startbecause of the check function module.

@ Copyright . All rights reserved

Page 310: SAP Workflow Bit601 en Col10

Define an Additional Start Gondition

Business Example

Using an additional start condition, you can ensure that your workflow only starts if the objectcurrently processed has specific characteristics. You want to execute your workflow only if

the Basic materialf ield contains the value cn2s.

Task 1

Create an additional start condition. Your workflow should only start if the value cR25 appears

in the Baslc materialattribute (Baslc data 2) for the material.

L. Create an additional start condition in the Workflow Builder. Condition: Attribute Easic

materialmust be cR25.

a) On the SAP Easy Access screen, run the transaction code swon. lf your workf low is not

displayed, find it using the zwf * abbreviation.

b) On lhe Workftow Buitder - Change 'ZWF_TESTI-##'screen, choose Goto ---+ Baslc

Data.

c) On the Start Events tab page, choose the Start condition pushbutton.

d) On the Change Condition: Workf low start WSXXXXXXXXX dialog box, choose Basic

materialin the Expression I field.

e) ln the Operators field, choose =.

f) Enter cnzs in the Constant field.

g) Press ENTER.

h) Exit the condition editor by choosing the Transfer condition '

i) Go back lolheWorkflow Builder - Change'ZWF-TESTI-##'screen.

j) Choose lhe Generate and activate runtime version pushbutton'

k) Go back to the SAP Easy Access screen.

Task 2

Test your workflow again. Check the case in which the workflow starts and also the case in

which the workflow does not start but the check function module ends with an exception.

L. Test the case in which your workflow starts because of a change to the material master.

Use transaction maoz to delete the value G## in your material T'BBD## (## stands for

your group number). Change your material T'BBD## again.

296 @ Copyright , All rights reserved

Page 311: SAP Workflow Bit601 en Col10

Lesson: Def ining Addltional Start Conditions and Using the Event Queue

To trigger your event again, set the value cR25 for basic material in Baslc Data 2 and setthe value e## for the old material number in Basic Data 1. Save the material and call theWorkplace of the user who implemented the change. A work item appears here.

a) Run the transaction code urlo2.

b) On the Change Material (lnitialScreen), enter I-BBD## in the Material field.

c) Press ENTER.

d) Choose the Se/ect view(s) pushbutton.

e) ln the Se/ect View(s) dialog box, choose Basic Data I in the View field.

f) Choose lhe Continue pushbutton.

g) On the Change Material T-BBD## (Semi-finished product) screen, delete the value c##in the O/d material number field.

h) Choose Save.

i) On the Change Material (lnitial Screen), choose the Se/ect view(s) pushbutton.

j) ln the Se/ect View(s) dialog box, choose Basic Data I in the View field.

k) Choose IheContinue pushbutton.

l) On the Change MaterialT-BBD## (Semi-finished product) screen, enter e## in the O/d

material number field.

m) Choose Save.

n) On lhe Change Material (lnitialScreen), choose the Se/ect view(s) pushbutton.

o) ln the Se/ect View(s) dialog box, choose Basic Data 2 in the View field.

p) Choose theContinue pushbutton.

q) On the Change Material T-BBD## (Semi-f inished product) screen, enter cR25 in theBasic materialfield.

r) Choose Save.

s) Run the transaction code sewp. A work item is displayed.

2. Test the case in which your workf low does not start because of a change to the materialmaster. Change the material again to a value other than cR25 for the Baslc materialf ield in

the Baslc data 2 view. First delete the value c##, and then set it again, so that the event is

triggered.

a) Run the transaction code m.to2.

b) On lhe Change Material (lnitial Screen), enter r-eeo## in the Material field.

c) Press ENTER.

d) Choose the Se/ect view(s) pushbutton.

e) ln the Se/ect View(s) dialog box, choose Basic Data 2 in the View field.

f) On the Change Material T-BBD## (Semi-f inished product) screen, enter cnzo in theBasic materialfield.

@ Copyright. All rights reserved.

Page 312: SAP Workflow Bit601 en Col10

Unit 9: Events and Workf low

g) Choose Save.

h) On the Change Material (lnitialScreen), choose the Se/ect view(s) pushbutton.

i) ln the Se/ect View(s) dialog box, choose Basic Data I in the View field.

j) On the Change Material T-BBD## (Semi-finished product) screen, delete the value e##

in the O/d material number tield.

k) Choose Save.

l) On the Change Material (lnitialscreen), choose the Se/ect view(s) pushbutton.

m) ln the se/ect view(s) dialog box, choose Basic Data I in the view field.

n) On the Change MaterialT-BBD## (Semi-finished product) screen, enter c## in the O/d

material number field.

o) Choose Save.

3. ln the event trace, check that your event was triggered but that your workflow did not start

because of the check function module.

a) On the SAP EasyAccess screen, choose Tools ---+ Buslness

Workflow ---+ Development ---+ lJtilities ---+ Events --+ Event Trace -- Display Event Trace.

b) OnlheDisptayEventTracescreen,enterv*#ueneinthe'Creator'obiecttypefield.

c) Choose Execute.

d) Your event is displayed, you can see the message: Check function moduf e

termj-nated with an excePtion.

298 @ Copyright. Allrights reserved.

Page 313: SAP Workflow Bit601 en Col10

Lesson: Def ining Additional Start Conditions and Using the Event Queue

ii',:i ir',...,: LESSON SUMMARYi'ir'- You should now be able to:

. Def ine additional start conditions and use the event queue

@ Copyright . All rights reserved

Page 314: SAP Workflow Bit601 en Col10

Testing in the Event Environment and DuringWorkf low I mplementation

LESSON OVERVIEWThis lesson explains how to test in the event processing environment. lt also describes thetest options available if a workflow scenario is not processed as expected.

Business Example

You think you have triggered an event; but, in fact, your workflow has not started. The workitems have not arrived in the lnbox of the responsible agents. For this reason, you require thefollowing knowledge:

. An understanding of test options in the event environment

. An understanding of the procedure for testing workflows

. An understanding of the test diagnosis tool

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Test in the event environment and during workflow implementation

Test Options in the Event Environment

You can perform the following checks in the event environment:. Check whether the event link is error free. To simulate the event, use the transaction code

SWUO.

. Check whether a workflow starts and finishes correctly. To create an event, use thetransaction code swun.

. Check whether an event was actually created by an application. To trace an event, use thetransaction code swnl.

To simulate an event, on the SAP Easy Access screen, choose Tools ---+ BusinessWorkflow ---+ Development --+ Utilities ---+ Events --+ Simulate event.

The function searches for and checks all event linkages that the system enters. The resultinforms you whether the workflow would start if the event were to take place. lf not, thefunction gives you pointers to solve the problem. The tested event is not really triggered.

To create an event, on the SAP Easy Access screen, choose Tools -- BuslnessWorkf low --+ Development --+ Utilities - Events --- Create event.

You can use this test function io trigger an event in a real situation in the system, withoutinvolving a business application. The event is created and it starts each linked workflow

300 O Copyright. All rights reserved.

Page 315: SAP Workflow Bit601 en Col10

Lesson: Testing in the Event Environment and During Workflow lmplementation

actively or terminates each waiting item. You can now test each event linkage even if theapplication has not created the required event.

For the event trace, on the SAP Easy Access screen, choose lools -+ BuslnessWorkflow ---+ Developmeflt ---+ Utiilties ---+ Events -- Event Trace.

Use the transaction code SWELS to activate or deactivate the event trace. lf the event trace is

activated, it lists all events that take place in the system. lt also logs the receiver that hasreacted to the event. Deactivate the event trace in a productive system because it impairssystem performance. lt is purely a test tool and can be restricted to particular object typesand events for activation.

Workflow Test

The potential problems and possible solutions (1) when testing a workflow are as follows:

Table 3: The following table displays some technical issues and possible solutions:

The event trace contains an entry for each event published in the system, regardless ofwhether or not it starts a workflow or completes a task. lf you are expecting an event after youimplement an action but you cannot find this event in the trace, then the application has nottriggered it.

Check the settings or the source code if you have initiated the event trigger. lf you are waitingfor a standard event, check whether you perhaps first must initiate the event; for example,compare events in Fl using Business Transaction Events.

An event starts all actively linked workflows. Depending on the agent assignment, a user may,

therefore, receive more than one work item in the system following an action, which can be

irritating.

ln this case, use the event trace to check the events that were triggered and the workflowsthat have started. Details about errors that occurred are contained in the technical workflowlog. The workflow administrators also receive information about errors.

The potential problems and possible solutions (2) when testing a workflow are as follows:

Table 4: The following tables displays some issues a user might face:

Problem Solution

An event-controlled workflow does not start. Check the event trace to see whether theevent was triggered. lf it was not triggered,check how the event should be triggered.

A workflow is triggered repeatedly. Check the event trace to see how many, andwhich events have been triggered.

A workflow becomes corrupt. Check the technical workflow log.

Problem Solution

Work items are not in the workplace of theexpected user.

Search for the created work item, check theagent assignment in the workflow step, and

check the agent assignment in the task.

A user finds work items that the user doesnot expect.

Check the agent assignment in the workflowstep and task.

@ Copyright. All rights reserved. 301

Page 316: SAP Workflow Bit601 en Col10

Unit 9: Events and Workf low

Having started a workflow or executed a work item, perform the following steps:

1. Display the workplace and open the Outbox folder. The work items you edited or theworkflows you start are displayed in this Outbox folder, and from there you can also go tothe corresponding log.

2. Use the reporting transaction code swr1, or on the SAP Easy Access screen, choose

lJtilities ---+ Work item --- Se/ectlon. You can also use the transaction code swr2_FREQ, or

on the SAP Easy Access screen, choose Reporting ---+ Work ltem Analysis --- Work ltems forIasks to search for a work item.

You can use different search criteria, such as number of the workf low template, date or

time generated, status, and so on.

3. The workflow is started by an event. Search for the event in the event trace. The work item

lD is displayed in the detail screen. You can use this lD as a search criterion in the workitem selection.

To search for workflows for a work item, perform the following step:

1. Display the work item and choose Extras ---+ Technical Data. The key for the workflowtemplate and the tasks that have been started are displayed.

Test procedures for new or changed workflows

To test a new or changed workflow you can use the following procedures:

. Test procedures for New or Changed Workf lows are:

- Test business objects in the Business Object Repository (BOR).

- Test tasks and workflows using the diagnosis tool.

- Test tasks in test transaction swus.

- lf you are using rules then test the rule resolution by simulating it.

- lf you are using complex conditions: Test the conditions with simulation in the condition

editor.

- Test event linkages using test transactions swu0 and swun.

- Test whether the event was triggered.

- Test the workflow with productive authorizations.

The BOR enables you to test the methods of an object type or the attribute resolution of

objects. You can set an ABAP breakpoint in methods to test the process. Similar to aprogram, the diagnosis tool allows you to check the consistency of workflows.

You can test rules as wellas complex conditions using a simulation tool. Use a simulation to

test event linkages or create the event directly. The event trace displays whether an

application actually triggers a required event.

Workflow developers have more comprehensive authorization than the workflow users.

Before you start the workflow productively, we recommend that you test the workf low using

the authorization profiles that is used later in the productive workflow.

302 @ Copyright. All rights reserved.

Page 317: SAP Workflow Bit601 en Col10

Lesson: Testing in the Event Environment and During Workflow lmplementation

The Test Diagnosis Tool

]:A]:€'{8Q:Cl{8.!8 &,g0e:6]F].i*Sh ..r'::.:i.

l,::ll,i Figure 87: Testing a Workf low - Diagnosis Tool

On the Diagnosis Transaction screen, enter the task or the workf low you want to analyze. You

can then choose between four test options or you can execute all options consecutively. ln thelower part of the screen, the system Iists the last 10 tasks that you can process. The first testoption checks the basic Customizing of the Workflow Engine.

lf a workflow is running perfectly but problems suddenly appear, check the settings of thebasic Customizing. Start the second and third test options if a workflow does not start(second test option) or if it does start but steps cannot be executed (third test option).

Caution:The test options do not solve the problems. lnstead, they outline the transactionsthat you must call to help you solve the problems as quickly as possible.

The fourth option jumps to test transaction code swuD, which goes to a test environment thatoutlines allthe important test transactions.

LESSON SUMMARYYou should now be able to:

. Test in the event environment and during workflow implementation

@ Copyright . All rights reserved. 303

Page 318: SAP Workflow Bit601 en Col10

Unit 9: Events and Workflow

304 @ Copyright. All rights reserved

Page 319: SAP Workflow Bit601 en Col10

2.

1. An event in the Business Object Repository can be identified by its technical name and the

Choose the correct answer.

( n object type

I B message

I C prerequisite

An implementation for events is stored in the business object type.

Determine whether this statement is true or false.

True

False

3. When a workflow starts, the necessary information is transferred from the event containerto the workflow container.

Determine whether this statement is true or false.

True

False

!1 Applications trigger events and do not know who receives the events./ ' D"t"r.ine whether this statement is true or false.

Tw

VT

TZ

True

False {ut.a

@ Copyright . All rights reserved. 305

Page 320: SAP Workflow Bit601 en Col10

Unit 9: Learning Assessment

5. Linkages need to be _ so that a workflow starts when an event is published.

Choose the correct answer.

(n Activated

B Deactivated

I c Stopped

6. The object reference in the workflow that is provided with data from the event must have

the import property.

Determine whether fhls stateme nt is true or false.

fl"rrue

I False

7. Triggering events can, for example, be linked to extra conditions when using change

documents.

Determine whether fhls stateme nt is true or false'

-''.L]''Truell

n Fatsell

B. For each terminating event, which of the following parameters do you have to specify in

the task binding?

Choose the correct answer.

n A Eventll

n B wl obiect lD{l

f C Export parameters

I D Object type

9. A _ starts when the event manager has found the workflow as the event receiver.

Choose the correct answer.

l-l n Methodll

I B step

ffc workflow

306 @ Copyright . All rights reserved.

Page 321: SAP Workflow Bit601 en Col10

Unit 9: Learning Assessment

10. The workflows and items that are waiting for the event are contained in the event linkagetable, from which values are read when an event is triggered.

Determine whether this sfateme nt is true or false.

True

False

11. To define the event as a triggering event for a workflow, you enter it in the basic data of theworkflow template.

Determine whether thls stateme nt is true or f alse.

fl "rrr"-1_J

Tl Fatsett

\y'nOOitional start conditions Iead to an entry being made in the type linkage table.

Determine whether this statement is true or false.

l-l Ttre =f'r (r,1t./

frrase t

13. Additional start conditions are not evaluated until an event has taken place and a linkagehas been found.

Determine whether this statement is true or false.

True

False

V4. lf a workf low becomes corrupt, which of the following options should you choose?

Choose the correct answer.

I n Check the technical workflow log IffA Check the event trace log

I C Check the agents assignment in the workflow step

15. You can use the Simulate event function to determine which workf lows react to whichevents and whether the linkage has been correctly defined.

Determine whether this statement is true or false.

True

False

{

T

W!

@ Copyright . All rights reserved.

Page 322: SAP Workflow Bit601 en Col10

Unit 9: Learning Assessment

16. All events are recorded in the event trace as long as this is activated. In the productivesystem this must be deactivated.

Determine whether this statement is true or false.

I False

308 @ Copyright. All rights reserved.

Page 323: SAP Workflow Bit601 en Col10

An event in the Business Object Repository can be identified by its technical name and the

Choose the correct answer.

A object type

B message

C prerequisite

An implementation for events is stored in the business object type.

Determine whether this statement is true or false.

True

False

Events are only defined in the Business Object Repository. There is no program codinginvolved in the definition.

3. When a workflow starts, the necessary information is transferred from the event containerto the workflow container.

Determine whether this stateme nt is true or false.

True

False

4. Applications trigger events and do not know who receives the events.

Determine whether thls stateme nt is true or false.

True

False

ications publish an event without knowing whether a workflow or a work item existsare waiting for the event.

ETT

2.

TE

En

ETApplthat

@ Copyright . All rrghts reserved 309FFFlrLif .t r"zWo

Page 324: SAP Workflow Bit601 en Col10

Unit 9: Learning Assessment - Answers

5.Linkagesneedtobe-SothataworkfloWstartswhenaneventispublished.Choose the correct answer.

A Activated

B Deactivated

C Stopped

6. The object reference in the workflow that is provided with data from the event must have

the import property.

Determine whether this statement is true or false.

True

False

7. Triggering events can, for example, be linked to extra conditions when using changedocuments.

Determine whether thls stateme nt is true or false.

True

False

B. For each terminating event, which of the following parameters do you have to specify in

the task binding?

Choose the correct answer.

n A Eventll

E B _wl-object-lD

! C Export parameters

! D Object type

g. A _ starts when the event manager has found the workflow as the event receiver.

Choose the correct answer.

A Method

B Step

C Workflow

EII

ET

ET

TTE

310 @ Copyright . All rights reserved.

Page 325: SAP Workflow Bit601 en Col10

Unit 9: Learning Assessment - Answers

10. The workflows and items that are waiting for the event are contained in the event linkagetable, from which values are read when an event is triggered.

Determine whether thls stateme nt is true or f alse.

True

False

type linkage table creates the connection between event creators and receivers.

11. To define the event as a triggering event for a workflow, you enter it in the basic data of theworkflow template.

Determine whether thls stateme nt is true or f alse.

True

False

12. Additional start conditions lead to an entry being made in the type linkage table.

Determine whether this sfateme nt is true or false.

True

False

Additional start conditions are realized using check function modules, which are enteredin the required position in the type linkage table.

13. Additional start conditions are not evaluated until an event has taken place and a linkagehas been found.

Determine whether this statement is true or false.

True

False

14.ll a workflow becomes corrupt, which of the following options should you choose?

Choose the correct answer.

I n Check the technicalworkflow log

I B Check the event trace log

I C Check the agents assignment in the workflow step

ErThe

ET

ET

EI

@ Copyright. All rights reserved 311

Page 326: SAP Workflow Bit601 en Col10

Unit 9: Learning Assessment - Answers

15. You can use the Simulate event function to determine which workflows react to which

events and whether the linkage has been correctly def ined.

Determine whether this statement is true or false.

True

False

16. All events are recorded in the event trace as long as this is activated. ln the productive

system this must be deactivated.

Determine whether this stateme nt is true or false.

True

False

ET

ET

312 @ Copyright. All rights reserved,

Page 327: SAP Workflow Bit601 en Col10

Lesson 1

Using Step Type Fork and Multiline Attributes

Exercise 22:Use the Step Type Fork

Lesson 2

Using Step Type Loop, Form Processing, Document from Template, and Conditions in the Workflow326

Step

Exercise 23: Use the Step Type for Loops

Exercise 24: Use the Step Type Document from Template

Lesson 3

Using Step Type Block and Switch

fxercise 25: Use the Step Type Block

Exercise 26: Use the Step Type Multiple Condition

314

32t

333

341

347

351

357

UNIT OBJECTIVES

. Use the step type fork and multiline attributes

. Use step type Loop

. Use step type Form processing

. Use step type Document from Template

. Use conditions in the workflow step

. Use step type Block

. Use the SWITCH construct in step type Multiple Condition

@ Copyright. All rights reserved. 313

Page 328: SAP Workflow Bit601 en Col10

Using Step Type Fork and Multiline Attributes

LESSON OVERVIEW

This lesson introduces the concept of the step type fork, which enables business processsteps to run in parallel, instead of in sequence, and explains how to use elements with morethan one line in the workflow.

Business Example

ln one of your business process scenarios, which a workflow controls, a material master ischanged as a part of the work item execution. You now want to ensure that the systemterminates the process if someone makes a change in the application without using theworkflow. You also need to send orders for a material to the relevant clerks because problems

have occurred with the material. For this reason, you require the following knowledge:

. An undersianding of the step type fork

. An understanding of processing multiline attributes of an object type

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Use the step type fork and multiline attributes

Step Type Fork

Wotkflot Edil let - era*ga a3l-qre-tlata

DdZt "a: d A

F gure BB: Step Type Fork

3r4 @ Copyright. All rights reserved

Page 329: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Fork and Multiline Attributes

ln the fork def inition, specify the number of parallel branches to be generated and thenumbers of branches, which must be processed to complete the fork.

For example, the figure displays a fork with two branches, one of which must be processed forthe fork to be compleied. The first branch defines the business process logic. An agent has tocheck a master data change in this workflow. lf a negative decision is made, the person whomade the change must implement the correction.

The second branch contains the Wait' step type. The workflow may be attached to an areadue to a vacation, for example, and someone in the company, but outside the workflow,withdraws the change. ln this case, the whole process becomes obsolete and must beterminated.

Changing a customer order triggers an event in the system. The second branch of the forkwaits for this event. The event completes the step. This completes the fork and all the existingwork items from the first branch are set to logically deleted. This completes the workflow.

Reaction of the Workflow lnstance to Terminating Events

Figure 89: Fork Def n tion and Step Type Wait

. Working with the Step Type Fork, answer the following questions :

- How many branches?

- How many are required for end?

. Working with the Step Type wait, answer the following questions:

Which event from which object type

- On which object (reference in container element)

As of SAP R/3 Enterprise, the reaction of the workflow instance to terminating events was an

additional function.

The workflow instance may react to events. You implement the setting in the basic data of theworkflow.

O Copyright , All rights reserved. 315

Page 330: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

The workflow instance in general may react to the event in the following ways:. Workflow terminates, with or without subsequent restarting,

. The system evaluates the step conditions (preconditions and postconditions).

. The system determines the agents of all the active work items again.

When defining a Wait step type, provide the following inputs:. Which event from which object type?

. On which object (reference in container element)?

The input that is given to the step type fork are as follows:. How many branches?

. How many required for end?

Processing Multiline Elements

Database - Business Objects

Purchase order 450004566

Purchase order 450004570

Purchase order 450004575

Objects are entered in thePurchaseOrder attribute of theBUS1001 material master object type

attributein BUSl001

Definition:Virtual

Multiline

Business object type: BUS1001in the Business Object Repository

Purchase orders refer to a specific material, The business object type material has a PurchaseOrder attribute that is defined as being multiline and virtual. At runtime, the relevant objecttype program determines which purchase orders will be made available in this attribute.

:r.'l Figure 90: Processrng Mu tiline Elements Startlng Positton

316 O Copyright All rights reserved.

Page 331: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Fork and Multiline Attributes

Processing the Workflow Step

,.l..:r:il]] 5 Urr" 91: Processing Multiline Elements - Processing the workf low step

The following is an example of processing multiline elements:. The workflow starts for a material. The workflow should display the purchase orders for

the material.

. A multiline element that will be filled with the purchase order values in a containeroperation must exist in the workflow container.

. You enter the required task for processing the purchase orders in the workflow step. The

task is def ined like any other normal task.

. The workflow system executes the task repeatedly until all the purchase orders for thematerial have been processed.

. For each purchase order, a work item is created which you can display. lf 1,500 purchaseorders exist in the database for the material, 1,500 work items are created in theWorkplace of the user. Consequently, multiline elements are often processed in thebackground (although not in our example).

Miscellaneous Tab Page and Binding

O Copyright. All rights reserved 3t7

Page 332: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

inli"""rr*** tao Il-J

:'i F gure 92: Process ng Multiline Elements - Nliscellaneous Tab Page and Binding

To ensure that the task entered is executed repeatedly until entries exist in the element; go to

the Miscetlaneous tab page in the workflow step. Enter the element (which can refer to more

than one value at runtime) from the container in the dynamic parallel processing for multilineelement frame. A new element automatically appears in ihe container. ln our example, this is

Purchase orders [&_WF_PARFOREACH-INDEX&]. This element is assigned to the task in the

binding.

Multiline Elements Within Agent Determination

The workflow container has a multiline element that contains the agents. This element is filled

when you use the background method to execute the process, or it is available as a virtual

attribute in an object type. ln exactly the same way as the multiline attributes' enter the

element on the Miscellaneous tab page and is name explicitly in the binding.

The following section contains a simple example of how you can define one of these virtual

attributes. lt is called ZAGENT and contains three hard-coded users,

GET_PROPERTY ZAGENT CHANGING CONTAI NER

DATA: userl like wfsyst-agent value 'USBlT601-MGR3

DATA: user2 like wfsyst-agent value 'USBlT601-31

318 O Copyright. All rlghts reserved.

Page 333: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Fork and Multiline Attributes

DATA: user3 I i ke wfsyst-agent value' USSCH LEICH ER

REFRESH OBJECT-zuser

APPEND userl TO OBJECT-zuser

APPEND user2 TO OBJECT-zuser

APPEND user3 TO OBJECT-zuser

SWC_S ET_TAB LE CONTAI N ER'zuser' OBJ ECT-ZUSER

END-PROPERTY

@ Copyright . All rights reserved

Page 334: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

320 @ Copyright . All nghts reserved.

Page 335: SAP Workflow Bit601 en Col10

Use the Step Type Fork

Business Example

You want to inform three different users in your company of a material master changesimultaneously.

Task I1.. Create a new workflow template with z##_rnfo as both the abbreviation and the name.

Task2

1. Create d change material master step in the workflow. Use the TS98000071 task todo this. The responsible agent is the workflow initiator.

Task 3

1. Create a fork that informs the three users of the change simultaneously. You want toinform three different users simultaneously of the material master change. Use a fork todo this. The fork should have three branches and execute all three to complete the fork.

Task 4

1. ln each of the parallel branches, create a step to display the material. lmplement theTsggooolOS task, Display material master in each branch. The agents in the step are the

usersBrr6ol-*#, Brr6O1-MGR##, and 81160114AT-## respectively.

Task 5

L. Set the Import and Mandatory properly for the material used in the workf low container tobe able to transfer a material to the workflow for test purposes.

Task 6

1. Activate and test your workflow. First, make a change to the material master. Then checkthat a work item with the changed material master displays simultaneously for your threeUSCTS.

O Copyright. All rights reserved. 32r

Page 336: SAP Workflow Bit601 en Col10

Unit:....ui:,ut:utt:1,,,

'rll,,at,,l:l,' '.:,,':' S0lUti$n,'

1nIL/?)-t11

d)

e)

Use the Step Type Fork

Business Example

You want to inform three different users in your company of a material master changesimultaneously.

Task 1

1. Create a new workflow template with z##_rnfo ?s both the abbreviation and the name.

a) On the SAP EasyAccess screen, choose Iools --- BusinessWorkflow --- Development ---+ Definition too/s --+ Workflow Builder ---+ Workflow Builder:Create Workflow.

b) On the Workflow Builder - Create 'Unnamed'screen, choose Saye.

c) ln the Give your new workflow template a name here dialog box that appears, enter thefollowing data:

Field Name Entry

Abbr. z*# rnfo

Name z##_rnfo

Choose Continue.

On the Create Object Directory Entry dialog box, choose the Local Object pushbutton.

Task 2

1. Create ? Change material master step in the workflow. Use the rs98000071 task todo this. The responsible agent is the workflow initiator.

a) On Ihe Workflow Builder - Change'Z##_lnfo'screen, choose Undefined inlheNavigation area pane.

b) ln the Graphical Modelpane, choose the Create pushbutton.

c) ln the Step Se/ection dialog box, double-click Activity in the Step Type pane.

d) On the Controltab page, enter rs9eoo0108 in the Iask f ield.

e) Press ENTER.

f) ln the Define Container Elements and Binding dialog box, choose Continue to confirmthe binding.

g) ln the Agents pane, choos e Workf low initiator (expression) as the agent.

h) Choose Transfer and to graphic to return to the basic screen of lhe Workflow Builder.

322 @ Copyright. All rights reserved

Page 337: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Fork and Multiline Attributes

Task 3

L. Create a fork that informs the three users of the change simultaneously. You want toinform three different users simultaneously of the material master change. Use a fork todo this. The fork should have three branches and execute all three to complete the fork.

a) Select an area or the undefined step behind the Change material master step in the

Workflow Builder.

b) ln the Graphical Modelpane, choose the Create pushbutton.

c) ln the Step Se/ection dialog box, double- click Fork in the Step Type pane'

d) On Ihe Controltab page, enter the following data:

Field Name or Data Type Entry

Step Name Paral]-e]- Information

Parallel Branches 03

Necessary Branches o3

e) Choose Transfer and to graphic pushbutton to return to Workflow Builder - Change'Z##-lnfo'. The system has implemented three parallel branches for you in theworkflow.

Task 4

1. ln each of the parallel branches, create a step to display the material. lmplement the

TsggooolOg task, Display material master in each branch. The agents in the step are the

users 811601-##, 811601-MGR*#, and Brr6olt'1AT-## reSpectively.

a) On lheWorkflow Buitder - Change'Z##-lnfo'screen, choose Undefined intheNavigation area pane.

b) ln the Graphical Modelpane, choose Create step pushbutton.

c) lntheStepSe/ectlondialogbox,double-clickActivityintheStepTypepane.

d) On the Conirol tab page, enter rs98ooo108 in the lask field.

e) Press ENTER to confirm.

f) ln the Define Container Elements and Bindings dialog box, choose Continue to confirm

the binding.

g) ln the Agents pane, choose User as the agent.

h) Enter 811601-## in the User field.

i) Choose Transfer and to graphic pushbutton to return lo Ihe Workflow Builder - Change'Z##-lnfo' screen.

j) Repeat this procedure for the other two branches for the fork.

ln each case, choose Users as the responsible agents and specify El11601-MGR## user

once and Brr60lIi{AT-## the next time.

Task 5

O Copyright . All rights reserved; PffiF

b'r, J, .*,&rF(d

Page 338: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processrng

1. Set Ihe lmport and Mandatory property for the material used in the workflow container tobe able to transfer a malerial to the workflow for test purposes.

a) On lhe Workflow Builder - Change 'Z##-lnfo'screen, on the left hand side of thescreen, choose Workflow Container from the selection menu.

b) ln the Element pane, chooseY3LMARA to display the element that contains thereference of the material master.

c) ln the Change Container element dialog box, select Ihe Properties tab page.

d) ln the Parameter Setfings pane, select the lmport and Mandatory checkboxes.

e) Choose Confirm (Enter) to exit the definition.

Task 5

L. Activate and test your workflow. First, make a change to the material master. Then checkthat a work item with the changed material master displays simultaneously for your threeusers.

a) On the Workflow Builder - Change 'Z##_lnfo'screen, choose lhe Generate andactivate runti me version pushbutton.

b) Choose the lest pushbutton.

c) On the Test Workflow screen, choose the <No lnstance> value for the Y3LMARA orBUS1001-Groupnr-## object to create an input line in the lower portion of the screen.

d) Enter r-eep## in the Key field to transfer your material to the workflow.

e) Choose Execute.

Execute the first work item and change the material master. Then check that a workitem with the changed material master was displayed simultaneously for your users.

324 @ Copyright . All rights reserved

Page 339: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Fork and Multiline Attributes

11....,.11i...-,,, LESSON SUMMARY

': You should now be able to:

. Use the step type fork and multiline attributes

@ Copyright . All rights reserved.

Page 340: SAP Workflow Bit601 en Col10

Using Step Type Loop, Form Processing,Document from Template, and Gonditions inthe Workflow Step

LESSON OVERVIEWThis lesson introduces the Loop, Form, and Document from Template step types. This lesson

also explains the functions on the Conditions tab page in the Workflow Builder.

Business Example

You want a workflow for approving vacation to run until the superior either approves thevacation or the applicant withdraws the vacation request. You want to start a workflow fromyour lnternet browser with an SAP form, which is based on a DDIC structure.

A business process step should end when the method has been processed and also a

condition is reached that is not based on the control of the current workf low.

You want another business process step to start if a condition is reached that is also not due

to the control of the current workflow. For this reason, you require the following knowledge:

. An understanding of the step type Loop

. An understanding of the step type Form

. An understanding of the step type Document from Template

. An understanding of conditions in workflow steps

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Use step type Loop

. Use step type Form processing

. Use step type Document from Template

. Use conditions in the workflow step

Step Type Loop Processing

To process a toop in your workflow, perform the following steps:

1. Select the step type Loop (Until) or Loop (While)'

a{,,,,,.. Note:

"*d' ln SAP ERP, you can no longer select the step type Loop (While)'

326 O Copyright . All rights reserved

Page 341: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Loop, Form Processing, Document from Template, and Conditions in the Workflow Step

2. Def ine a termination condition in the step.

3. lf required, implement the steps you want to execute again in the loop.

4, Specify the termination condition in the processing.

An example workflow is WS30OO0O15 (Process notification of absence).

The step type Loop inserts an Until or While loop in your workf low definition.

The step displays a screen where you must define the termination condition for the loop. You

can refer to comparisons with container elements here. With an Until loop, you define whichcondition is checked at the end of the required processing step(s). With a While loop,

however, in the condition you define what must be fulfilled to ensure that the processingstarts at all within ihe loop.

You can define any random sequences within the loop. You must fulf ill the terminationcondition in the step to be executed. You can use the WS30000015 workflow (Processnotif ication of absence) at any time to clarify the f unctions of a loop.

ln Release 6.20, the system asks you whether the step you selected should appear inside oroutside the loop. ln 4.6C and earlier releases, you receive the loop together with an undefinedstep, which you can use to model the loop content.

Step Type

You can use start forms to start workflows and transfer data to containers. ln this case, thecontainer element must refer to a structure whose fields are used in the form.

To incorporate a start form for your workflow perform the following steps:

1. Create a DDIC structure using the transaction code ss1t, if necessary.

2. CreaIe a container element in the workflow container about an existing DDIC structure.The container element must have the property lmport,

3. On the Workflow Builder, choose Basic Data.

refers to

generates

Possiblefunclions:

DisplayChangeApprove

Figure 94: Using Forms - Definition Time

Request numbenOate: '

l

lssuer: , ',i

Fiist day ot vacation:La*t day of vacation:

Request number:g*g; r:', ..

lssuer:. .., .

First day of vacation:Lasi day of vacation:

O Copyright. All rights reserved, 327

Page 342: SAP Workflow Bit601 en Col10

Unit i0: Special Step Types and Methods of Processing

4. Choose the Start Form tab page.

5. Choose lhe Create pushbutton.

The system creates a function group, generates a start form with input fields for the structureelements, and a transaction that can be used as a normal transaction or an Easy Web

transaction,

The Form step type enables you to display or edit data for a container element of the workflow

container. The workflow system can create the form automatically using awizard, whereby

you can still edit this new form and adapt it to suit your own requirements.

The steps for using the Form step type in your workflow are as follows:

1. Create workflow step Form, Form Iab page.

2, Enter the container element and the action that is to be executed.

Using Forms - Runtime

The user starts the form from an entry in the Favorites menu. The input f ields for the DDIC

structure are displayed. After the user has entered the data, the user presses the Start

pushbutton and thus triggers the underlying workflow. The number of the workflow instances

started is displayed in the system message line.

When the "Form" step type is executed, the data of the relevant container element is used

exactly as is required by the related function.

The options available when a form step type is used are as follows:

. Display function

Data is displayed.

. Change function

Data is displayed in change mode.

. Function approve

Formis filledby user

Displaying a start form in the basic menu using FAVORITES:

Request number:Date:lssuer:First day of vacation:Last day of vacalion:

Request number:Date: 12.11.02lssuer: JonesFirst day of vacation:13.11.2042Last day of vacation:15.11.02

Figure 95: Us ng Forms - Runt me

328 O Copyright . All rights reserved.

Page 343: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Loop, Form Processing, Document from Template, and Conditions in the Workflow Step

Two approval buttons are displayed. As a result, a value is entered in the container elementWI_RESU LT. This value is 01 if the object has been approved, and 02 if the object was

rejected.

. Function approve with query

On the Workflow Toolbox tab page that is displayed, you can enter a query.

The WS77OOO135 workflow is a verif ication workflow for using the Form step type.

Under the alias Workflow --> Media Library --+ Literature in the SAP Service Marketplace, you

will find a cookbook about the topic SAP Forms and Workflow: Cookbook WebFlow FormStep.

Step Type Document from Template

Using Document Templates, includes the following steps:. Create document templates (comparable to a template for Office documents).

- Using the Document template section in the Workf low Builder.

. Create a document .

- Using the workflow step type Document from template.

. Edit the document.

Using the workflow step type Activity.

The possible activities are stored in the TG71000004 task group.

. Delete the documents and templates.

- Using the RSWUODEL report.

. Note: You cannot link to objects outside the workflow by default.

Using the Document templates frame, you can create 1-n document template(s) for a

workflow. You can also import document templates from existing files, which are similar toOffice templates.

Workflow container elements can also be used on the document template. However, they are

only useful for reading purposes. Each document template is stored in the database of theSAP system using the SAP Knowledge Provider storage service.

To create a document from an existing template, perform the following steps:

1, check out, that allthe following steps are followed once the "Document from Template"

step has been chosen.

2. Choose the Docurnenttemplates tab page in the Documenttemplates field.

3. Use the input help (F4) to select the templates that you want to edit.

4. At runtime, you can enter a document when the corresponding application is called.

The document is also stored in the database of the SAP system in the same way as the

document template.

To edit the new document, use the TG71000004 task group. This task group contains

standard tasks for editing, displaying, and printing documents.

@ Copyright. All rights reserved

Page 344: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

You must delete the documents and document templates explicitly using the RSWUODELreport.

You cannot attach documents to objects, for example, document info records or materialmaster, outside the workflow.

Conditions on a Workflow Stepln certain situations, rather than using terminating events, you can use Conditions in yourworkflow steps. You use the Conditions tab page to set the conditions in the workf low step.

Conditions in Workflow steps:. Conditions can be set for the following functions:

- Create work item

The relevant work item is only created if a particular condition has been fulfilled.

End work item

The relevant work item is completed if a particular condition has been fulfilled.

- Complete execution

After the method of a work item is executed, the method ends only when the specifiedconditions on the database are fulfilled at the end of the method execution.

The conditions are checked using the job SWWCOND or when the method ends (completeexecution).

Create Work ltem

You can use this function to stop a workflow afler a step and then create the next work itemonly if a condition that is the prerequisite for the next step has actually been fulfilled. The newprocess step makes sense only if a certain status occurs that you can check using theconditions. The required status is not controlled using the workflow.

lf a requested start is maintained in the workflow definition, ihis is also checked.

End Work ltem

You can execute a process step for one or several users. The status in the system that shouldoccur after you execute the work item is created without using the workflow. ln this case, thework item is superf luous and you can end it.

This means you can also take into account dependencies that were not displayed directly in

the workflow.

Complete Execution

Using Complete Execution, you write a synchronous method that synchronously changes thevalues in the database. The work item then ends only if the named condition is fulfilled. The

condition you defined is checked if the method is conf irmed as having been completed.

The SWWCOND report is scheduled in the basic Customizing of the Workflow Engine(transaction swu3), runs periodically and checks the conditions in all three cases. ln the case

of a completed execution, the condition is also checked for the method end.

330 @ Copyright . All rights reserved.

Page 345: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Loop, Form Processing, Document from Template, and Conditions in the Workflow Step

Caution:The function Complete condition for a work item or Create condition for a work

item is not a general replacement for terminating events. Therefore, use it only if

you cannot define and trigger a suitable terminating event for a workflow step.

O Copyright . All rights reserved

Page 346: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

332@ Copyright . All rights reserved.

Page 347: SAP Workflow Bit601 en Col10

Use the Step Type for Loops

Business Example

You want to create a workflow for vacation approval and ensure that the request is processed

repeatedly until such time as the requestor's superior approves the request.

Task I1., Create a new workflow template with z** vacation as both the abbreviation and the

name.

Task 2

1, Create a notification of absence in the first workflow step. lnsert the task Ts30200106.

The responsible agent isthe Workflow initiator.

Task 3

1, Create a container element, which you will use for the loop termination condition. To be

able to formulate an end condition for your loop later, create a new Frag element in the

Workflow Container. Enter rras for the element, name, and short description. Create the

element with reference to the filed iNPUf from the table SYSf.

Task 4

L, Create afl untir :-oop after lhe Create notification of absence lask.

Task 5

1. As the termination condition, specify that the F/ag container element must have the value

x.

Task 6

1. Within the loop, insert the slep Approve notification of absence with the task Ts30000015.

Task 7

L. lnsert the task Ts3ooooo17, Revlse notification of absence, after the rejected outcome.

Task 8

@ Copyright. All rights reserved. 333

Page 348: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

1, lnthe approved outcome inacontaineroperation,enterxinthe FLAG elementtofulfillthetermination condition for the loop.

Task 9

1., Delete the outcome New.

Task 1O

1, Activate and test your workflow.

334 @ Copyright . All rights reserved.

Page 349: SAP Workflow Bit601 en Col10

Use the Step Type for Loops

Business Example

You want to create a workflow for vacation approval and ensure that the request is processed

repeatedly until such time as the requestor's superior approves the request'

Task I1. Create a new workflow template with z##_wacation as both the abbreviation and the

name.

a) On the SAP EasyAccess screen, choose Tools'-+ Business

Workftow --+ Development --+ Definition too/s --+ Workflow Builder ---+Workflow Builder:

Create Workflow.

b) On lhe Workflow Buitder - Create 'Unnamed'screen, choose Save.

c) ln the Give your new workflow template a name here dialog box, enter the followingdata:

Field Name or Data'Type Entry

Abbr. Z## wacation

Name Z*#_wacation

Choose Continue.

ln the Create Object Directory Entry dialog box, choose the Local Obiect pushbutton

Task 2

1. Create a notif ication of absence in the first workflow step. lnsert the task Ts30200106

The responsible agent islhe Workflow initiator'

a) On the Workflow Buitder - Change 'Z##-vacation' screen, choose Undef ined in lhe

Navigation area pane.

b) ln the Graphical Modelpane, choose the Create step pushbutton.

c) l n the Step se/ecfion dialog box, double- click Activity in the step Type pane.

d) On lhe Controttab page, enter rs3o2oo1o6 in the lask field.

e) Press ENTER.

f) ln the Define Container Elements and Binding dialog box, choose Continue.

g) ln the Agents pane, choos e workf low initiator (expression) as the agent.

d)

e)

O Copyright. All rights reserved

Page 350: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

h) Choose the Transfer and to graphic pushbutton to return lolhe Workflow Builder -Change' Z##_vacation' screen.

Task 3

1. Create a container element, which you will use for the loop termination condition. To be

able to formulate an end condition for your loop later, create a new Frag element in the

Workftow Container. Enter rlag for the element, name, and short description. Create the

element with reference to the filed INPUf f rom the table SYSf.

a) On IheWorkftow Buitder - Change'Z##-vacation'screen, on the left-hand side of the

screen, choose Workflow Container in the selection menu.

b) Choose <Double-Click to Create> in the Element field'

c) ln the Create Container Element dialog box, enter the following data:

Field Name Entry

Element Flag

Name FIag

Short Description Fl-ag

d) On lhe D. Type tab page, select the ABAP Dict. Reference radio button and enter the

following data:

Field Name Entry

Structure SYST

Field INPUT

e) Choose Continue.

Task 4

l., Create an Until loop after lhe Create notification of absence task.

a) ln the Navigation area pane, choose create notification of absence.

b) Choose theCreate step pushbutton.

c) ln the Step Se/ection dialog box, double-click Loop (Until) in the Step Type pane.

The system asks you if you want to transfer the step already created into the loop. ln

the /nsert Loop dialog box, choose lhe Before pushbutton.

d) ln the Controltab page, enter Loop in the Step Name field.

e) ln the Outcomes pane, enter the following data:

Outbox Name

True (Loop End) End

False (New Loop Pass) Repeat

336 @ Copyright. All rights reserved

Page 351: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Loop, Form Processing, Document from Template, and Conditions in the Workflow Step

Task 5

1, As the termination condition, specify that the Flag container element must have the value

x.

a) lnthe Condition pane,chooseClickheretocreateanewconditionto createaconditionfor terminating the loop. The condition editor opens.

b) ln the Change Condition dialog box, double-clickFlag in the Expresslon field.

c) ln the Operators pane, choose =.

d) Enter x in the Constant field.

e) Press ENTER.

f) Choose lhe Transfer condition pushbutton to exit the condition editor.

g) Choose Ihe Transfer and to graphlc pushbutton to return to the basic screen of theWorkflow Builder.

Task 6

1. Within the loop, insert the step Approve notification of absence with the task TS30000016.

a) On IheWorkftow Buitder - Change'Z##-vacation'screen, choose Loop in the

Graphical Model pane.

b) ln the Step Se/eciion dialog box, double-click Activity in the Step Type pane.

c) On lhe Controttab page, enter rs3oooool6 in the Iask field.

d) Press ENTER.

e) ln the Define Container Elements and Binding dialog box, choose lheContinuepushbutton to confirm the binding.

f) ln the Agents pane, choos e Superior of workflow initiator (rule) as the agent.

g) Choose lhe Transfer and to graphlc pushbutton to return to the basic screen of the

Workflow Builder.

The system has defined three outcomes for this step. An outcome has been created

for each result delivered by the Approve method.

Task 7

!.. lnsert the task Ts3oooool?, Revise notification of absence, after the reiected outcome.

a) On the Workf tow Builder - Change 'Z##-vacation' screen, choose an area or the

undefined step in the reiecfed outcome.

b) ln the Graphical Modelpane, choose the Create step pushbutton'

c) l n the Step Se/ectlon dialog box, double- click Activity in the Step Type pane

d) On lhe Controttab page, enter rs3ooooolT in the Iask f ield.

e) Press ENTER.

O Copyright. All rights reserved.

Page 352: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

f) ln the Define Container Elements and Binding dialog box, choose lhe Continuepushbutton to confirm the binding.

g) ln the Agents pane, choos e Workflow Initiator (expression) as the agent.

h) Choose the Transfer and to graphic pushbutton to return to lhe Workf low Builderscreen.

Task 8

L. lntheapprovedoutcomeinacontaineroperation,enterxintheFLAGelementtofulfillthetermination condition for the loop.

a) On lhe Workflow Builder - Change'Z##_vacation'screen, choose an area or theundefined step in the approved outcome.

b) ln the Graphical Model pane, choose the Create step pushbutton.

c) ln the Step Se/ection dialog box, double- click Container operation in the Step lypepane.

d) On Ihe Controltab page, enter the following data:

Field Name Entry

Step Name End

Outcome Name End

e) On the Operation pane, enter rrag in the Resu/t Element field.

f) Use the input help to determine the value for Expression.

g) ln the Expression for f irst operand of container operation f ield, enter x in the Constant

field.

h) Choose lhe Transfer and to graphlc pushbutton to return to the basic screen of theWorkflow Builder.

Task 9

L. Delete the outcome tVeuz.

a) On the Workftow Builder - Change 'Z##-vacation' screen, choose Ihe Generate and

activ ate runti me version pushbutton.

b) ln the Navigation area pane, choose Approve notification of absence.

c) Choose the fest pushbutton.

d) On the Outcomes tab page, choose Neuz in the Outcome field.

e) Choose the Delete steP.

f) Choose Yes to confirm.

Task 10

1.. Activate and test your workflow.

338 @ Copyright. All rights reserved.

Page 353: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Loop, Form Processing, Document from Template, and Conditions in the Workflow Step

a) On the Workflow Builder - Change'Z##-vacation'screen, choose the Generate andactivate runtime version pushbutton.

Choose the fest pushbutton.

On the Test Workflofv screen, choose Execute.

The manager should first reject the vacation request to test the loop processing. The

manager should then approve the request to test the loop termination.

Caution:Remember that the Process notification of absence workf low templatereacts to the NotilFication of absence created event.

As a result, your manager receives 2work items in his or her lnbox. Display the workitems and choose Extras --+ Technical data. There you can see which work item was

created from the workflow and you can then test the work item that originates fromthe workflow of the exercise.

b)

c)

O Copyright. All rights reserved

Page 354: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

340@ Copyright. All rights reserved.

Page 355: SAP Workflow Bit601 en Col10

Use the Step Type Document from Template

Business Example

lf a material master change is rejected, you want to create a detailed reason for this in a Word

document and suggest changes, if necessary.

Task ICreating a document template.

1. Call your workf low for processing the material master and create a Word Document

Template.

2. Enler thefollowingtext: Reason for rejection of the material master change

rnitiator of the workflow: <Variable Workflowinitiator>

Material : <Variable Material-number>

Enter the variables from the workflow container on the left-hand side of the document

template. Save the template under zooc-#*.

Task 2

Process the document template.

1. lnsert a Document from template step in your workflow in the Back outcome of the user

decision Not okay to change material master.lf a material master change was rejected, the

user who rejected it should enter the reason for this in the Word document, as well as

suggestions, if necessary.

Enter a new Document f rom template step immediately after the user decision Not okay to

change material master. The agent of the step should be identical to the agent who

displayed the material master.

2. Maintain the Docume nt from temptate step type and its outcomes. ln the section

Document temptate(s), select the document template you have just created and enter two

step names for outcomes. ln the outcome Step executed, enter the value executed.

Activate the outcome Document could not be created'

3. Which new element was created in the Workflow Container?

4, CreaIe an activity to edit the document created in the Document from template step' The

Word document with reasons and suggestions should be displayed for the person who

changed the material master, that is, the Workflow initiator. Therefore, insert a new

activity after the executed outcome.

Use the rs?100794s task to do this. The agent for the step should be the Workflow

initiator.

Task 3

@ Copyright. All rights reserved

Page 356: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

1.. Activate and test your workflow.

342 O Copyright . All rights reserved.

Page 357: SAP Workflow Bit601 en Col10

Use the Step Type Document from Template

Business Example

lf a material master change is rejected, you want to create a detailed reason for this in a Word

document and suggest changes, if necessary.

Task ICreating a document template,

1. Call your workflow for processing the material master and create a Word Document

Template.

a) On the SAP Easy Access screen, choose fools -' Business

Workftow ---> Development --+ Definition too/s -' Workflow Builder --+ Workflow Builder

(transaction swoo).

b) On Ihe Workf tow Builder - Change 'Z##-lnfo'screen, the workf low for changing the

material master is displayed. lf your workflow is not displayed, search for it using the

abbreviation zwf*.

c) Choose DocumentTemplates in the selection menu on the left-hand side of the screen.

d) ln the Documents Templates pane, choos e <Double-click to create>.

e) tn the Se/ect the Document Type (1) dialoe box, choose Microsoft Word intheApplication field.

2, Enterthefollowingtext: Reason for rejection of the material master change

rnitiator of the workflow: <Variable Workflowinitiator>

Materiar : <Variable Material-number>

Enter the variables from the workflow container on the left-hand side of the document

template. Save the template under zooc-*#.

a) On the Edit document template: Unnamed screen, enter Reason for rejection ofthe material master change'

b) Enter two empty lines, followed by two lines with the following texts.

Field Name Entry

lnitiator of the workflow WF Ini-tiator

Material t'taterial

Press ENTER

Choose Save.

ln the Specify a Short Description dialog box, enter zpoc-** in the lltle field.

c)

d)

e)

O Copyright. All rights reserved.

Page 358: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

f) Choose Save.

g) Go back to lhe Workf low Builder screen.

h) On the Exit Document Editor dialog box, choose Yes.

Task 2

Process the document template.

1. lnsert a Document from template step in your workf low in the Back outcome of the userdecision Not okay to change material master.lf a material master change was rejected, theuser who rejected it should enter the reason for this in the Word document, as well as

suggestions, if necessary.

Enter a new Document f rom template step immediately after the user decision Not okay tochange material master. The agent of the step should be identical to the agent whodisplayed the material master.

a) On IheWorkflow Builder - Change'ZWF_TEST1_##'screen, choose Materialmasterchanges not okay in the Navtgation area pane.

b) ln the Graphical Modelpane, choose the Creafe step pushbutton.

c) ln the Step Se/ectlon dialog box, double- click Document f rom Template in the StepType pane.

d) ln the Agents pane, chooseUser as the agent.

e) Enter Brr6ol-## in the User field.

2. Maintain the Document from template step type and its outcomes. ln the sectionDocument template(s), select the document template you have just created and enter twostep names for outcomes. ln the outcome Step executed, enter the value executed.Activate the outcome Document could not be created.

a) Enter zDoc## in the Doc. femplates(s) f ield.

b) ln the Navigation area pane, choose Material master changes not okay.

c) On the Outcomes tab page, enter Executed in the Name field f or Step Execufed

Outcome.

d) Choose Outcome not used to activate the outcome Document could not be created.

Caution:lf only the outcome Step executed is displayed in a step, return to thebasic screen oI lhe Workflow Builder and call the step again.

3. Which new element was created in the Workf low Container?

a) On the Workf low Builder - Change 'ZWF-TESTI-##' screen, choose Transfer and tographic pushbutton to return the Workflow Builder.

b) Choose Workf tow container in the selection menu on the left-hand side of the screen.

c) ln the Workf low Container pane, WF-Document-O)O1 in the Element field.

3M @ Copyright. All rights reserved.

Page 359: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Loop, Form Processing, Document from Template, and Conditions in the Workflow Step

For every template that is used in a document from template step, the system createsa container element.

4. Create an activity to edit the document created in the Docum ent from temptate step. TheWord document with reasons and suggestions should be displayed for the person whochanged the material master, that is, Ihe Workflow initiator. Therefore, insert a newactivity after the executed outcome.

Use the Ts71oo?945 task to do this. The agent for the step should be the workftowinitiator.

a) On the Workflow Builder - Change 'ZWF-TESTL_##'screen, choose Sfep executed inthe Outcome field.

b) Choose the Create step pushbutton.

c) ln the Step Se/ection dialog box, double- click Activity in the Sfep Type pane.

d) On lheControltab page, enter rsz1oo794s in the Iask field.

e) ln theAgents pane, choose Workflow initiator (expression) as the agent.

f) Choose Ihe Binding (Exists) pushbutton.

g) ln the Change Binding for Step dialog box, choose Continue to confirm the binding.

Task 3

1.. Activate and test your workflow.

a) Choose theTransfer and to graphic pushbutton to return to the basic screen oftheWorkflow Builder.

b) Choose lhe Generate and activate runtime version pushbutton.

c) Choose the fest pushbutton.

d) On the fesf Workflow screen, choose the Load pushbutton.

e) Choose Execute.

f) Go back to the business workplace inbox.

g) Execute the workflow up to the user decision that offers you the option Back to personwho made the change.

h) Choose Back to person who made the change.

i) Enter any text.

j) Go back to exit the Word application.

k) On the Exit Document Editor dialog box, choose Yes.

Hint:lf you are not sure, which of your users has executed the various workitems, use the workflow log to check the agents.

O Copyright. AII rights reserved 345

Page 360: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

:,,,.,...,..,i. ,i LESSON SUMMARY' '

You should now be able to:

. Use step type Loop

. Use step type Form Processing

. Use step type Document from Template

. Use conditions in the workflow step

346 @ Copyright . All rights reserved

Page 361: SAP Workflow Bit601 en Col10

Using Step Type Block and Switch

LESSON OVERVIEWThis lesson explains the usage of the step type BLOCK and SWITCH.

Business Example

Your company plans to build new workf lows within new requests to the processes that run inthe company. One of these requests is for the processing of several purchase orders within a

workflow. ln this case, the processing must be parallel, not sequential. Another request is toimplement multiple conditions which are not processed according to the CASE principle butwhich you want to specifically control using conditions. For this reason, you require thefollowing knowledge:

. An understanding of the step type BLOCK

. An understanding of evaluating the options of the SWITCH construct

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Use step type Block

. Use the SWITCH construct in step type Multiple Condition

Step Type Block

@x"

Workflow Container

Figure 96: Step Type Block

@ Copyright . All rights reserved u, filTfL-{[-r'3

Page 362: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

The block is a new modeling element within the workflow builder. lt was newly developed forthe Web Application Server 6.40 in the area of ccBPM and is therefore available in the backend (ccBPM based on the Workflow Engine).

The block may contain other modeling elements (step types). ln this sense, it displays a newdata context and the steps that are within the block refer to this context.

The block has a data interface and it uses this data interface to exchange information with theadjacent data contexts. lt consists of a start point and an end point and it is represented by aseparate work item type within the Workflow Engine.

The following are some other functions of the Block:. Exception handling

. Deadline monitoring

. Separate display within the workflow log (folder)

. Terminationcondition

. Processing multiline elements

Dynamic Parallel Processing

The block instantiation may occur dynamically using multiline elements (ParForEach). A

workflow system creates a block instance for each entry in the multiline element.

The corresponding line item data is transferred to the block context using binding. Theprocess continues after the ParForEach block if all of the instantiated parallel blocks arecompleted or if a special termination condition is applicable after a loop pass.

Dynamic Sequential Processing

The block instantiation may occur dynamically using multiline elements (ForEach). For each

entry in the multiline element, the workflow engine executes the sequence once within theblock and during this process only one instance is created at a time and involves loopsemantics (loop).

I

i:

ffi_-

:

$,;-.

:2

ffi::. +

nMultiline

container elementBlock Definition N parallel block

instances

Frgure 97. Dynamic Parallei Processing

i-*,

&,;.- &il +

$.:;-

Block Definition

ril

r **;,1

'i lli ri 1,**s*.il- r

Multilinecontainer element n block sequences as loops

Figure 98. Dynamic Sequential Process ng

348 @ Copyright , All rights reserved,

Page 363: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Block and Switch

The process continues if all of the elements of the multiline variable have been processed, or ifa special termination condition is fulfilled after a block instance runs.

@ Copyright . All rights reserved.

Page 364: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

350 O Copyright . All rights reserved.

Page 365: SAP Workflow Bit601 en Col10

Use the Step Type Block

Business Example

As a developer, you want to develop a new workflow to process purchase orders. The

workflow gets its information from a multiline attribute Purchase Order of the business objecttype Standard Material (BUS1001006). You want to use dynamic ParForEach to control theprocessing of the purchase orders and you want to map this ParForEach using a new

construct called block.

Develop a new workflow and use the step type BLOCK.

1. Create a new workflow template with the abbreviation z#*_parrorna (where ## is your

group number).

2. Create a container element material that has the object lype Y##MARA (select lhe lmportcheckbox) and a container element purchase order with the object type BUS2OJ2 (select

lhe M ulti li ne checkbox).

3. Create a container operation to populate the new multiline workf low container element

with the Purchase Orders for the material object (attribute PurchaseOrder).

4, Create a block step after the container operation step. Use the following data:

Tab Entry

Control tab page Enter slock group ## as the step name

and choose ParForEach as the block type.

Parallel Processing tab page Under multiline element, enter yourelement Purchaseorder.

Control tab page Enter the binding from the elementPurchaseOrder in the workflow containerfor the element -PurchaseOrder-LINE

in

the block container.

Use an Activity step type to ensure each Purchase Order is displayed. Search for a

suitable task for the method Display of the business object type BU52O12 (which

represents Purchase Orders).

Test your settings.

5.

6.

O Copyright. All rights reserved, 351

Page 366: SAP Workflow Bit601 en Col10

Use the Step Type Block

Business Example

As a developer, you want to develop a new workflow to process purchase orders. Theworkflow gets its information from a multiline attribute Purchase Order of the business objecttype Standard Materiai (8U51001006). You want to use dynamic ParForEach to control theprocessing of the purchase orders and you want to map this ParForEach using a newconstruct called block.

Develop a new workflow and use the step type BLOCK.

L. Create a new workflow template with the abbreviation Z## ParForea (where ** is yourgroup number).

a) Run the transaction swoo.

b) Choose Workflow---+ New.

c) Choose Save.

d) ln the Abbr. field, enter z#*_parForEa and in the Name field, enterpemo wF b.Iockgroup xx.

e) Press ENTER and use the package zoot and your requests, or store the object locally.

2. Creale a container element material that has the object lype Y##MARA (select the lmportcheckbox) and a container element purchase order with the object type BUS2OJ2 (selectlhe M u lti I i n e checkbox).

a) On the Workflow Builder screen, choose Workflow Container (in the object area) of theworkflow that you just created.

b) Double-click <Double-click to create>.

c) ln the Create Container Element dialog box, enter t'taterial in the E/ement, lVame and

Short Descriptlon f iel ds.

d) Select the Obiect type radio button.

e) Enter Y#*I',IARA in the Oblect Type field.

f) On the Properties tab page, select the lmport checkbox.

g) Choose Confirm.

h) Double-click <Double-click to create> and in the Create Container Element dialog box,

enter Purchaseorder in the E/eme nt, Name and Shorf Description f ields.

Select the Oblect type radio button.

Choose BU52012 in the Obiect Type field.

i)

i)

352 @ Copyright. All rights reserved

Page 367: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Block and Switch

k) Confirm and save the workflow.

l) On the Properties tab page, select Ihe Multiline checkbox,

m) Choose Confirm.

3. Create a container operation to populate the new multiline workflow container element

with the Purchase Orders for the material object (attribute PurchaseOrder).

a) Double-click the undefined step within the workflow condition.

b) On the Step Se/ecilon dialog box, choose Container operation step.

c) ln the Step Name field, enter conprete purchase order and in lhe Outcome Name

field, enter Purchase order complete'

d) ln the Resu/t Element field, enter Purchaseorder as the container element and

search for the attribute PurchaseOrder for the container element Material (=

&MATERIAL.PURCHASEORDER&).

e) Confirm your entries by selecting the green checkmark'

4, Create a block step after the container operation step. Use the following data:

Tab Entry

Control tab page Enter glock group ## as the step name

and choose ParForEach as the block type.

Parallel Processing tab page Under multiline element, enter yourel ement Purchaseorder.

Control tab page Enter the binding from the elementPurchaseOrder in the workflow containerfor the element -PurchaseOrder-LlN

E in

the block container.

a) Enter the values from the table and use the green checkmark to confirm your entries

when you are finished.

Use an Activity step type to ensure each Purchase Order is displayed. Search for a

suitable task for the method Display of the business object type BUS2O12 (which

represents Purchase Orders).

a) Place the cursor between the start symbol and the end symbol of the block. Right-click

to choose Activity step in the Step Se/ectlon dialog box'

b) ln the lask field, enter the business object type to select a task, which has the method

DISPLAY. For this, enter the task rs99700141.

c) Press ENTER, reject the binding that the system offers using lhe Define Container

Elements and Binding dialog box and maintain this manually. To do this, in the binding

editor, connect the element _PurchaseOrder-L\NE from the block container with the

element - W I -O

BJ ECT-ID f rom the task conta i ner.

d) ln the Details tab page deselect Ihe Advance with dialog checkbox.

Test your settings.

5,

6.

@ Copyright . All rights reserved.trwulrw353 rFnt 7hlffo

Page 368: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

a) On the Workf low Builder screen, activate the process def inition that you just created

and check it for errors.

b) Enter the material R-1003 to test your workflow. Run transaction code swus or choose

the fest pushbutton on the Workf low Builder screen.

354 O Copyright , All rights reserved.

Page 369: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Block and Switch

The Switch Construct in Step Type Multiple Condition

As of SAP ERP, there is a new option to request multiple conditions.

Up to and including R/3 Enterprise, the solution is to create a CASE structure. ln this CASE

structure, you specify a comparison element and explicitly define the various possible values,

You can create another branch, to which you navigate if an undefined value occurs at runtime

As of SAP ERP, you can choose from the CASE and the SWITCH structures during themultiple condition step. SWITCH uses the condition editor to define the permitted values orvalue areas.

Each branch of the SWITCH structure contains a condition. The conditions are checked in thepredefined sequence, in which the system runs the first branch whose condition is fulfilled. lfno condition applies, the ELSE branch runs.

Creating a SWITCH

F;i""tr*EEb*"r'l

Figure 100: Creating a SWITCH

@ Copyright, All rights reserved 355

Page 370: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

356 @ Copyright , All rights reserved.

Page 371: SAP Workflow Bit601 en Col10

Use the Step Type Multiple Condition

Business Example

ln the workflow you created earlier, you want to implement some improvements in theprocess. One such improvement is the introduction of a multiple condition, based on thematerial group, which will control the process.

L. ln your workflow Z##-ParForEach, create a step (before the block) that displays thematerial.

2. Afler you display the material, create a multiple condition step that contains the followingdata:

Field Name Entry

Step Name SWITCH Group ##

Type SWITCH

Outcome Name Condition' irl , -, -

001to 004 Use the condition editor to define a valuerange for the attribute Material group.

OO5 to 011 Use the condition editor to define a valuerange for the attribute Material group.

Other values Greater than 011

ln the workflow, insert the block (created in the exercise before) into the branch 001tooo4.

ln the branch 005 to OlJ, enter your step for displaying the change documents for thematerial (Z##_TS_1).

Choose a Send Mall step in the branch Greater than 11.

Activate the workflow definition and test it.

3.

4.

5.

6.

@ Copyright . All rights reserved.

Page 372: SAP Workflow Bit601 en Col10

Use the Step Type Multiple Condition

Business Example

ln the workflow you created earlier, you want to implement some improvements in theprocess. One such improvement is the introduction of a multiple condition, based on thematerial group, which will control the process.

1. ln your worktlow Z##_ParForEach, create a step (before the block) that displays thematerial.

a) On Ihe Workf low Builder screen, choose the symbol for the start of the block in yourworkflow def initions and choose Create Step.

b) Choose the Activity step type and in the lask f ield, enter your task for displaying thematerial Z##_TS_2.

c) ln the Define Container Elements and Binding dialog box, confirm the proposedbindings.

d) On the Control tab page, choose Workf low initiator (expression) as the responsibleagent.

e) Conf irm your entries.

2. Afler you display the material, create a multiple condition step that contains the followingdata:

Field Name Entry

Step Name SWTTCH Group *#

Type gWITCH

Outcome Name Condition

0Ol to OO4 Use the condition editor to define a valuerange for the attribute Material group.

005 to 011 Use the condition editor to define a valuerange for the attribute Material group.

Other values Greater than 011

Choose the symbol for the start of the block in your workflow definition and chooseCreate Step.

Choose lhe Multiple Condition step type and enter the values in the above table in theStep name and Type fields.

a)

b)

358 @ Copyright. All rights reserved

Page 373: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Block and Switch

c) lf you have converted the type to SWITCH, you can enter the values that are in theabove table (under Outcome name) in the relevant fields.

The symbol in the Condltion column is used to open the condition editor. You use thisto assign the conditions to the relevant outcomes,

An attribute with the name MaterialGroup is located under the element Material (notethe difference between data type reference MaterialGroup and object type referenceM aterialGroupJ). Assign the fol lowing conditions:

Value Outcome Name

Outcome 001 to 004 &MATERIAL. MATERIALGROUP& >= 001and &MATERIAL.MATERIALGROUP& <=004

Outcome 005 to O11 &MATERIAL. MATERIALGROUP& > OO4and &MATERIAL. MATERIALGROU P& <=011

Other values Greater than 11

3, ln the workflow, insert the block (created in the exercise before) into the branch 0011ooo4.

a) Choose the symbol for the start of the block and choose Cut block from the contextmenu.

b) Choose the area in the branch 001 to 004 and, choose Paste block from the contextmenu.

4. ln the branch OO5 to 0ll, enter your step for displaying the change documents for thematerial (Z##_TS_1).

a) Choose the area in the branch 005 to 01linyour workflow definition and chooseCreate Step.

b) Choose lhe Activity step type and use your object type Y##Mara to search for theavailable tasks.

c) Choose lhe lask Z##_TS_2.

d) lf the Define Container Elements and Binding dialog box appears, confirm the proposedbindings. Choose Workf low initiator (expression) as the responsible agent.

e) Confirm your entries.

5. Choose a Send Mall step in the branch Greater than 11.

a) Choose the area in the branch Greater than 11in your workf low def inition and chooseCreate Step.

b) Choose the Send Mail Step type.

c) ln the Subject field, enteruaterial groutr> is greater than 11, therefore,cannot be displayed.

d) lnthe Mail text field, entert'taterial group is greater than 11, therefore,cannot be displayed.

e) Choose Transfer and to graphic to exit the step.

O Copyright . All rights reserved 359

Page 374: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

f) The Send Mailstep creates a new standard task in the background

g) ln theAbbr. field, enter z##_nail.

h) ln the Longtext field, enteruail to obsorete **.

i) Create the task as a local object.

6. Activate the workflow definition and test it.

a) Run the transaction code ltr\402 to change lhe Material Group field.

b) Use the material T-BBD## to test the workflow.

360 @ Copyright . All rights reserved.

Page 375: SAP Workflow Bit601 en Col10

Lesson: Using Step Type Block and Switch

LESSON SUMMARYYou should now be able to:

. Use step type Block

. Use the SWITCH construct in step type Multiple Condition

@ Copyright . All rights reserved

Page 376: SAP Workflow Bit601 en Col10

Unit 10: Special Step Types and Methods of Processing

362 O Copyright . All rights reserved.

Page 377: SAP Workflow Bit601 en Col10

Learning Assessment

1, The step type fork enables you to process business steps in parallel.

Determine whether this statement is true or false.

True

False

2. When you use the Until Loop, you must define which condition is checked at the end of therequired processing step(s).

Determine whether thls stateme nt is true or f alse.

True

False

3. You can use the Form step type to perform which of the following actions?

Choose the correct answer.

TT

TT

TT

Tf,

I n Display or edit data for a container element of the workflow container

t B To insert an Until or While loop in the Workflow definition

I C Create document templates

4. Forms that are used in af orm step are based on a DDIC structure.

Determine whether this statement is true or false.

True

False

5. You can import document templates from existing files, which are similar io Office

templates.

Determine whether thls stateme nt is true or f alse'

True

False

@ Copyright. All rights reserved 363

Page 378: SAP Workflow Bit601 en Col10

Unit 10; Learning Assessment

6. You can only gain read-only access to container elements that are used in documenttemplates.

Determine whether this statement is true or false.

True

False

7. The functions Complete condition for a work item or Create condition for a work item canbe used as a general replacement for terminating events.

Determine whether this stateme nt is true or false.

True

False

B. On the Conditions tab page, in the

-

section, you can create conditions that mustbe fulfilled before a work item is ended.

Choose the correct answer.

A Create work item

I B End work item

! C Complete execution

9. A job periodically checks whether conditions have been fulfilled.

Determine whether this stateme nt is true or false.

True

False

10. The step type BLOCK may contain other step types.

Determine whether thls stateme nt is true or false.

True

False

11. Each branch of a SWITCH structure contains a condition. lf no condition applies, the ELSEbranch does not run.

Determine whether this statement is true or false.

True

False

rr

TT

nT

Tn

Tn

364 O Copyright . All rights reserved

Page 379: SAP Workflow Bit601 en Col10

Learning Assessment - Answers

The step type fork enables you to process business steps in parallel.

Determine whether this statement is true or false.

True

False

You can use the step type fork to align steps in parallel so that each recipient can beginprocessing immediately without waiting for the others.

2. When you use the Until Loop, you must define which condition is checked at the end of therequ ired processing step(s).

Determine whether this statement is true or false.

True

False

3. You can use the Form step type to perform which of the following actions?

Choose the correct answer.

En

En

I n Display or edit data for a container element of the workflow container

! B To insert an Until or While loop in the Workflow definition

! C Create document templates

Forms that are used in a form step are based on a DDIC structure.

Determine whether thls stateme nt is true or false.

True

False

EI

@ Copyright. All rights reserved,

Page 380: SAP Workflow Bit601 en Col10

Unit 10: Learning Assessment - Answers

5. You can import document templates from existing files, which are similar to Officetemplates.

Determine whether this statement is true or false.

True

False

6. You can only gain read-only access to container elements that are used in documenttemplates.

Determine whether thls stateme nt is true or false.

True

False

Container elements in document templates normally refer to attributes of the leading

object. They can only be changed by methods.

7. The functions Complete condition for a work item or Create condition for a work item can

be used as a general replacement for terminating events.

Determine whether this stateme nt is true or false.

True

False

B. On the Conditions tab page, in the

-

section, you can create conditions that mustbe fulfilled before a work item is ended,

Choose the correct answer.

! n Create work item

B End work item

I C Complete execution

9. A job periodically checks whether conditions have been fulfilled.

Determine whether this statement is true or false.

True

False

E!

ET

TE

En

366 O Copyright . All rights reserved.

Page 381: SAP Workflow Bit601 en Col10

Unit 10: Learning Assessment - Answers

10. The step type BLOCK may contain other step types,

Determine whether this statement is true or false.

True

False

11. Each branch of a SWITCH structure contains a condition. lf no condition applies, the ELSE

branch does not run.

Determine whether this statement is true or false.

True

False

TE

ET

@ Copyright . All rights reserved, 367

Page 382: SAP Workflow Bit601 en Col10

Unit 10: Learning Assessment - Answers

368 O Copyright. All rights reserved.

Page 383: SAP Workflow Bit601 en Col10

Lesson L

Using Wizards for the Definition of Workflow Templates

Lesson 2

USing Wizards to Define Steps in a Piocess

370

374

UNIT OBJECTIVES

. Use wizards for the def inition of workflow templates

. Use wizards to define steps in a process

@ Copyright , All rights reserved 369

Page 384: SAP Workflow Bit601 en Col10

Using Wizards for the Definition of WorkflowTemplates

LESSON OVERVIEWThis lesson shows you how you can use wizards to create workflows for approval procedures

and circulation of documents.

Business Example

You want to create a workflow scenario for purchase orders in which specific agents, who are

to be determined at runtime, are to check a BANF. Sometimes there may be three or five

checkers. A purchase order counts as approved when the simple majority approves it. You

also want to create a workflow that calls five different transactions in a row. Wizards provide

support for all these tasks. For this reason, you require the following knowledge:

. An understanding of workflow standard templates and wizards

. An understanding of workflow process definition wizards

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Use wizards for the definition of workf low templates

Workflow Standard Templates and Wizards

Wizards make things easier for the following reasons:

. Wizards bring together documentation and functions by only asking a few questions on

each screen and providing all information required to answer these questions.

. Wizards ensure that all data is maintained consistently.

. Wizards do not overload the user with information.

The need, objective, and use of wizards are as follows:. Wizards make complex transactions and processes easier.

. Wizards cannot do everything. They are specific to one task and provide allthe information

required to complete that task successfully.

. Wizards omit irrelevant information and have simple screens'

. Both professionals and beginners can use wizards.

. Wizards ensure overall consistency. lf you have to manage many separate objects, you

may forget one. This cannot happen when you use a wizard.

370 @ Copyright. All rights reserved.

Page 385: SAP Workflow Bit601 en Col10

Lesson; Using Wizards for the Definition of Workflow Templates

SAP Workflow Templates and Workflow Wizards

The differences between SAP templates and wizards are as follows:

Workflow Wizards generate workflow definitions, but like any workflow definition that you

develop, they can be changed using the Workflow Builder.

The Workf low Wizards themselves are workf low def initions. When you execute a wizard, a

workf low is executed. This allows you to exit a Workflow Wizard without losing data (except

the current screen) and to restart the Workflow Wizard. Whenever you call the WorkflowWizard Explorer, it checks to see if there are any incomplete Workf low Wizards and allows you

to finish them.

Workf low Process Definition Wizards

ln pre-enterprise releases, the jump to the wizard environment for new workflows was located

in the Wizard Repository under fools --+ Business Workflow ---+ Developmeflt -> Definition

too/s ---+ Wizards ---+ Workflow Wizard Explorer.

ln releases prior to SAP Enterprise, you can call wizards that refer to individual process steps

under the Environment menu option in the Workflow Builder.

ln the current release, the interface is standardized. ln the Workflow Builder, you can start all

available wizards f rom the Workf low Wizards lab.

Table 5: Differences between SAP Templates and Wizards

SAP WorkflowTemptates Workflow Wizards

Work with a particular object type

Must be copied and adjusted (containerelements, binding, and so on)

Generate workflow definitions for anyobject type

Process logic can be adjusted simply byanswering questions

Provide simple dialogs and instructions

Use the Workflorrr WIZARDS tab 'n

the Workflow Builder if you want toimplemer* the following:

***

Approval procedures

Application wizards

Circulars

Read the documentation carefully anddecide if one of the wizards meets yourrequirements,

Figure 101: Finding Workflow Wizards

O Copyright , All rights reserved. 37t

Page 386: SAP Workflow Bit601 en Col10

Unit 11: Wizards

To create a new workflow using the Workflow Wizard, perform the following steps:

1. Start the Workf low Builder to create a new workflow using wizards.

2. Choose Ihe Workflow Wizards tab.

3, Choose a suitable Workflow Wizard.

4, Read the Workflow Wizard documentation in the online help.

5. Select the undefined step in the Workflow Builder.

6. Double-click the suitable wizard in the lower-left corner of the Workflow Builder to startthe wizard.

7. Answer all the questions.

The online documentation for wizards is contained in the Workf low Builder section of the

online documentation.

The online documentation is located under SAP NetWeaver ---+ SAP NetWeaver by Key

Capabitity ---+ Apptication Ptatform by Key Capability - Business Servlces -- SAP Buslness

Workflow -+ Reference Documentation --+ Workflow Builder ---+ Using Workflow Wizards.

The following are the available wizards for approval processes:

. Hierarchical approval workflow

. Parallelapprovalworkflow

. Ad Hoc: Dynamic hierarchical approvalworkflow

. Ad Hoc: Dynamic parallelapprovalworkflow

ln the wizards for approval processes, you perform the following steps:

L. Choose an approval object type, that is, the object type that is required to be approved in

the procedure.

2. Specify the number of approvals required, which includes the number of agents involved

and the number of required approvals. You are required to specify the number of agents

that must approve the object and the number of agents that must agree.

3. Specify whether the initiator is to be excluded from the decision. ln most approval

procedures, the person who triggers the procedure should not approve the procedure.

4, Specify the approval task, for example, the task to be used to approve the notification of

absence. You can select any approval task for the object type. The system checks if

agents are assigned to the task and if the task has results, such as approved or rejected. lf

not, the system does not accept the task.

5. Specify the approving event. Since the wizard works with every object type, it does not

know which result the object method returns, for example, "A" for "approved" or "0" for"approved" .

6. You can explicitly enter the agents for approval into the ad hoc workflows at runtime.

7. Parallel workf lows generate the approval work item for all the responsible agents

simultaneously. The workflow terminates when there are as many approvals as those

specified in the def inition.

The following are the available wizards for circulars:. Circular

372 @ Copyright. All rights reserved

Page 387: SAP Workflow Bit601 en Col10

Lesson: Using Wizards for the Definition of Workflow Templates

. Parallelcircular

- Ad Hoc: Dynamic circular

. Ad Hoc: Dynamic parallelcircular

You can use circulars to control the information sent within your company. Being the recipient

of the circular, you can specify distribution lists and organizational units as well as users.

Caution:lf you name an organizational unit, all the members of that organizational unit

receive the circular, but the normal workflow processing logic then follows. As

soon as the first user processes the work item (reads the circular), it disappears

from all the other inboxes. You should, therefore, specify an organizational unitonly if you just want the other members of an organization to be aware of thecircu lar.

LESSON SUMMARYYou should now be able to:

. Use wizards for the definition of workflow templates

@ Copyright. All rights reserved, 373

Page 388: SAP Workflow Bit601 en Col10

Using Wizards to Define Steps in a Process

LESSON OVERVIEWThis lesson shows how wizards can support the creation of workflow steps.

Business Example

You want to add modeled deadline monitoring to your workflow, in which the monitored workitem is set to obsolete when the deadline is missed. You want to determine recipients for workitems dynamically at runtime. You want to create a workflow step that calls reports. For thisreason, you require the following knowledge:

. How to create steps using wizards

. How to execute reports using wizards

. How to create an object reference using wizards

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Use wizards to define steps in a process

Wizard Based Step Creation

Some of the other wizards are as follows:. Create Customizing Wizard

' lnclude 'Call test procedure (CATT)'

!

Model deadline monitoring

l '. ' Include 'Create object reference'

i

j lnclude 'Execute report'

Figure 102: Other W zards

374 @ Copyright. All rights reserved.

Page 389: SAP Workflow Bit601 en Col10

Lesson: Using Wizards to Define Steps in a Process

You can use this wizard to create a new step that either calls successive tables formaintenance or starts transactions. Actions that are rarely executed, yet are somehowassociated with each other, may be linked in this way, thus making it easier for the user toexecute them.

. Execute report

lntegration of a step in the workflow def inition that calls any ABAP report or ABAPprogram in the system. You can specify the variant to be used. The report can be executedby a user, or the system can execute the report and place the result as an ALV list in anyBusiness Workplace folder.

. Modeldeadlinemonitoring

lntegration of a step that is monitored by the system and executed when a deadline is

reached.

. Calltest procedure (CATT)

lntegration of a step that calls any test procedure. You can start the test procedure and

transfer data (test procedure with import parameters) and call the data after the testprocedure is completed (test procedure with export parameters).

. Choose agent

lntegration of a step to choose agents dynamically from a number of possible agents atruntime.

Wizard - Execution of Reports

The Execute report wizard requires the following inputs:. A report is required.

. A variant is optional.

. The execution type is direct (with or without the selection screen) or in the background(create ALV = ABAP list and store in the Business Workplace folder).

The wizard creates a task and integrates it into the workflow in the following way:

1. Creates a task with reference to the ABAP program

2. Classifies the task as background task or a general task

3. lntegrates task into the workflow definition and creates a binding

The Workflow Wizard or the user can call reports in the SAP Business Workflow withoutcreating a separate object type. The selection criteria use binding to obtain their values fromthe workf low conta iner.

A task is created using the wizard whose container definition corresponds to the input data ofthe report. Therefore, the selection values from the workflow container can be transferred tothe wizard.

A report can only have input parameters.

,,.,;,;:t:t""':t1.;1;11;,, H i n t :

l'::.,1;,,;1 ;1a,',1:11:;.,' lf additional parameters are added to the selection screen of the report or if the

manually. You can, of course, always use the wizard to create a new task'

O Copyright , All rights reserved 375

Page 390: SAP Workflow Bit601 en Col10

Unit 11: Wizards

Execution of test proceduresWizards can be used for preparing test procudures.

Wizards: Execution of test Procedures

. What can the test procure (CATT) do?

- Automate Transactions in SAP Systems

- Transfer parameters to and from transactions

. What input is required?

CATT procedure (test procedure, created using SCAT)

- naming of parameters (optional)

. What does the wizard do?

- Creates task using object method Catt.Execute

lntegrates the task into the workf low definition and creates the binding from theworkflow container to the task container

SAP cannot anticipate and implement all object types required during a workflow project.Either implement the required object types yourself or use one of the following options to callfunctions in the SAP system without implementing an object type:

. lntegration of CATT procedures

. lntegration of reports

The CATT task reflects the parameters of the test procedure exactly as they appear in its taskcontainer. A CATT procedure can have input and output parameters.

., t'r,,, Hint:ir.: '. r,i lf the CATT procedure included in a task is extended by the addition of

parameters (import or export) or if parameters are deleted, the task must beadapted manually or a new task generated with the wizard.

You create CATT procedures with the transaction SCAT by carrying out the following steps:

. You record the required transaction,

. Enter the basic data of the CATTprocedure

. Designate fields on the various screens as input or output parameters

A CATT procedure can automate any transaction in the SAP system (parameters can betransferred and called again).

. What can the CATT object do and what are the specific advantages:

- The CATT object type can start any test procedure in the SAP system

- lt only takes a few minutes to integrate the test procedure into any workflow

- You no longer need to define your own object types to call transactions

376 @ Copyright . All rights reserved.

Page 391: SAP Workflow Bit601 en Col10

Lesson: Using Wizards to Define Steps in a Process

- You can change the generated part of ihe workflow def inition as required

,,',.',,,, To use a CATT procedure

r,: ,, 1. Create a CATT procedure for the transaction in question (if one does not exist already);

Set the import parameters; Test the CATT procedure, check the CATT log file

2. CreaIe a workf low template in the Workflow Builder

3. lnclude the created CATT procedure using wizard: Verify agent assignment; Define

workflow import parameters

4, Create a user decision at the start of the workflow

5, Test the workflow/enler input data

6, Check the CATT log file.

Wizards - Create Object ReferenceWith Create wizard object reference, from the key data, you can create an object reference tothe relevant object in the workflow container. For example, from a request number, you can

create a reference variable for the relevant request object.

The following are some examples of the use of Create Wizard Object Reference:

. Your workflow starts because of a standard event (for example, VBAK.CREATED). The

object type VBAK is a sales document. ln the workflow step, you work with the object type8US2032. From a business point of view, you process a sales order in both cases.

However, from a technical point of view, the object types are different and, at runtime, theengine treats VBAK and BU52032 as two different object types. This means that thebinding is not executed correctly.

. An object type that you use in the workflow contains an attribute ihat contains a key value

for another object type. You want the workflow container to have an object-value attributeand not just the key.

You use the wizard to insert a new task in your workflow. This generated step creates an

object reference for the object type that you require. The wizard asks which object type you

want to work with, and creates a relevant element in the workflow container.

ln the binding from the workf low container to the task container, you transfer the element in

the workflow container that contains the key from the required object to the element

&OBJECTKEY& in the task container. For this, the engine generates a proposal that you mustmaintain. ln the binding from the task container to the workflow container, you transfer theobject reference that you created to the relevant element in the workflow container. The

binding proposal that is generated is correct. However, to be on the safe side, check this.

,l :,.:,:l,'l::ll,.,lll LESSON SUMMARY

:,,.,:.r.rl,.r, You should now be able to:

. Use wizards to define steps in a process

@ Copyright. All rights reserved 377 nilr.yrdc

Page 392: SAP Workflow Bit601 en Col10

Unit 11: Wizards

378 @ Copyright . All rights reserved.

Page 393: SAP Workflow Bit601 en Col10

Learning Assessment

Which of the following statements are true regarding wizards?

Choose the correct answers.

A Wizards ensure that all data is maintained consistently.

B Wizards make complex transactions and processes easier.

C Wizards overload the user with information.

D Wizards have simple screens.

Which wizard can you use to create a new step that calls successive tables formaintenance?

Choose the correct answer.

A Create Customizing Wizard

B Execute report

C Choose agent

D Model deadline monitoring

Tn!!

TTTf

O Copyright. All rights reserved 379

Page 394: SAP Workflow Bit601 en Col10

Assessment - Answers

Which of the following statements are true regarding wizards?

Choose the correct answers.

A Wizards ensure that all data is maintained consistently.

B Wizards make complex transactions and processes easier.

C Wizards overload the user with information.

D Wizards have simple screens.

Z. Which wizard can you use to create a new step that calls successive tables for

maintenance?

Choose the correct answer.

A Create Customizing Wizard

B Execute report

C Choose agent

D Model deadline monitoring

EEnE

ETnn

380 @ Copyright. All rights reserved

Page 395: SAP Workflow Bit601 en Col10

Lesson L'' . .. ---.. r,t- .1.

CreatingtheNotificationofAbsenceWorkflow-'Exercise 27: Create the "Notification of Absence" workflow

Exercise 28: Extend the "Notification of Absence" workflow

Exercise 29: Revise the "Notification of Absence" workflow

Exercise 30: Complete the 'Notification of Absence" workflow

UNIT OBJECTIVES

. Create the notification of absence workflow

r ,,. ', .: , 382,.:.,iril,r.,l: .:.r,.:,. ..,i. 383,.

. ,, 399

,: ,'I i 403.. ' ,,, 407

O Copyright. All rights reserved. 381

Page 396: SAP Workflow Bit601 en Col10

Creating the Notification of Absence Workflow

LESSON OVERVIEW

This lesson contains a tutorial to be carried out in the form of a long exercise.

Business Example

You want a workflow to be started each time an employee fills out a notification of absence.

The employee's superior receives a work item and can make a decision about the request. lf

the request is approved, the employee receives a mail wishing them a nice holiday. lf the

superior rejects the request, the employee can decide whether to withdraw the request or

revise it. lf they withdraw the request, it is deleted from the system in the background. lf the

employee chooses to revise the request, it is displayed for them to change. The request is

then resent to the superior using a loop. The workflow continues to run until the superior

approves the request, or the employee withdraws it. For this reason you require the following

knowledge:

. How to define a workflow with all its components

. How to trigger a workf low using events

. How to test a workf low process

LESSON OBJECTIVESAfter completing this lesson, you will be able to:

. Create the notification of absence workflow

382 @ Copyright. All rights reserved.

Page 397: SAP Workflow Bit601 en Col10

Create the "Notification of Absence" workflow

Business Example:

This exercise is intended to provide practical experience of the workflow tools required tocreate, modify, and test workflow definitions.

You will learn which steps you should carry out to define the standard IaskCreate notificationof absence. Since this is your first standard task, the individual steps are described in detail.Any subsequent definitions of standard tasks are not described in such detail. A standard taskis always a single-step task about an object method.

The subsequent steps in the exercise enhance the workf low definition, utilizing additionalfunctions and step tasks that will be incorporated into the notif ication of absence to make theworkf low def in ition complete.

Create a workflow for a notification of absence. The exercise begins by creating the first step

task. This sends the employee a form to complete and send to the manager for approval.

The next step is the approval step, which sends the completed form to the correct agent forapproval. Additional steps are also determined as a consequence of the manager decision(approval or rejection) in the workflow def inition. Depending on what the manager decides,

the workflow is either continued or completed, or the notification of absence is returned to the

initiator for further action (revise or cancel request).

Task I1. Start from the SAP Easy Access screen, choose fools --+ SAP Buslness

Workflow --+ Development ---+ Definition fools --- Tasks/Task groups.

2. Enter the basic data for the workflow template.

Abbr.:zwF_NoA_## and Namelworkflow notification of absence ##

3, Maintain the agent assignment attribute of the workflow template as 'General Task'.

Assign the tasks and workflows to each possible agent.

Choose Additional Data ---+ Agent Assignment ---+ Maintain. This displaystheWorkflowTemplate: Maintain Agent Assignment screen.

Task 2

1. ln the SAP Easy Access menu, inlheTask/Task Group folder, choose Create.

2. Entries for basic data: rt Create **, Create notif . of absence in the respective

field.

3. Entries f or Object type and Method - FoRr'IABsENc, cREATE in the respective f ields.

@ Copyright. All rights reserved.

Page 398: SAP Workflow Bit601 en Col10

Unit 12: Tutorial

4. Enter Create vacation request ## in the Work item text f ield. As soon as the work

item for the task Create notif ication of absence is received in your inbox, the work item

text appears as an information text in the Buslness Workplace lnbox

5. Maintain agent assignment of the task as a general task,

Task 3

The Workftow Buitder is used to create the workf low definition. You have already created your

workflow template. You will now starlto create the relevant workflow definition.

1. Start f rom the SAP Easy Access meriu. Choose Change in the folder Tasks/Task Groups,

and then choose lhe workflow template you have already created. Use the following steps

to select Ihe workflow temPlate:

2. CreaIe an activity as a step in the workflow definition'

r'r."r.." r. Hint:

The Workf low Builder has a node area f or objects that can be inserted into

your workflow definition. You can add new steps from this area to your

workflow definition by using the Drag&Drop function.

3. Enter control data. Use the created task.

4. Check the binding.

5. Entries for responsibilities: WF-INtTIATOR, Create notification of absence'

6, Complete the step definition.

Task 4

1. you can now perform the first test on the workflow template you have created.

Task 5

1. Definethe StandardTask: check notification of absence'

2. Entries for basic data: rs_ctreck-##.

3. Entries for the object method: FoRl'lABsENc' APPRovE.

4, Enter aWorkitemtext:Check notification of absence #*'

5. Define an agent: Chief position of the group specific org unit for the course. First save all

your previous entries

6. Display your organizational plan again.

Task 6

you have already created a workflow template. You then integrated a standard task for ihe

Create notification of absence step into the workflow definition. You will now continue by

integrating the standard task Check notification of absence into the workf low definition.

384 @ Copyright . All rights reserved

Page 399: SAP Workflow Bit601 en Col10

Lesson: Creating the Notification of Absence Workflow

1. Start from the SAP Easy Access menu. Choose Iools --- Buslness

Workftow --+ Developm€fit ---+ Def inition fools ---+ Tasks/Task Groups ---+ Change ' Choose

the workflow template that you created earlier in the exercise. Use the following steps to

select the workflow template:

2. Creale an element inthe Workflow Container.

3. Create an activity as a step in the workflow def inition: Use the approval task that you

created.

4. Enter the basic control data.

5, Define the binding. Choose Ihe Binding pushbutton. This displays the screen Binding for

Step.

6. Define the outcome.

The APPROVE method, referred to in the task definition, has one result parameter that can

assume three different values. Depending on these values, the Check notification of

absence activity can have three different subsequent outcomes, that is reiected, approved,

and New.

7. Entries for responsibilities: Superior of the workflow initiator (applicant).

Note:Define the responsible agents for each step. lf you do not define any

responsible agent for the process step, the agent is offered to all of the

employees (that were defined as possible agents of the single-step task Check

notification of absence) for processing.

During the definition of the standard task, you def ine possible agents for the

single-step task Check notification of absence. Ensure that the user assigned

to the position of manager in the organizational structure is the responsible

agent for the approval step 1tz-check-##) .

B. Complete the steP definition.

Task 7

you can now perform the second test on the workf low template you have created. Before

doing this, log on as both B/I6OJ -## and B\T601-MGR## . From the SAP Easy Access screen,

as 8IT601-##, choose Start Workflow (Test Environment), and then choose the Refresh

Organizational Environment pushbutton'

L. Start the workflow template and complete the form.

Z. As 8.T601-## (requester), call the Business Workplace from the test environment (swus).

Open the Outboxfolder and choose Started Workftows. The window with the list of Siarted

workflows is displayed. This list also contains an entry for your current workflow

zwF_NoA##,

3. lntegrated lnbox - Check the notification of absence'

@ Copyright, All rights reserved .*ffi

Page 400: SAP Workflow Bit601 en Col10

Create the "Notification of Absence" workflow

Business Example:

This exercise is intended to provide practical experience of the workflow tools required tocreate, modify, and test workflow definitions.

You will learn which steps you should carry out to def ine the standard task Create notificationof absence. Since this is your f irst standard task, the individual steps are described in detail.Any subsequent definitions of standard tasks are not described in such detail. A standard taskis always a single-step task about an object method.

The subsequent steps in the exercise enhance the workflow definition, utilizing additionalfunctions and step tasks that will be incorporated into the notification of absence to make theworkf low def inition complete.

Create a workflow for a notification of absence. The exercise begins by creating the first steptask. This sends the employee a form to complete and send to the manager for approval.

The next step is the approval step, which sends the completed form to the correct agent forapproval, Additional steps are also determined as a consequence of the manager decision(approval or rejection) in the workflow definition. Depending on what the manager decides,the workflow is either continued or completed, or the notification of absence is returned to theinitiator for further action (revise or cancel request).

Task 1

1. Start from the SAP Easy Access screen, choose loois -' SAPBuslnessWorkflow -+ Development ---, Definition Tools - Tasks/Task groups.

a) On the SAP EasyAccess screen, choose fools -- SAP EuslnessWorkflow - Development ---+ Definition fools -- Tasks/Task groups --+ Create.

b) On the lask; Maintain screen, enter the following data:

Field Name Entry

Task type lrlorkflow tenpJ-ate

Task zwE noa_## (## represents groupnumber)

c) Choose IheCreate pushbutton.

Enter the basic data for the workflow template.

Abbr.:zwF_NoA_** andNameiworkflow notification of absence ##

a) On lhe Workf low Template: Create screen, on the Basic data tab page, enter thefollowing data:

2.

386 O Copyright . All rights reserved.

Page 401: SAP Workflow Bit601 en Col10

Lesson: Creating the Notification of Absence Workflow

Field Name Entry

Abbr. zwF_NoA_##

Name Workflow notification ofabsence zwF NOA ##

b) Choose Save.

c) ln the Create Object Directory Entry dialog box, enter zool in the Package field.

d) Choose Save.

e) Depending on the system settings, assign this object to the relevant transport request

3. Maintain the agent assignment attribute of the workflow template as 'General Task'.

Assign the tasks and workflows to each possible agent.

Choose Additional Data ,-- Agent Assignment --+ Maintain. This displaysthe Workflow

Template: Maintain Agent Assignment screen.

a) On lheWorkflow Template: Change screen, choose Additional Data --+ AgentAssignment ---+ Mai ntai n.

b) On the Workflow temptate: Maintain Agent Assignment screen, choose Workflow

notification of absence ZWF-NOA-## in the Name field.

c) Choose lhe Attributes pushbutton.

d) ln the lask; dialog box, select lhe GeneralTask radio button and choose lheTransferpushbutton.

e) Go back to the Workftow Template: Change screen and choose Save.

H int:ln the first step of the exercise, you created the workf low template that is

the prerequisite for creating and enhancing the notification of absence

workflow definition. Carry out the following steps to build the notificationof absence workflow.

Task2

1. ln the SAP Easy Access menu, tntheTask/Task Group folder, choose Create.

a) On the SAP Easy Access screen, choose fools -' BuslnessWorkftow ---+ Development ---+ Definition fools --- Tasks/Task Groups -- Create.

b) On the fask; Maintain screen, enter the following data:

c) Choose lhe Create pushbutton.

Field Name Entry

Task type Standard task

Task T1 Create #*

O Copyright. All rights reserved.

Page 402: SAP Workflow Bit601 en Col10

Unit 12: Tutorial

2. Entries for basic data: rt Create ##, create notif . of absence in the respective

field.

a) Choose the object category as BO.

b) On the Standard Task: Create screen, on the Basic data tab page, enter the followingdata:

Field Name Entry

Abbr. T1 Create ##

Name Create notif. of absenceT1 Create ##

3. Entries f or Object type and Method - FoRI'rABsENc, CREATE in the respective fields.

a) On the Standard Task: Create screen, on the Basic data tab page, enter the followingdata:

Field Name Entry

Object Type FORT{AIISENC

Method CREATE

b) Press ENTER.

4, Enter Create wacation request #* in the Work item texf f ield. As soon as the work

item for the task Create notification of absence is received in your inbox, the work itemtext appears as an information text in the Business Workplace lnbox.

a) On lhe Standard Task: Create screen, on the Basic data tab page, enter createvacation request inlhe Workitem text field.

b) Choose Save.

c) On the Create Object Directory Entry dialog box, choose the relevant transport request.

5, Maintain agent assignment of the task as a general task.

a) On the Standard Task: Change screen, choose Additional Data - AgentAssign m ent ---+ M ai nta i n.

b) On the Standard Task: Maintain Agent Assignment screen, choose Create notifi. ofabsence in the Name field.

c) Choose lhe Attributes pushbutton.

d) lnthefask:dialogbox,selecttheGeneralTaskradiobuttonandchooselheTransferpushbutton.

e) Go back to the Standard Task: Change screen and choose Save.

388 @ Copyright , All rights reserved

Page 403: SAP Workflow Bit601 en Col10

Lesson: Creating the Notification of Absence Workflow

i Hint:"i , ,.i Defining your task as a General task means that every employee has- :"i

authorization to create a notif ication of absence. Further entries forpossible agents and other additional dala are not required at this point.

You have now fully defined your first standard task. save your work and

then return to the SAP Easy Access menu.

Task 3

The Workflow Buitder is used to create the workflow definition. You have already created your

workf low template. You will now start to create the relevant workflow definition.

1. Start from the SAP Easy Access menu. Choose Change in the folder Tasks/Task Groups,

and then choose Ihe workftow template you have already created. Use the following steps

to select Ihe workflow temPlate:

a) On the SAP EasyAccess screen' choose Iools -+ Business

Workftow ---+ Development --+ Definition fools --+ Tasks/Task Groups -+ Change'

b) On the lask; Maintain screen, enter the following data:

Field Name Entry

Task type Workflow template

Task zwF_NOA ##

. .. "i,ir, . Hint:

,,,,,, :r ln the Searc h Term field, enter either the entire abbreviation of your

workflow template or your group number to restrict the selection of tasks

(for example , zwt*) and conf irm your entry.

lf several workflow templates match the search term entered, a Iist is

displayed from which you can select your workflow template. lf only one

workflow template is found, its unique identification number is entered

automatically in the Iask input field in the lask: Maintain screen.

c) On the lask; Maintain screen, choose lhe Change pushbutton'

d) On lhe Workflow Template: Change screen, choose the Workflow Builder pushbutton.

2. Creale an activity as a step in the workflow def inition.

Hint:The Workf low Builder has a node area f or objects that can be inserted into

your workflow definition. You can add new steps from this area to your

workflow definition by using the Drag&Drop function.

O Copyright. All rights reserved 389

Page 404: SAP Workflow Bit601 en Col10

Unit 12: Tutorial

a) ln the Step Iypes That Can Be lnserted pane, choose lhe Activity pushbutton and useDrag&Drop to drag it to the undef ined step in the Graphical Model part of the WorkflowBuilder. You are now in the step that should use the Create notification of absence task.

3. Enter control data. Use the created task.

a) ln the Task field, enter the lD (rs<B disit nunber)) of the standard task.

Hint:lf you no longer know the lD, use can search using the task abbreviation.This displays the dialog box Search and Find: fasks screen. Select theIask tab.

Enter your chosen abbreviation or group number as the search criteria foryou r standard task Create notif ication of absence . lf you only enter thefirst few characters of your abbreviation, you get a list of tasks from whichyou can choose the task required. Select your task in the list and clickTransfer. Each activity, as a step in a workf low definition, refers to a task.

Press ENfER to confirm your entries.

Review the proposed binding of workflow and task containers and press ENfER toproceed.

lf the Define Container Elements and Binding screen is not displayed, click the red andwhite ball next to the binding, Review the proposed binding between workflow and taskcontainers and press ENTER to proceed.

On the Controltab page, enter Fil:- out Notification in the Step name field.

On the Outcome tab page, enter Fi]-]- out Notificat'ion of Absence in theDescrptlon f ield.

.1,,,.. ""::, Hint:tt.::lll ,,.i: ln the Workflow Builder:

Step name: The current step in your workfiow definition appears underthe name entered here.

Outcome: At least one outcome follows each step. The name of thisoutcome(s) is the name used for the outcome in the workflow definition.

4. Check the binding.

a) On lhe Controltab page, choose the Binding (Exists) pushbutton.

b) On the Binding forStep screen.

A container element, which can contain a reference to the object notification ofabsence is created automatically in the workflow container. The element is calledAbsenceForm and refers to the FORMABSENC object type.

A binding is defined automatically, You can define the binding between the taskcontainer and the workflow container in two directions:

Workflow container ==> Iask container (lower part of screen)

b)

c)

d)

e)

D

390 @ Copyright , All rights reserved.

Page 405: SAP Workflow Bit601 en Col10

Lesson: Creating the Notification of Absence Workflow

Workflow container <=- Task container (upper part of

The definition of the containers is displayed in the top

screen)

half of the screen.

r.r,i.'-.,:r,,:,,., Hint:

The CREATE method referred to in your Create notification of absencetask creates a form that will be submitted to the supervisor for approvallater in the workflow. The reference to the notificaiion of absence createdmust be known in the workflow container.

To achieve this, define a binding from the task container to the workf lowcontainer. This happens by assigning a notification of absence ==>&AbsenceForm&, that was created automatically. The other bindingdirection is not relevant for this step.

c) Go back lolheWorkflow Builder - Change screen.

5. Entries for responsibilities: WF_lNlTlATOR, Create notification of absence.

a) On lheControl tab page, choose Expression as agent,

b) Position your cursor in the input field for Expression.

c) Choose Workflow initiator (expression).

6. Complete the step definition.

a) Choose the Syntax check f unction and return to lhe Workflow Builder screen.

Hint:To display your workflow fully in the display area, you may have to adjustthe view in the navigation area. When your entire workflow is shown in thedisplay area,you can position the mouse on an event or step. The relevantname is displayed in the lower screen border.

b) Activate your workflow definition.

Task 4

L. You can now perform the first test on the workflow template you have created.

a) On Ihe Workflow Builder screen, choose the Iest pushbutton.

b) On the fest Workflow screen, choose the Refresh Organizational Environmentpushbutton.

c) Choose the Execufe pushbutton.

d) On lhe Create Notification of Absence screen, enter the following data:

Field Name From To Leave Type

Leave 7 ctroose a day 10days in thefuture

add 1 day tothe dateentered in "By"

Vacation

@ Copyright. All rights reserved 391

Page 406: SAP Workflow Bit601 en Col10

Unit 12: Tutorial

Field Name From To Leave Type

Leave 2 choose a day,2O days in thefuture

add 10 days tothe dateentered in "By"

Special Leave

Choose Save.

Go back to the SAP EasyAccess screen.

Task 5

1. Define the Standard Task: Check noti-fication of absence.

a) On the SAP Easy Access screen, choose fools * BuslnessWorkflow ---+ Development ---+ Definition fools --- Tasks/Task Groups --+ Create.

b) On the fask: Maintain screen, enter the following data:

c) Choose the Create pushbutton.

2. Entries for basic data: ts_check_#*.

a) On the Standard Task: Create screen, enter the following data:

Field Name Entry

Abbr. T2 CI{ECK ##

Name Check notification of absence(T2 Check 28)

3. Entries for the object method: FoRMABSENc, AppRovE.

a) On the Standard Task: Create screen, in the Oblect method pane, enter the followingdata:

Field Name Entry

Object Type FORMABSENC

Method APPRO\/E

b) Choose Save,

c) ln the Create Object Directory Entry dialog box, enter zool in the Package field.

d) Assign the object to the relevant transport request if requested.

4. Enter aWork itemtext'.check notification of absence *#.

a) On the Standard Task: Changescreen, entercheck notification of absence inlhe Work item text Iield.

e)

D

Field Name Entry

Task type Standard task

Task T2_Check_##

392 @ Copyright. All rights reserved,

Page 407: SAP Workflow Bit601 en Col10

Lesson: Creating the Notification of Absence Workflow

Choose the insert variable pushbutton.

ln the Se/ect Expression dialog box, choose formabsenc or &-Wl-Obiect-lD& in the

Expresslon field.

Hint:

Use the function swifch Disptay: TechnicalName/Description to change

between a technical and a semantic view of the possible expressions' ln

the technical view, you can see that the name refers to the attribute name

for the creator object, which in turn is an attribute for the AbsenceForm

object.

d) Choose Continue.

e) Go back to the Standa rd Task: Change screen.

you return to the Stand ard Task: Change screen. The &-W-OBJECT-ID.CREATOR.ID&

parameter has been added automatically to the work item text. The & symbol marks

the position in the text where the parameter will be inserted'

f) Choose Save.

5, Define an agent: Chief position of the group specific org unit for the course' First save all

your previous entries.

a) on the standard Task: change screen, choose Additional Data -, Agent

Assignment -'-+ Maintai n.

b) On the Standard task: Maintain Agent Assignment screen, choose Check notification of

absence in the Name field.

c) Choose Agent Assignment --+ Create.

d) On the Choose agent type dialog box, choose Position in the Oblect type f ield.

e) Enter a search term containing part or all of your abbreviation for your position of

department head. lf the abbreviation you entered was unique, the position is

transferred immediately, otherwise select your manager position from the hit list.

f) Go back to the Standard Task: Change screen.

g) The LaskCheck notification of absence has now been defined completely.

h) Choose Save.

6, Display your organizational plan again.

a) On the SAP EasyAccess screen, choose Iools -- Business

Workflow --+ Development ---+ Definition Ioois -- Organizational

Management '-+ Organizational Plan -' Display'

b) Choose Organizational unit'

c) ln the Find organizationalunit dialog box, enter zwF_oRG-+# in the with name field.

d) ln the Task Assignment pane, choose Change documents for material, group ## '

e) Go back to the SAP Easy Access screen'

Task 6

b)

c)

O Copyright . All rights reserved.

Page 408: SAP Workflow Bit601 en Col10

Unit 12:Tutorial

You have already created a workflow template. You then integrated a standard task for theCreate notification of absence step into the workflow definition. You will now continue byintegrating the standard task Check notification of absence into the workf low definition.

1. Start from the SAP Easy Access menu. Choose lools --+ BuslnessWorkflow --- Development -t Definition Tools --, Tasks/Task Groups --' Change. Choosethe workflow template that you created earlier in the exercise. Use the following steps toselect ihe workflow template:

a) On the SAP EasyAccess screen, choose fools --+ BusinessWorkflow -- Development --+ Definition fools --- Tasks/Task Groups --+ Change.

b) On the fask: Maintain screen, enter Workf low template in Iask type f ield.

c) ln the lask field, position your cursor in the input field and search using the z*NoA*field.

d) Choose Task + Change.

e) On the Workflow Template: Change screen, choose Gofo --+ WorkflowBuilder - Current Version.

2. Creale an element inlhe Workflow Container.

a) On the Workflow Builder - Create 'ZWF_NOA_##'screen, on the left hand side of thescreen, choose Workflow Container in the Se/ectlon menu.

b) ln the element f ield, choose <Double-Click to Create>.

c) ln the Create Container Element dialog box, enter the following data:

Field Name Entry

Element Auttrorizer

Name Authorizer

Short Description Authorizer of the notificationof absence

d) On lhe D.Type tab page, select lhe ABAP Dict. Reference radio button, enter thefollowing data:

Field Name Entry

Structure WFSYST

Field AGENT

e) Choose lheTransfer pushbutton.

f) Element Authorizer has been created.

3. Create an activity as a step in the workflow definition: Use the approval task that you

created.

a) On the Workflow Builder - Create 'ZWF_NOA_##'screen, on the left hand side of thescreen, choose Activity in the Se/ectlon menu.

b) Use the Drag&Drop function, drag the step type to the outcome for your Notification ofabsence step.

394 @ Copyright . All rights reserved.

Page 409: SAP Workflow Bit601 en Col10

Lesson: Creating the Notification of Absence Workflow

4. Enter the basic control data.

a) on lhe workflow Builder - create 'zwF_NoA_##'screen, enter rs<g-digitnumber) in the lask f ield.

b) Press ENTER.

c) ln the Define Container Elements and Bindings dialog box, choose Ihe Continuepushbutton to confirm the binding.

d) The APPROVE method of the FORMABSENC object type referred to in the standard

task definition has a specific result parameter defined using a Data Dictionary f ield.

The confirmation of your task entry transferred the following information into the

def inition of the outcome for your activity:

The step name was transferred from the definition of your standard task

e) On the Outcomes tab page, Approved, Rejected, and New outcome are displayed in the

Outcome field.

f) On the Controltab page, enter check notification of absence in the Step Name

f ield.

5. Def ine the binding. Choose Ihe Binding pushbutton. This displays the screen Binding for

Step.

a) Binding can be defined in two directions if required. First, from the workflow container

to the task container and, second, from the task container to the workflow container.

&F or m absenc& => &-W l-O BJ ECT -l D&

&F o r m absenc& <= &-W I -O

BJ ECT -l D&

. ,r ,,,..t. Hint:,,,.,,.rr , The first entry defines a binding from the workflow container to the task

container. This ensures that the task. check notif ication of absence

knows which object is involved.

The second entry defines a binding from the task container to the

workflow container. This ensures that any data created as a result of the

step task is transferred to the workflow container for the subsequent step

in the workflow definition.

A further binding definition must be executed in which the actual agent of

the work item, for example, the superior, is stored in an element of theworkflow container.

All of the task container elements are displayed on the right of the screen. You can use

these elements for other definitions. The name of the agent of the work item is

available in the eleme nI Actually Proc. by (element name: -wI-Actual-agent)

of the

task container after the work item has been executed. Choose the Technical view

on/off pushbutton to see the technical name for the element wt-actual-Agent.

To define the binding from the task container to the Workflow Container, use

Drag&Drop to drag a binding from the Actuat Agent element to the Autho rizer elemenl

in the W orkf low Contai n er.

b)

@ Copyright . All rights reserved 3% rf,fr' --t,

Page 410: SAP Workflow Bit601 en Col10

Unit 12: Tutorial

c) ln the Define Contarner Elements and Binding dialog box, &Authorizer& <= Actual Agentis defined.

d) Choose the Exit Binding Editor (Enter) pushbutton to exit the screen.

6, Define the outcome.

The APPROVE method, referred to in the task def inition, has one result parameter that canassume three different values. Depending on these values, the Check notification ofabsence activity can have three different subsequent outcomes, that is rejected, approved,and Nerv.

a) ln the Navigation area pane, double-click Check notif of absence.

b) On Outcomes tab page, select lhe Approved, Rejected, and New checkboxes.

c) Choose the Outcome used pushbutton in the Actlon f ield and return lo lhe WorkflowBuilder.

d) Choose Back.

e) ln the Save Sfep dialog box, choose Yes. lt informs you that the subsequent outcomeincludes steps, which have already been created. These steps will now be deleted.

Now two branches have been inserted into your workflow definition for the twoselected outcomes (Rejected and approved). There is no longer a branch for the Neuz

outcome.

7, Entries for responsibilities: Superior of the workflow initiator (applicant).

'i1".::. Note:ii3..r€':' Define the responsible agents for each step. lf you do not def ine any

responsible agent for the process step, the agent is offered to all of theemployees (that were defined as possible agents of the single-step task Checknotification of absence) for processing.

During the definition of the standard task, you define possible agents for thesingle-step task Check notification of absence. Ensure that the user assignedto the position of manager in the organizational structure is the responsibleagent forthe approval step (tz check *#).

a) ln the Navigation area pane, double-click Change notif of absence.

b) ln the Controltab page, choose Superior of workflow initiator (rule) in the Agents pane.

c) Choose the Binding (Exists) pushbutton.

d) The binding fills the ORG_OBJECf element in the rule container from the

-WF_INITIAfOR element in the Workflow Container.

e) Go back to theWorkflow Builder screen.

8. Complete the step definition.

a) On lhe Workflow Builder - Change 'ZWF-NOA-##' screen, check your workflowdef inition.

b) Activate the workflow def inition.

396

TaskT

@ Copyright , All rights reserved

Page 411: SAP Workflow Bit601 en Col10

Lesson: Creating the Notification of Absence Workflow

You can now perform the second test on the workf low template you have created. Before

doing this, log on as both B/f60J -## and B|T60J-MGR##. From the SAP Easy Access screen,

as BlT60l-##, choose Start Workflow (Test Environment), and then choose the Refresh

Organizational Environment pushbutton.

1. Start the workf low template and complete the form.

a) On the SAP EasyAccess screen, choose fools -+ Business

Workflow --+ Development --+ Runtime fools ---' Test Workflow

b) On the fest Workflow screen, choose the Refresh Organizational Environmentpushbutton. Find your workflow using zwf_noa *#.

c) Choose Execute.

Alternatively, you can branch directly from the Workflow Builder to start a workf low by

choosing Workf low ---+ fest or the Iest pushbutton. The task number is already

determined.

d) From the perspective of the applicant (User lD 8lT601-##), when the workf low is

started, the work item for creating the notification of absence is displayed

immediately. The reason for this is that subsequent work items can be startedimmediately. You were introduced to this in the first test. The Create Notification ofAbsence screen is displayed. Complete and save the form.

e) From the perspective of the head of department (User lD B\T601-MGR##), the

workflow becomes corrupt if you start it as a manger. This is because a chief position

does not exist for the manager. However, you can process the employee request. As

the superior, you have several options. You can approve the application, reject the

application, and cancel processing of the application'

f) Choose Ihe Cancel pushbutton.

Hint:At this point in the first test of your workflow template, you were

introduced to work item analysis. You are now going to work with theworkflow outbox. The work items that you started in the dialog with date,

time, and current status are displayed in the workflow outbox.

2. As BIT6OJ-## (requester), call the Buslness Workplace from the test environment (swus).

Open the Outbox folder and choose Started Workftows. The window with the list of Started

workflows is displayed. This list also contains an entry for your current workflow

zwF_NoA#*.

a) Double-click on the entry.

b) On the fest Workflow screen, choose theWorkflow Log pushbutton'

c) On the Workflow notification of absence ZWF-NOA screen, choose the Log pushbutton'

d) On IheWorkflowLogscreen, Workflownotificationof absenceZWF-NOA hasthestatus/n process. The step Fitt out notification was completed without errors. You can also

view a list with technical details by choosing the Llst with technical details pushbutton'

e) Exit lhe Workflow Log screen andworkflow outbox and go back to the SAP Easy Access

screen.

@ Copyright . All rights reserved 397

Page 412: SAP Workflow Bit601 en Col10

Unit 12:Tutorial

3. lntegrated lnbox - Check the notification of absence.

a) You now resume the role of the superior 8lT601-MGR## who canceled the processing

of the leave request earlier when the notif ication of absence was to be checked.

b) Choose the Buslness Workplace /nbox using Office - Workplace and choose Inbox.

c) Choose Workflow to call the work list (the workflow-specific part of the inbox).

d) Select the work item for approving the notif ication of absence and double-click thesymbol (small checkmark) in the Execute field to execute the work item.

e) On the Approve or Reject Notification of Absence screen, you can decide whether youwant to choose the Approve or Reject pushbutton to approve or reject the application.Start the workflow twice and test each variant.

f) To check that the workflow was completed correctly, call the workf low log for yourworkflow.

g) ln the This Work ltem Has To Be Completed Explicitly dialog box, choose lhe CompleteWork ltem pushbutton.

398 @ Copyright. All rights reserved.

Page 413: SAP Workflow Bit601 en Col10

Extend the "Notification of Absence" workflow

lf the department head rejects the application, the employee should have the opportunity torevise and resubmit the notification of absence. ln this situation, a user decision can be

integrated into the workflow def inition as a step.

Task 1

User decision

Start from the SAP Easy Access menu and choose: fools -' Business Workflow ---+

Development ---+ Definition Tools Tasks/TaskGroups ---+ Change

1. Choose the workflow template (ZWF-NOA##) that has already been created. Then go to

the Workflow Builder. lf the request is rejected, you need to send a user decision to the

originator of the request with the title: Your application was rejected by &, change?

2. Creale a user decision as a step in the workflow def inition'

3. Enter basic data for a user decision: Decision texts: Revise request? Withdraw request

4. Change the step name.

5. Entries for responsibilities: WF-INITIATOR

6. Complete the step definition.

The individual steps required to carry out this test are described in an overview. lf this

information is not sufficient, check the instructions for the previous test.Task 2Test the user decision step 'notification of absence".

Hint:Remember that you will be using both SAP logons to execute your test, that is,

you will be switching between the "Applicant" and "Manager" logon sessions forthe appropriate steps when you execute the workflow.

From the applicant's perspective: To start the workf low, choose Tools Business Workf low

Development Runtime Iools fest Workflow. Select your workf low template

From the superior's perspective: reject the application

From the applicant's perspective: check the three options

2.

3.

@ Copyright. All rights reserved.

Page 414: SAP Workflow Bit601 en Col10

Extend the "Notification of Absence" workflow

lf the department head rejects the application, the employee should have the opportunlty torevise and resubmit the notification of absence. ln this situation, a user decision can beintegrated into the workf low definition as a step.

Task 1

User decision

Start from the SAP Easy Access menu and choose: fools --+ Business Workflow --+

Development ---+ Definition Tools Tasks/TaskGroups ---+ Change

1, Choose the workf low template (ZWF_NOA##) that has already been created. Then go tothe Workflow Builder. lf ihe request is rejected, you need to send a user decision to theoriginator of the request with the title: Your application was rejected by &, change?

2. Creale a user decision as a step in the workflow definition.

a) Click on User Declsion in the Step Types That Can Be lnserted area.

b) Using Drag&Drop, drag the cursor to the Reiected outcome. This inserts the requiredUser decision step type into the workflow definition. The screen for defining a userdecision in the standard mode is displayed.

3, Enter basic data for a user decision: Decision texts: Revise request? Withdraw request

a) On the Declslon tab page, enter a text in the input field litle. lt will appear at runtime asthe heading of the dialog box with the decision options. Title: Your application wasrejected by &. Change? The & symbol is a placeholder for parameters that areassigned a value at runtime.

b) Position the cursor on the ParameterT input f ield, and use the input help (Fa) to call thepossible entries. This displays the Expression dialog box for the first parameter of theuser decision.

c) Choose the Authorizer container element that you have created.

d) Enter the decision texts as follows:

Decision texts Event name

Revise request? Request revised

Withdraw request? Request withdrawn

400 @ Copyright. All rights reserved

Page 415: SAP Workflow Bit601 en Col10

Lesson: Creating the Notification of Absence Workflow

Hint:The decision texts you can enter here will appear as possible decisions in

the work item, which the applicant can process after his or her request for

leave has been rejected.

,,,. Hint:

:: .r, The event names are the terms that describe your events in the workf low

def inition.

4. Change the step name.

a) On the Controltab page, enter a text for the step name. Step name: Decision: Revise -

Withdrawn

5, Entries for responsibilities: WF-INITIATOR

a) From the Declsion tab page, in the category Agents,choose Expresslon from the pull

down menu.

b) PositionyourcursorintheinputfieldExpression,anduseF4tocallthepossibleentries. Choose Workftow instance initiator (expression).

c) Return to the Workflow Builder.

6. Complete the step definition.

a) Test your workflow

b) Activate your workflow

c) You can now subject your workflow definition to another test'

The individual steps required to carry out this test are described in an overview. lf this

information is not sufficient, check the instructions for the previous test'Task 2Test the user decision step "notification of absence".

Hint:Remember that you will be using both SAP logons to execute your test, that is,

you will be switching between the "Applicant" and "Manager" logon sessions for

the appropriate steps when you execute the workf low.

1. From the applicant's perspective: To start the workf low, choose Tools Business Workflow

Development Runtime fools fest Workflow. Select your workflow template

a) Start your workflow template. The form is displayed for processing. Complete and

save the form.

b) When you have saved the form, switching logon session to the applicant's manager

allows you to directly approve or reject the request (because subsequent work items

are started immediatelY).

@ Copyright . All rights reserved 401

Page 416: SAP Workflow Bit601 en Col10

Unit 12: Tutorial

2. From the superior's perspective: reject the application

a) Reject the request

b) Exit the screen

c) You have integrated the user decision as a subsequent step into the workflowdefinition in case the application is not approved. The applicant was entered as theagent for ihis step.

d) the applicxant's workplace

3. From the applicant's perspective:check the three optionsa) You have three options: "Revise reguest" or "Withdraw request" or "Cancel" and keep

the work item in the inbox

b) Since you have not def ined any follow-up steps, it does not matter wheter you chooserevise or withdraw. lf you choose Cancel, this workitem remains in your inbox. Start theworkflow several times and test the various options.

c) You can check the processing each time in the workflow log using either work itemanalysis or the workflow outbox.

402 O Copyright . All rights reserved

Page 417: SAP Workflow Bit601 en Col10

Revise the "Notification of Absence" workflow

ln the preceding steps, you defined the 'Notification of Absence" workflow in such a way thatyour workflow would initiate the creation of the Notif ication of Absence form and send the

form for the manager's approval. ln this exercise, you will enhance your workflow definition to

allow the initiator the option to revise his or her application after the manager has initially

rejected it.

Task IDefine the standard task 'Change Notification of Absence".

L. From the SAP Easy access menu, choose ToolsBusiness WorkflowDevelopmentDefinition

ToolsTask/Task Groups and then Create.

Basic data: T3-Revise-##, Revise notification of absence

Object type: FORMABSENC, Update

work item text: Revise request

Agents: General task

Task 2lntegrate "Revise notif ication of absence" into the workflow definition. You have already

created a workflow template and integrated several steps into the workflow definition. You will

now continue by integrating the standard task "revise notification of absence" into the

workflow definition.

1. Start from the SAP Easy Access menu. Choose Change in the folder foolsBuslness

WorkftowDevelopmentDefinition ToolsTask/Task Groups, and then choose the workflow

template you have already created. Use the following steps to select the workflow

template:

2. Creale an activity as a step in the workflow: Use the "revise notification" task if the

employee wants to review their request'

3. Check the binding.

4, Entries for Agent: WF-lNlTlATOR,/applicant.

5. Complete the step definition.

6. Fourth test: "Revise notification of absence". You can now perform another test on your

workflow definition. lf you have any questions regarding the procedure, refer to the

previous units that describe how to test the workflow def inition.

@ Copyright. All rights reserved.

Page 418: SAP Workflow Bit601 en Col10

Revise the "Notification of Absence" workflow

ln the preceding steps, you defined the "Notification of Absence" workflow in such a way thatyour workf low would initiate the creation of the Notification of Absence form and send the

form for the manager's approval. ln this exercise, you will enhance your workf low def inition to

allow the initiator the option to revise his or her application after the manager has initially

rejected it.Task 1

Define the standard task 'Change Notification of Absence".

1. From the SAP Easy access menu, choose ToolsBusiness WorkflowDevelopmentDefinition

ToolsTask/Task Groups and then Create.

Basic data: T3 Revise ##, Revise notif ication of absence

Object type: FORMABSENC. Update

work item text: Revise request

Agents: General task

a) Choose: fools -- Business Workflow --+ Development --+ Definition Iools + Tasks/Task

Groups.

b) Double Click Create. This displays the Task: Maintain screen'

c) Select the task type Standa rd task in the lask type field'

d) Choose Create. You return to the Standard Task: add screen'

e) Entries for basic data: Describe the standard task to be created in the fields Abbr' and

Name. Abbr.: <T3-Revise -##, Name:<Revise notif . of absence (T3-Revise-##)>

f) Entries for the object method: Enter FORMABSENC in the oblect type f ield.Enter

UPDATE in the method field,

g) Enter a work item text: ln the work item text field, enter the following text for the

work item: Revise notification of absence.

h) Define an agent: First save all entries made so far.

i) Choose AdditionatdataAgent AssignmentMaintain. You return to the Standard Task:

Maintain Agent Asstgnment screen.

j) Position the cursor on the name of the standard task.

k) Select the funciion Properties. This dlsplays the lask; maintain......

l) Choose GeneralTask and CoPY

404 O Copyright . All rights reserved

Page 419: SAP Workflow Bit601 en Col10

Lesson: Creating the Notification of Absence Workflow

m) Choose Back.f he "Revise notif ication of absence" standard taks has been f ullydef ined.

Task 2lntegrate "Revise notification of absence" into the workflow definition. You have alreadycreated a workflow template and integrated several steps into the workflow definition. You willnow continue by integrating the standard task "revise notification of absence" into theworkflow definition.

1. Start f rom the SAP Easy Access menu. Choose Change in the folder foolsBuslnessWorkflowDevelopmentDefinition ToolsTask/Task Groups, and then choose the workf lowtemplate you have already created. Use the following steps to select the workflowtemplate:

a) Double-click Change in the Folder Task/Task Groups. This displays the lask: Maintainscreen .

b) Call your workflow template. lf necessary, find it using the Z*NOA* abbreviation.

c) ChooselaskChange orsimply choose Change. This displaystheWorkflowTemplate:Change screen. Choose Goto --+ Workflow Builder --+ Current version, or simply chooseWorkflow Builder. The Workf low Builder is displayed. Adjust the navigation area so thatthe entire workflow can be seen in the display area.

2. Create an activity as a step in the workflow: Use the "revise notif ication ' task if theemployee wants to review their request.

a) Click on Activity in the Step Types That Can Be lnserted area.

b) Using Drag&Drop, drag the cursor to the outcome Request revised. This inserts a stepof the chosen type (Activity) into the workflow def inition. The screen for defining anactivity in standard mode is now displayed.

c) Enterbasiccontroldata.lnthelaskfield,enterthelD(TS<B-digitnumber>)ofthestandard task "revise notif ication of absence" that you defined in the last exercise.

d) lf you no longer know the lD , use the input help (F4) to search using the T3*abbreviation,

e) Press Enter Io confirm your entries.

f) Click onContinue.fhe Define container Elements and Binding screen is now dispiayed.

g) Press Enter to confirm your binding.

h) Allocate the following, user-def inable texts for step names and event names: Stepname: Revise notification of absence, Outcome: Application revised

3. Check the binding.

a) From lhe Controltab select the function Binding (exists). This displays the screen:Binding for Step.. . .

b) Exit the screen.

4. Entries for Agent: WF_INITIATOR/applicant.

a) Position your cursor in the input field Expression, and use F4 to call the possibleentries.

b) Choose Workflow initiator (expression).

O Copyright. All rights reserved. 405

Page 420: SAP Workflow Bit601 en Col10

Unit 12: Tutorial

5, Complete the step definition.

a) Check the step and return to the Workflow Builder.

b) Test your workflow

c) Activate your workflow.

6, Fourth test: "Revise notification of absence". You can now perform another test on yourworkflow definition. lf you have any questions regarding the procedure, refer to theprevious units that describe how to test the workflow definition.

a) Suggestion for testing:

a) Applicant: Start workflow (Refresh organizational environment)

b) Applicant: Creates notification of absence

c) Superior: Reject application

d) Applicant: User decision: Change

e) Applicant: Revise application (new step)

b) According to your workflow def inition, you can only reach this step if you decide torevise the application in the preceding step. Complete the workflow.

406 O Copyright . All rights reserved.

Page 421: SAP Workflow Bit601 en Col10

Complete the "Notification of Absence"workflow

lf the initiator decides to revise and resubmit the application to his/her superior, the formmust be passed back to the 'Check application" step. There are various ways to do this. Theadvantage of the method described below is that it introduces several new aspects of SAPBusiness Workf low functions.

Task 1

lntegrate the Loop (Until) for reapproval.First you need to create another element in the workflow container. lt will be a simple flagwhich will be used in the condition of the loop (Until). You will need to populate this elementusing a Container operation when you want to terminate the loop.

J.. Starting from the SAP Easy Access menu, choose ToolsBusinessWorkflowDevelopmentDefinition Tools Tasks/Task groups. Double click on Change. Thenchoose the workflow template you created earlier.

2. Add an element in the workflow container with the name: Flag, based on field input intableSyST. Make sure to capitalize the field name.

3. lntegrate the Loop (Until) as a step.

4. Basic data: Termination condition Flag = 1.

5. lntegrate a container operation as a step, call it Set Flag. Container operations allow youto use individual elements of the workflow container. The following operations aresupported: Addition, Subtraction, Multiplication, Division, and Assignment. You need toinsert a container operation at three different points in your workflow definition.

irirjjjrrr. H int:,,irtrririr: trrirr,i Three container operations are required to determine which logical path to':r "

take in the workflow. The following information explains which containeroperations are required but only one example is supplied to demonstrate howto implement containers into the workf low definition.

:il'] . ' Hint:

,:,rrr,,rr. At this point, assign the value "2" to the workflow container element. The'i::::rriri"' comparison in the UNTIL loop then returns the result false, ln this case, the

workflow continues because the flag does not have value "X", and theapplication is resubmitted to the superior's inbox.

Task 2

O Copyright . All rights reserved

Page 422: SAP Workflow Bit601 en Col10

Unit 12:Tutorial

Test: "Process notification of Absence with the Loop (Until)".

1. Go to the SAP Easy Access menu. lnitiate the workf low. At the managers' s inbox, rejectthe application,

2. From the applicant's perspective: open the inbox. Execute the work item with the rejectedapplication. Revise it.

3. From the manager's perspective: check the inbox for new applications.

Task 3Reporting and Analysis.

1. You should start the workflow several times and test the alternatives. They can then beanalyzed using work item analysis of the workflow outbox. The workflow log providesinformation on all stages of the processing.

Task 4Define the standard task "send notification", using the Send mail step, which will be sent if theapplication is approved. The step Send mailhas its own workflow activity.

,.....,,,i1.:.1,,, Hint:rr,1,'

':r1r1'' Call the Workflow Builder in change mode for your ZWF-NOA-## workflow.

1, lnsert a Send mail step into the workf low definition, if the notif ication of absence is

approved.

2. Subject: Vacation approved.

3. Mail text: "Your vacation was approved. lt lasts from <first day> until <lastday>. Have apleasant time". You can use the attributes First day of absence and Last day of absence inthe vacation request to find the first and last days of the leave. Choose the lnsertExpression button to select the attributes in the relevant place in the text.

4. Recipient type: Organizational object,/WF_lNlTlATOR.

5. You will be prompted to give a name and description to the standard task which is beingcreated for the settings you have just made. Then click on the tab page: Control.

6. Activate and test your workflow.

7. Check that you receive a mail when the notification of absence is approved by yourmanager.

8. To ensure you made the correct entries display the single-step task generated for you bythe SAP system once again.

408 @ Copyright. AII rights reserved.

Page 423: SAP Workflow Bit601 en Col10

Complete the "Notification of Absence"workflow

lf the initiator decides to revise and resubmit the application to his/her superior, the formmust be passed back to the 'Check application" step. There are various ways to do this. Theadvantage of the method described below is that it introduces several new aspects of SAPBusiness Workflow functions.

Task Ilntegrate the Loop (Until) for reapproval.First you need to create another element in the workflow container. lt will be a simple flagwhich will be used in the condition of the loop (Until). You will need to populate this elementusing a Container operation when you want to terminate the loop.

1. Starting from the SAP Easy Access menu, choose loolsBuslnessWorkflowDevelopmentDefinition Tools Tasks/Task groups. Double click on Change.Thenchoose the workflow template you created earlier.

a) Select a workflow template/Call the workflow builder. As in previous units of thisexercise access your workflow template and activate the Workflow Builder to start therequired activities for this exercise. lf you require additional information to performthese tasks, refer to earlier units for more detailed instructions.

b) From within the Workflow Builder, set the navigation area so the entire workflow isdisplayed in the display area.

2. Add an element in the workflow container with the name: Flag, based on field inpui in tableSySf, Make sure to capitalize the field name.

a) ln the menu on the left of the screen, select the entry "Workf low container".

b) Double-Click to Create.

c) Def ine the element in the following f ields: Element: Flag, Name; Flag, Short text:"Change screen yes/no".

d) You can refer to ABAP Dictionary values in the definition. To do this, choose ABAPDictionary Reference.

e) Enier SYST in lhe reference table field.

f) Enter INPUT for the reference.

g) Choose Transfer

h) Return to the Workflow Builder: Change screen.

3. lntegrate the Loop (Until) as a step.

a) ln the menu on the left of the screen, select the entry Step lypes That Can Be lnserted.

@ Copyright. All rights reserved

Page 424: SAP Workflow Bit601 en Col10

Unit 12: Tutorial

b) Click on Loop (until) in the /nsertab/e Step Types area.

c) Using Drag&Drop, drag the step type to the Check Notification of Absence step, andthen click on it.

d) The system will then ask you if you want to transfer the selected block into the loop orif the previous loop should be inserted.Select in loop to transfer the "Check Notificationof Absence" block into the loop.

4. Basic data:Termination condition Flag = )1.

a) Enter the following basic data: Step name: loop (Until)

b) Click on the text in the Condition window. The Change Condition screen is displayed.

c) Double-click to select Flag f rom the Expressionl list. This will insert Flag into theExpressionl areaof the screen. Select the (=; operand, from the Operators area. Enterthe operator "X" as the constant.

Hint:

The workflow container element Flag, which refers to an ABAP Dictionaryfield, has the type CHAR and length 1. The elementFlag has not yet beenassigned a value. ln the next section, you will therefore insert containeroperations into the workflow def inition. The comparison between the F/ag

container element and the constant expression X returns either true orfalse as ihe result. Therefore, two subsequent outcomes are possible.

Use the Transfer condition button to end the condition editor and return to the screenfor defining the loop. ln the Outcomes area, enter the following: True: Flag has value X,

False: Flag does not have value X.

Check your entries and return to the Workf low Builder. You have now inserted a loop(Untjl) into the workflow definition and dragged the "Check Notif ication of Absence"block into the loop. The following section of the tutorial explains what a block is andhow blocks are dealt with in the Workflow Builder.

\* Note:

.dg ' The workflow definition is block-oriented. Each block represents a basicstructural element that forms a self-contained and consistent arrangementof steps and operations.

Note:lf, for example, you create a new step that has one subsequent outcome,this pair (step, outcome) represents a block, lt is important to rememberthat operations performed on one step (delete, cut, and so on) alwaysaffect the entire block assiciated with that step.

d)

e)

410 O Copyright. All rights reserved.

Page 425: SAP Workflow Bit601 en Col10

Lesson: Creating the Notification of Absence Workflow

5.

\",,,,, Note:

xS,'' ln the example above, where the block consists of the pair (step, outcome),

deleting a step will always delete the corresponding outcome as well.

Note:The 'Check Notification of Absence" step ends with two outcomes.

Subsequent processing occurs in the outcomes. All of these processing

steps are logically associated with a block. All of the steps become part of

the loop as a result.

\,1,.,,. Note:rf,.' To display the block structure of your workf low definition, choose

---+ Extras --+ Options ---+ Block Display ---+ Technical Groups

Note:Block operations are:

. Cut block

. Copy block

. lnsert block

. Delete block

f) Activate your workf low.

lntegrate a container operation as a step, call it Set Flag. Container operations allow you

to use individual elements of the workflow container. The following operations are

supported: Addition, Subtraction, Multiplication, Division, and Assignment. You need to

insert a container operation at three different points in your workflow definition.

.,,,:.:.::,;",'::'L,:::,:,..,. H int:,.1;,:11 ,1:;1'..,.; Three container operations are required to determine which logical path to':rrrr::"'r'r:r'

take in the workflow. The following information explains which container

operations are required but only one example is supplied to demonstrate how

to implement containers into the workflow definition.

@ Copyright. All rights reserved. 4IL

Page 426: SAP Workflow Bit601 en Col10

Unit 12: Tutorial

e)

o

,,r1,,, "': Hint:r' ri:,':. At this point, assign the value "2" to the workf low container element. The

comparison in the UNTIL loop then returns the result false. ln this case, theworkflow continues because the flag does not have value "X", and theapplication is resubmitted to the superior's inbox.

a) Container operation before the step "Revise Notif ication of Absence": event.

b) Click on Container Operation in the /nsertab/e Step Types area.

c) Using Drag&Drop, drag the cursor to the Revise Notification of Absence step. Thisinserts a step of the chosen type Container operation into the workflow definition.

d) For basic data, enter the following:

Step name Set flag to Z

Event name Flag- Z

For the operation, enter the following: Result element:Flag (select using F4 ),Expression'. Z

Make sure that the input fields for the operator and second expression are empty. Go

back to Ihe Workf low Builder - Change screen

Second operation after the withdraw event, and third operation after the approvedevent.

Hint:

At this point you assign the value Z to the workflow container elementflag. The comparison in the UNTIL loop then returns the result irue. Theloop is exrted.

g) Click on Container Operation in the /nsertable Step Types area.

h) Using Drag&Drop, drag the cursor to the Undeflned step after the Request is withdrawnevent. This inserts a step of the chosen type Container operation into the workflowdef inition.

i) For basic data, enter the following:

Step name Set flag to X

Event name Flag = X

412

j) For the operation, enter the following:

@ Copyright. All rights reserved.

Result element Flag (select using F4)

Page 427: SAP Workflow Bit601 en Col10

Lesson: Creating the Notification of Absence Workflow

I rxpression

I x

Make sure that the input f ields for the operator and second expressoin are empty.Repeat this procedure for the Approve event.

Hint:The operation entries are executed at runtime. When you start theworkflow and the Set f lag to Z step is executred, this means that theelement FIagin the workflow container is given the value Z.fhe flag valueis retained unless you change it explicitly.

Return to the workflow definition.

Check your workflow definition.

Activate your workflow definition.

You have now made all required entries to integrate the loop (Until). You can carry outanother test to check the loop (Until).

Task 2Test: "Process notification of Absence with the Loop (Until)".

1. Go to the SAP Easy Access menu. lnitiate the workflow. At the managers's inbox, rejectthe application,

a) As employee BlT601-##, initiate the Notiflcation of absence workflow template.Complete and save the form. This starts your workf low template.To do this, call thetransaction SWXF or choose the path: fools --+ BusinessWorkflow ---+ Development --+ Demonstration ---, Qsrnplete Notification of Absence.

b) Switch to the manager logon session and check the inbox for the form submitted bythe employee. The manager receives the form, and has the option to approve or rejectthe employee's request for leave.

c) As the manager, first reject the application and then exit the 'notif ication of absence"processing.

d) When the manager refreshes his or her integrated inbox, the work item is no longer in

the inbox. The superior has performed his or her task. lt is now up to the applicant todecide how the process is to continue.

2. From the applicant's perspective: open the inbox. Execute the work item with the rejectedapplication. Revise it.

a) Use Runtime fools -' Buslness Workplace to display the inbox,

b) Open theWorkflow folder,

c) Because your superior rejected your application, you now find a work item in yourworkflow inbox.

d) Execute the work item.You are now in the user decision step of your workflow. You can

either withd raw or revise the application. You should decide to revise it.

k)

r)

m)

@ Copyright , All rights reserved 413

Page 428: SAP Workflow Bit601 en Col10

Unit 12:Tutorial

e) Choose Change notification of absence in the dialog box User Decision.

f) Change the application (you can also resubmit it with the same entries).

g) Save and exit the notification of absence.

h) Refresh the Workflow inbox. The work item is no longer contained in the list.Yourmanager is now required to take action again.

3. From the manager's perspective: check the inbox for new applications.

a) The employee's application is resubmitted to the superior. He or she can carry out thesteps described above to approve or reject the application.

., .,;:"'1,,,-,, Hint:,,r,ttt,',,,r ,.,'ltrr,lr This workf low definition does not envisage a situation where the

'rrrrrrlllrrllr'rrr irrr' employee and superior do not reach an agreement. However, it would notbe difficult to integrate additional steps into the workflow def inition (forexample, automated notification to another person if the application is

exchanged repeatedly between the employee and the head ofdepartment).

Task 3Reporting and Analysis.

L. You should start the workflow several times and test the alternatives. They can then be

analyzed using work item analysis of the workflow outbox. The workflow log provides

information on all stages of the processing.

a) Which steps were executed?

b) Who was the agent?

c) When was the processing carried out?

d) What was the processing result?

,,,,1,r11i1rlillr'.:;11111r1,, Hint:

',,,,:,, tl:.:] ,,,' lt is often necessary to automatically send notif ications to particular

' 'i: recipients informing them of situtuations that have arisen. To do this, you

can define a single-step task that sends a notification when the task isexecusted. You therefore extend the workflow def inition so that theperson requestiong vacation is informed automatically once the requesthas been approved.

Task 4Define the standard task "send notification", using the Send mail step, which will be sent if the

application is approved. The step send mailhas its own workflow activity.

Hint:Callthe Workflow Builder in change modeforyourZWF-NOA-## workflow.

414 @ Copyright. All rights reserved.

Page 429: SAP Workflow Bit601 en Col10

Lesson: Creating the Notification of Absence Workflow

1. lnsert a Send mail step into the workflow def inition, if ihe notification of absence is

approved.

a) Click on Send Mailinlhe lnsertable Step Types area.

b) Using Drag&Drop, drag the cursor to the Approved outcome. This inserts a step of thechosen type Send mailinlo the workflow definition.

c) On the Mail tab page, enter the following:

Receiver type: Organizational object

Expression: & WF INITIATOR&

Send express: set the Express flag

2. Subject: Vacation approved.

a) Enter the text "Vacation Request Approved".

3. Mail text: "Your vacation was approved. lt lasts from <first day> until <lastday>. Have a

pleasant time '. You can use the attributes First day of absence and Lasf day of absence in

the vacation request to f ind the first and last days of the leave. Choose the lnsertExpression button to select the attributes in the relevant place in the text.

a) Enter the above description that you want to send as conf irmation. Enter more than

one attribute in your text. Click on insert expression at the bottom of the screen.

"'.',:,,t. Hint:

'.i There must be at least one space before and after each attribute'

4. Recipient type: Organizational object/WF-lN ITIATOR.

a) Leave the entries organizational obiect and _wF_INITIATOR unchanged.

5. You will be prompted to give a name and description to the standard task which is being

created for the settings you have just made. Then click on the tab page: Control.

a) Enter the abbreviation for your mail task: TS-MAIL-##'

b) Then enter the long name for your mail task: Mail ##'

c) Click on Continue/Enter and save your mail task.

d) The number of your task now appears on the Control tab page'

6. Activate and test your workflow.

a) ln this test run, the superior approves the vacation request'

7, Check that you receive a mail when the notif ication of absence is approved by your

manager.

a) This workflow sends the initiator a mail. This mail is not a work item. You can read the

mail in your Business Workplace. ln the Business Workplace, click on the unread

documents in the inbox. Double-click the subject line to display the mail in detail.

@ Copyright , All rights reserved 415

Page 430: SAP Workflow Bit601 en Col10

Unit 12: Tutorial

...,irll:rr" :urul'i, Hint:

;:-.. ::...: The SAP system does not automatically delete this mail after you have': ' read it. Delete the mail yourself .

8. To ensure you made the correct entries display the single-step task generated for you by

the SAP system once again.

a) End of tutorial.

416 @ Copyright. All rights reserved

Page 431: SAP Workflow Bit601 en Col10

Lesson: Creating the Notification of Absence Workflow

',,t:iii:,:L,il.L :,,,,i LESSON SUMMARy'':" '1 You should now be able to:

. Create the notification of absence workflow

@ Copyright, All rights reserved.

Page 432: SAP Workflow Bit601 en Col10