complete guide for tasks in workflows

13
Complete Guide for Tasks in Workflows Applies to: SAP ECC 6.0 and upwards Summary This is a complete guide for tasks in workflow; it is helpful for the beginners to understand the relevance of task in workflow, it contains the different types of tasks, features in task, important transaction codes involved. Authors: Anindita Kar, Sunil Ojha, Reshmi Das Company: Capgemini Created on: 03 January 2008 Author Bio Anindita Kar is an ABAP/Workflow consultant. She is currently working with Capgemini Consulting India Pvt. Ltd. Sunil Ojha is a XI certified workflow consultant. His current engagement is with Capgemini Consulting India Pvt. Ltd. Reshmi Das is presently working in Capgemini Consulting India Pvt. Ltd. She is an ABAP/Workflow consultant. SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 1

Upload: roberto-faccini

Post on 21-Mar-2017

41 views

Category:

Software


2 download

TRANSCRIPT

Page 1: Complete guide for tasks in workflows

Complete Guide for Tasks in Workflows

Applies to: SAP ECC 6.0 and upwards

Summary This is a complete guide for tasks in workflow; it is helpful for the beginners to understand the relevance of task in workflow, it contains the different types of tasks, features in task, important transaction codes involved.

Authors: Anindita Kar, Sunil Ojha, Reshmi Das

Company: Capgemini

Created on: 03 January 2008

Author Bio Anindita Kar is an ABAP/Workflow consultant. She is currently working with Capgemini Consulting India Pvt. Ltd.

Sunil Ojha is a XI certified workflow consultant. His current engagement is with Capgemini Consulting India Pvt. Ltd.

Reshmi Das is presently working in Capgemini Consulting India Pvt. Ltd. She is an ABAP/Workflow consultant.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 1

Page 2: Complete guide for tasks in workflows

Complete Guide for Tasks in Workflows

Table of Contents Task ....................................................................................................................................................................3 Single Step Task.................................................................................................................................................3 Multistep Task.....................................................................................................................................................3 Important SAP Transactions Related to Tasks...................................................................................................4 Features in a Task ..............................................................................................................................................4

Basic Data:......................................................................................................................................................4 Description: .....................................................................................................................................................5 Container:........................................................................................................................................................6 Terminating Events: ........................................................................................................................................7 Default Rules...................................................................................................................................................8 SAP Phone......................................................................................................................................................9

Maintenance of Agent Assignment...................................................................................................................10 Appendices .......................................................................................................................................................12 References........................................................................................................................................................12 Disclaimer and Liability Notice..........................................................................................................................13

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 2

Page 3: Complete guide for tasks in workflows

Complete Guide for Tasks in Workflows

Task Task is used to define an activity that can be executed within a workflow definition or independently (as a single step). This activity can be an SAP System transaction. In case we have to create new tasks it is created as Standard tasks. Customer tasks can only be edited. There will be no functional enhancements for customer tasks.

Single Step Task

A single-step task is for use in workflow definitions. A task can be part of a workflow definition as a step of the type activity. In the workflow definition, additional information can also be specified regarding responsibilities and deadlines.

Single Step Task

Standard Task Customer Task It is client specific with validity period and object type is ‘T’ in organizational management.

It is cross client with unrestricted validity period and object type as ‘TS’ in organizational management.

Multistep Task

A multistep task is a formal framework for a workflow definition. When you create a workflow directly in the Workflow Builder, the multistep task is created by the system. Multistep tasks can be divided into workflow template and workflow tasks. Workflow tasks are defined on a screen without tab pages. But the activities to be carried out are the same.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 3

Page 4: Complete guide for tasks in workflows

Complete Guide for Tasks in Workflows

Important SAP Transactions Related to Tasks

PFTC_CHG Change tasks

PFTC_COP Copy tasks

PFTC_DEL Delete tasks

PFTC_DIS Display tasks

PFTC_INS Create tasks

PFTC Tasks (Change/Display/Create/Copy/Delete)

Features in a Task

Basic Data:

Basic data is used to identify a task. It includes three main functions namely: Editing names and Work Item Text, Maintenance of Reference to a Method, Maintenance of Execution Properties. A work item that represents a task is displayed with the work item text in the Business Workplace, in the work item selection hit list and in the workflow log. If we do not specify a work item text, the name is used instead.

The expression is replaced at execution time with the current values from the relevant container. The container elements used in the work item text must be filled using a binding. We define the activity to be executed with a task by specifying an object type method. We determine the reference to the method on the tab page Basic Data by specifying object type and method. The object type must be activated and defined with the method in the Business Object Builder. If method parameters are defined for the object method, the system gives us the option of creating relevant container elements automatically in the task container. The names of these container elements are then identical in the task container and the method container. Each

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 4

Page 5: Complete guide for tasks in workflows

Complete Guide for Tasks in Workflows

task is identified by the object identifier T (for customer task) or TS (for standard task) and an 8-digit task number allocated automatically by the system during creation. We can make the settings required for the number assignment in Automatic Workflow Customizing. As cross-client transport objects (transport object PDTS), standard tasks are always connected to the transport system.

Customer tasks are only connected to the transport system (transport object PDT) in a particular client if Automatic recording of changes is set for this client in table T000. The Confirm end of processing property can be assigned both to task that do have terminating events and to those that do not. If there are terminating events, the relevant work item must be completed using the function Set to ‘Done’ in the Business Workplace, If this indicator is set, the end of processing of the task must be confirmed explicitly at runtime. After execution of a task, a dialog box is displayed in which you enter whether the processing of the task has actually been completed. For example, you can still enter an attachment before you complete the work item. As long as this confirmation has not taken place, the relevant work item appears in the Business Workplace of the actual agent and has the status Executed.

This can execute the work item again or forward it. This may be useful if a task is to be processed several times and by different people. For Background Processing this indicator is set if the object method does not necessitate dialog with a user, and the processing is to be started automatically by the system. If this indicator is set, the task is executed at runtime as a background work item as soon as it is its turn in the sequence. No work item appears in the Business Workplace. We can, however, find a background work item via the work item selection. If this indicator is not set, a dialog work item appears in the Business Workplaces of the recipients. If this work item is executed by one of its recipients, the object method is executed in the background without any further dialog. We cannot set this indicator if the indicator Object method with dialog is set for this object method.

Description:

The Task description can be written here, we can also have the notification texts here.

We can describe the task or make notes and recommendations for processing. The task description is displayed in the work item display. Notification Texts like Requested End Text, Latest Start Text and Latest End Text can also be maintained here.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 5

Page 6: Complete guide for tasks in workflows

Complete Guide for Tasks in Workflows

Container:

This function is used to process the container elements of the task container. Each task container already contains the workflow system elements and any additional elements for the method parameters of the referenced object method. We have to add additional elements to the task container; in case additional values are required for variable replacement in the work item text or in the task description or in the other texts, additional information can be used to resolve a default rule. Values are assigned to the task container at runtime in the following ways by initial value assignment or by using binding from the workflow, event, or method container.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 6

Page 7: Complete guide for tasks in workflows

Complete Guide for Tasks in Workflows

Terminating Events:

Binding generated for Terminating Events

This function is used to define the terminating events (Event whose occurrence completes a task) of the task. Synchronous object method and asynchronous object method can be defined with terminating events. The terminating events of a task express the possible end statuses of the task. A terminating event always refers to one object for which the event must be triggered. We define the object for which the event must be triggered in a container element in the task container.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 7

Page 8: Complete guide for tasks in workflows

Complete Guide for Tasks in Workflows

Default Rules

Rules to define the responsible agents of a task and the recipients of notifications.

We use rules to define the responsible agents of a task and the recipients of notifications. The responsible agents and recipients of notifications, we can specify a rule for each recipient type, depending on the use of the task. We must define the binding from the task container to the rule container for each rule. Task is started in dialog or via an event or Task is started from a workflow. For task in dialog or via an event the system resolves the rule for the recipient type agent at runtime, and determines the responsible agents of the task. All responsible agents who are also possible agents become recipients of the relevant work item. For task started from workflow rules entered are only resolved if nothing is specified in the step definition.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 8

Page 9: Complete guide for tasks in workflows

Complete Guide for Tasks in Workflows

SAP Phone

SAP Phone property determines the possible use of a task in the SAP Phone environment.

The SAPphone property determines the possible use of a task in the SAPphone environment. SAPphone integrates telephony functions into the SAP System. SAP applications use this to integrate the telephone into the work process. SAPphone provides the Basis technology requires processing outgoing and incoming telephone calls is supported by data from the SAP System environment, (for example, telephone number, name). An incoming call starts a search for caller data. The result of the search is displayed automatically in an information window.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 9

Page 10: Complete guide for tasks in workflows

Complete Guide for Tasks in Workflows

Maintenance of Agent Assignment The agent assignment is one of the important features in TASK. This function assigns possible agents to a task. Path: Additional Data -->Agent Assignment Maintain No possible agents are assigned initially to an SAP task or an SAP workflow. We can perform this assignment in Customizing. We can change and extend these assignments at a later date as well.

The system establishes the recipients of a work item at runtime. The recipients are derived from the intersection of possible agents and responsible agents barring excluded agents. If this intersection is empty, no users receive the work item. In Workflow Runtime Administration a function is available to determine such work items. We specify the responsible agents for a step in the step definition. We can specify not only a system user, but also a role or an object of Organizational Management such as a position, a Job, an organizational unit or a work center. Alternatively, we can define a container element that contains the object of Organizational Management at runtime or a rule for dynamic agent determination.

We can define agents excluded from processing within the step definition. The user who actually executes the work item at runtime is the actual agent. The possible agents for a task must be maintained so that the recipients can be established at runtime. To process the basic properties of a task, choose Additional data → Classification → Change in task maintenance. To assign a task we have defined to its possible agents or process its basic properties, choose Additional data → Agent assignment→ Maintain and select the task. Select Attributes to define the basic properties of the task. Choose Agent assignment → Create to assign the possible agents. We can process the possible agents of the task and workflow (multistep task) from the Workflow Builder as well. A default rule when defining a task can be used so that the agents are established dynamically when this task is executed. This default rule is evaluated if the task is executed alone. The default rule takes on the function of the responsible agents in this case. The possible agents of a task are all of the users who are organizationally responsible and authorized to execute the task at runtime. Only they can receive a work item for this task in their Business Workplaces. Starting the task in dialog outside a workflow is included in execution. We must assign possible agents to a task that requires a dialog for the task to be executed at runtime. We can create several assignments for a task and also use various types of agent doing so.We do

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 10

Page 11: Complete guide for tasks in workflows

Complete Guide for Tasks in Workflows

not have to assign possible agents to tasks designated as background tasks. You must assign possible agents to those background tasks that are also to be started as single steps in dialog.

Agent Assignment in Workflow Task (Multistep Task)

The possible agents of a workflow are those users who are authorized to start the workflow manually. You can perform the assignment of possible agents in the basic data of a workflow definition or in the relevant multistep task.

We only have to assign possible agents to a workflow if the workflow is to be started directly by users. If the workflow is only to be started by events, do not assign any possible agents to the workflow.

Agent Assignment in Task Groups

We define Task Groups if you want to collect and group tasks (only Standard Tasks) and workflows (only Workflow Template), that are connected as far as logic or content is concerned. We can also collect other task groups within a task group, hence making hierarchies of task groups. Task groups are not restricted within applications. We can collect tasks and workflows from within one application component as well as tasks and workflows from various application components. A task or workflow can be used in several task groups. We can use task groups to delimit the search range when calling the Business Workflow Explorer. The application component is also available as a collective evaluation criterion for tasks and workflows. Each task and workflow is assigned to an application component automatically using its package. If we assign possible agents to a task group, this assignment in passed on to all tasks, workflows and task groups contained in the task group. If we define a task as a general task, all users can execute the task. This is useful if the task is used in a workflow and we only want to define the recipients in the step definition. A recipient can forward associate work items to all users. Work items whose tasks are defined as general tasks and for which no responsible agents or default rules are defined are offered to all users of the SAP System for execution in their Business Workplaces.

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 11

Page 12: Complete guide for tasks in workflows

Complete Guide for Tasks in Workflows

Appendices

Standard Task A single-step task for use in workflow definitions with Object type TS in Organizational Management, cross client and unrestricted validity period

Customer Task

A single-step task with Object type T in organizational management Client specific With validity period

Workflow Template

A multistep task with organizational object type WS which is Cross client with Unrestricted validity period and any plan version

Workflow Task

Multistep task created by a customer to meet their specific requirements. A workflow task contains a workflow definition.

The following apply to workflow tasks:

Organizational object type WF Client specific Validity period Plan version specific

Workflow tasks will not be supported in the future. New workflows should be given the type "workflow template."

Task Group

Collection of standard tasks, workflow templates, and other task groups that are used in a common context.

References SAP Business Workflows

Business Workflows

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 12

Page 13: Complete guide for tasks in workflows

Complete Guide for Tasks in Workflows

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com © 2008 SAP AG 13

Disclaimer and Liability Notice This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.

SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document, and anyone using these methods does so at his/her own risk.

SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or code sample, including any liability resulting from incompatibility between the content within this document and the materials and services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this document.