Transcript
Page 1: Introduction to Workflow-For Beginner

SAP BUSINESS WORKFLOW

Page 2: Introduction to Workflow-For Beginner

|

Course Content

Introduction

Workflow architecture

Workflow Definition and workflow Template

Workflow steps in details

Task

Business Objects and Methods

Container Structure and Container Programming

Events

Organizational structure and role resolution

Different types of Agent

Workflow and ALE

Page 3: Introduction to Workflow-For Beginner

|

SAP Business Workflow

SAP Business Workflow® is a cross-application tool that makes it possible to integrate business tasks/processes between applications.

This tool was introduced in R/3 Release 3.0A, and received a substantial facelift in the Enjoy Release, 4.6A,which warranted the new name Workflow Builder.

Page 4: Introduction to Workflow-For Beginner

|

Need of Workflow

Hmm ! Time to put in a purchase requisition request

1

3

I guess I’d better send off some inter-office mail to ask the approvers to approve my requisition.

2 I wonder whoapproves buying this stuff?

5

Time drags on . . .Meanwhile, in Mr. Manager’s office . . . “What shall I do next?”

4

TIME IS MONEY!!!

Page 5: Introduction to Workflow-For Beginner

|

Drawbacks

Inefficiency.

Each lacks a way to trace where a task is.

Who executed or is executing it.

How much time it required.

Page 6: Introduction to Workflow-For Beginner

|

Why SAP Workflow

Workflow ensures that the right work is sent to the right person at the right time in the right sequence with the right information.

Tool for the automization of business processes Not tied up to any paricular application Operates uniformly accross applications Coordinate all participating tasks Provide users with active support Intelligent routing

Page 7: Introduction to Workflow-For Beginner

|

SAP Business Workflow Architecture

Page 8: Introduction to Workflow-For Beginner

|

Workflow Architecture

OrganisationalLevel

OrganisationalLevel

Process LevelProcess Level

Business Object Level

Business Object Level

Page 9: Introduction to Workflow-For Beginner

|

Workflow Definition

Page 10: Introduction to Workflow-For Beginner

|

Workflow Definition

Workflow definition consists of

1. Basic Data2. Information about triggering events3. Initial Values4. Containers5. Bindings

A workflow definition describes the workflow process

Page 11: Introduction to Workflow-For Beginner

|

Workflow Builder

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

Transaction: SWDD Menu Path: Tools Business Workflow Development Definition tools Workflow Builder.

Page 12: Introduction to Workflow-For Beginner

|

Workflow Definition - Steps

A workflow definition is made up of individual modular steps.

Page 13: Introduction to Workflow-For Beginner

|

Example Workflow

Create a simple workflow

Page 14: Introduction to Workflow-For Beginner

|

How are Workflows Created in a System

Within workflow templates, there is a key with the following structure:- A WS task abbreviation for the workflow template- An 8-digit sequence number

From the structure of the 8-digit number, the system knows whether the template is a standard template delivered by SAP or one created by the customer.

Customer-defined templates start with the prefix number that was defined in Customizing for the system and client.

Page 15: Introduction to Workflow-For Beginner

|

Working with Workflow

Page 16: Introduction to Workflow-For Beginner

|

How workflow gets executed

Page 17: Introduction to Workflow-For Beginner

|

Workflow Toolbox - SWUS

Transaction: SWUS.Menu Path: Tools -> Business Workflow -> Development -> Runtime Tools-> Start Workflow (Test Environment).

Page 18: Introduction to Workflow-For Beginner

|

Workflow Steps

Page 19: Introduction to Workflow-For Beginner

|

Workflow definition steps

Workflow definition is made up of individual steps. When creating a step in a workflow definition, the step type must be specified first.

There are 1. Steps which refer to business activities (activities & user

decision)

2. Steps which are used for internal process control and monitoring (condition, multiple condition, loop, etc)

Page 20: Introduction to Workflow-For Beginner

|

Business Activities Steps

Activity Can be a single step task with basic business functionality Can be a multi-step task, which reference to a workflow definition

User Decision This provides an opportunity for user interaction with the system. The response to this decides the selection of the subsequent step.

Document from template PA document is created from a document template using variables in the text that

are filled during program execution.

Web Activity Selected container elements are posted using http protocol in XML or SOAP

message

Subworkflow An activity which refers to a workflow rather than a task

Page 21: Introduction to Workflow-For Beginner

|

Internal process control Steps

Condition Branch on the basis of control information from the runtime dependent

context of the workflow. An attribute of this object can also be accessed for condition evaluation Condition evaluation can be done by

Field comparison e.g constants , object attribute, system fields

Multiple condition In contrast to condition, multiple condition makes it possible for the

workflow definition to branch in more than two branches.

For evaluation of the multiple condition, the value of the basis of comparison is checked at runtime against the comparison values and branched accordingly.

Page 22: Introduction to Workflow-For Beginner

|

Internal process control (contd.)

WHILE Loop Steps are processed repeatedly until the conditions contained in

the WHILE step no longer apply.

Until Loop Steps are processed repeatedly until the condition contained in

the UNTIL step is true.

Fork Used for parallel processing branches. Only a part of the parallel processing branches actually has to

run to continue the workflow. Dynamic parallel processing is also possible

Page 23: Introduction to Workflow-For Beginner

|

Internal process control (contd.)

Send mail- Text entered in this step can be used to send a mail to the agent assigned

Container operations- Used to perform arithmetic operation of value assignment to workflow

container elements using constants and data in the workflow container .

Page 24: Introduction to Workflow-For Beginner

|

Internal process control (contd.)

Event Creator An event is created when this step in the workflow is reached. Other workflows can be started as a reaction to the event

created in this step. This event must be the triggering event of the relevant workflow tasks and/or templates.

WAIT for event Used to stop the whole execution of the workflow until the

event is created in the system. Used to wait for events for parallel processing

Page 25: Introduction to Workflow-For Beginner

|

Task & Workflow Definition

Page 26: Introduction to Workflow-For Beginner

|

Workflow Task

To create workflow task use transaction – PFTC

Page 27: Introduction to Workflow-For Beginner

|

Tasks

Single step

Multistep

Standard Task(TS)

Customer Task(T)

Workflow Template(WS)

Workflow Task(WF)

Tasks are used to describe a business process

Page 28: Introduction to Workflow-For Beginner

|

Similarities and differences of task types

Customer Task (Type T) Standard Task (Type TS)Workflow Task (Type WF) Workflow Template (Type WS)

Created by customer Created by SAP and customer

With validity period Without validity period

Client-dependent Client-independent

Must be linked to its possible Must be linked to its possibleagents when it is defined agents when it is defined

Page 29: Introduction to Workflow-For Beginner

|

Single and Multistep Tasks

Tasks

Single step

Multistep

References one object type method and displays one step in the business process

Represents the business process and is a sequence of individual tasks and control steps

Transaction : PFTCMenu Path -> Tools -> Business Workflow -> Development -> Definition tools ->Tasks

Page 30: Introduction to Workflow-For Beginner

|

Single-step tasks

ƒ Single-step tasks describe elementary business activities.

ƒ Single-step tasks operate on an object and refer to one object method

each

ƒ Single-step tasks are linked to their possible and permitted agents

whose organizational assignments are described in the organizational

plan of the enterprise.

ƒ Executable single-step tasks are represented by work items at runtime.

Page 31: Introduction to Workflow-For Beginner

|

Workflow definition - Multistep tasks

ƒ A workflow definition has a modular structure consisting of individual steps which are linked together.

ƒ The multistep tasks form the business framework for a workflow definition and each references one workflow definition.

ƒ A step in a workflow definition can be an activity.

ƒ An activity always refers to one task (= single-step task or multistep task).

ƒ An activity with one simple triangle refers to a task.

ƒ An activity with three triangles refers to a workflow (subworkflow).

Page 32: Introduction to Workflow-For Beginner

|

Task Definition – Synchronous and Asynchronous Methods

Page 33: Introduction to Workflow-For Beginner

|

Important Task Attributes

General

-Workitems can be executed and forwarded to any SAP

User

General Forwarding Allowed

-Workitems can be forwarded to any user

General Forwarding Not Allowed

-Work items can be forwarded to possible users

Forwarding not allowed

-No forwarding allowed

Page 34: Introduction to Workflow-For Beginner

|

Work Item

ƒ Executable single-step tasks are represented by work items at

runtime.

ƒ Object that represents a task or action in the workflow system at

runtime.

ƒ Depending on the work item type, some of these work items are

displayed in a user's work list. Other work items, on the other hand,

are only used and processed internally.

ƒ The work items are displayed in the integrated inboxes of their

selected agents, and can be reserved and executed from there.

Page 35: Introduction to Workflow-For Beginner

|

Work Items Types

Page 36: Introduction to Workflow-For Beginner

|

Workitem Types

W: Dialog work itemRuntime display for a single step task with a user dialog

D: Missed deadline work itemThe message recipient for the missed deadline is informed.

F: Workflow work itemRuntime representation of a multi step task

B: Background work itemRuntime display for a task executed in the background.

E: Wait step work item:Runtime display for a wait step in the workflow definition.

Page 37: Introduction to Workflow-For Beginner

|

Workitem Text

ƒ Title of workitem in the Business Workplace

ƒ First create the workitem text and position the cursor to include a varible

ƒ Choose the 'Insert variable' icon under the workitem text

Processes request from &_WI_Object_ID.CreatedBy&

Example

Page 38: Introduction to Workflow-For Beginner

|

Business Object Definition and Implementation

Page 39: Introduction to Workflow-For Beginner

|

ƒ SAP Business Workflow has been developed on an object-oriented basis.

ƒ The business object types are identified and described with their object methods in the Business Object Repository(BOR) of the R/3 System.

ƒ Generally one object is created in the system and then processed in a workflow over several steps by various employees.

Object Types & Workflow

Page 40: Introduction to Workflow-For Beginner

|

Workflow deals with object types. Object types are definitions of data. In order to access database data, workflow uses the object type interface.

Most of the information represented by object types is available in the ABAP/4 Dictionary.

Objects are created at runtime and are specific instances of defined object types.

Many object types are delivered by SAP. In addition, the customer can create new object types or extend SAP objects by creating subtypes (child objects). New customer objects or subtypes may be desired if the delivered SAP object does not contain all the characteristics (attributes) or processing options (methods) desired.

Object Types & Objects

Page 41: Introduction to Workflow-For Beginner

|

Object Type - Definition

Page 42: Introduction to Workflow-For Beginner

|

Interfaces

Interfaces are a combination of attributes, methods, and events to be used in common among multiple object types. The purpose of interfaces is to define common functionality in one object type, and to assign that common functionality via an interface to multiple object types across the Business Object Repository. This avoids redundancy of data and functionality definition.

Each new object type automatically receives the interface IFSAP, the SAP standard interface. IFSAP provides every object type with the following:

Method Display Method ExistenceCheck Attribute ObjectType

Page 43: Introduction to Workflow-For Beginner

|

Key Fields

Key fields are designed to uniquely identify the object type.

If the key field has a data type reference of a dictionary table field, the runtime system will look to that table field to retrieve the value of the key when processing the object. When the key field is created, the ABAP/4 program code is generated automatically when the object type is generated.

Page 44: Introduction to Workflow-For Beginner

|

Attributes

Attributes provides access to data.

ABAP Dictionary Field Virtual

Page 45: Introduction to Workflow-For Beginner

|

Methods

Methods incorporate the permitted functions available for an object.Methods have importing and exporting parameters as well as exceptions.

Methods can be created using :

Page 46: Introduction to Workflow-For Beginner

|

– Dialog / or background :

Execution of the method is via a work item in a user’s integrated inbox or in background by the workflow runtime system. Background methods cannot use messages or exceptions because they cannot be processed by the background system and will result in termination of the program.

– Synchronous / Asynchronous

• Synchronous methods finish executing before handing control back to the calling program. These types of methods can return export parameters, results and exceptions. Asynchronous methods do not return control to the calling program immediately. Once executed, they depend upon events to communicate the results of the method back to the calling program. Asynchronous object methods cannot have results, export parameters or exceptions.

Methods - Call attributes

Page 47: Introduction to Workflow-For Beginner

|

Result:

Synchronous methods may return an export parameter as a result. A

result can be defined like a dictionary field or an object type .

Instance independence:

Indicates whether an object reference is passed to the method by binding

at the time of execution. Methods that generate and return an object

reference, such as Create, or methods that generate a report listing should

be instance independent.

Methods - Call attributes

Page 48: Introduction to Workflow-For Beginner

|

Import /Export Parameters

• The method parameter container contains references to all import, export and result parameters which need to be exchanged back and forth between the calling program (single-step task) and the method. Binding is necessary between the single-step task and the method parameter container to accomplish the data transfer.

• Import parameters are those values which are necessary to execute the method. Import parameters are retrieved from the container CONTAINER using the macro instructions SWC_GET_ELEMENT (single-line) or SWC_GET_TABLE (multiline).

• Export parameter values are passed to the container CONTAINER using the macro instructions SWC_SET_ELEMENT (single-line) or SWC_SET_TABLE (multiline). The result parameter is passed to the CONTAINER element RESULT via the same macro instructions.

Page 49: Introduction to Workflow-For Beginner

|

Exceptions

• Error handling is accomplished through the use of method exceptions (synchronous methods only).

• The workflow definition can branch according to these possible error states and allow for subsequent steps to handle these conditions. Messages and exceptions cannot be used with background methods because they will terminate the program.

• Number of the exception: • 0001-1000: exceptions defined for interfaces• 1001-7999: application-specific exceptions (free for SAP

development)• 8000-8999: exceptions raised by the object manager• 9000-9999: exceptions defined by the customer (free for

customers)

Page 50: Introduction to Workflow-For Beginner

|

Exceptions

• Exceptions are implemented within a method, between the macro instructions BEGIN_METHOD and END_METHOD.– EXIT_RETURN Code Variable1 Variable2 Variable3 Variable4.

• Code = the 4-digit number of the exception• Variable1 through Variable4 correspond to up to 4 variables

which can be derived from the message issued with the exception.

• The following exceptions (for temporary errors) are also available to allow exiting of the program:– EXIT_OBJECT_NOT_FOUND = object not found– EXIT_CANCELLED = cancelled by the user

Page 51: Introduction to Workflow-For Beginner

|

Events

Events describe the change in the status of an object.Workflow are usually started using events

Page 52: Introduction to Workflow-For Beginner

|

Object Type - Release Status

ƒ Not accessible at runtime.

ƒ Only in test or internal use, possibly unstable.

ƒ Released for use by the customer.

ƒ The functionality has been replaced. The old functionality is still supported for two releases.

Page 53: Introduction to Workflow-For Beginner

|

Subtype

The subtype inherits all attributes, methods and events of the supertype and is open for new customer-specific attributes, methods and events. The key fields of the supertype and subtype must be identical. This means that any methods and attributes defined on the parent can be executed and accessed on the child object.

Page 54: Introduction to Workflow-For Beginner

|

Delegation

This delegation is powerful because it lets you implement your own business logic without modifying any SAP code. As long as the objects are properly delegated, your method will be executed.

Calling Program

KNA1

Method:

Change password

ZKNA1

Method:

Change password

Transaction: Menu Path: SW01Tools Business Workflow - Development - Definition tools - Business Object Builder - Settings - Delegate

Page 55: Introduction to Workflow-For Beginner

|

Business Object Repository (BOR)

Transaction: Menu Path: SW01Tools Tools - Business Workflow – Defination tool –Busniness Object Builder

Page 56: Introduction to Workflow-For Beginner

|

Containers and Bindings

- Workflow -

Page 57: Introduction to Workflow-For Beginner

|

Types of Containers

Page 58: Introduction to Workflow-For Beginner

|

Workflow Container

ƒ The workflow container contains workflow-specific system variables and other elements which are defined explicitly.

ƒ As part of the definition of the workflow task, the import and export parameters of the workflow are defined as elements of the workflow container.

ƒ When the workflow is defined in the workflow editor, elements can also be added to the workflow container. These elements are then "local variables" within a workflow definition and can be used, for example, to set up a counting loop.

Page 59: Introduction to Workflow-For Beginner

|

Task Container

ƒ Each task container already contains the workflow system variable and any additional elements for the method parameters of the referenced object method.

ƒ You have to add additional elements to the task container for additional values are required for variable replacement in the work item text or in the long texts

Page 60: Introduction to Workflow-For Beginner

|

Other Types of Containers

Event parameter container

Contains an element which can take the (object) reference to the object

whose change of status is announced via the event.

Role parameter container

Contains the elements required as input in connection with the role

resolution to be run at runtime.

Method parameter container

Contains elements which will be required as import and export parameters

in connection with the method execution.

Page 61: Introduction to Workflow-For Beginner

|

What is a Container?

• Field values

• Multiline lists of field values

• Object references

Container Definition

Container Instance

Application Data

R/3

Definition Runtime

Page 62: Introduction to Workflow-For Beginner

|

Binding

ƒ A binding is simply the art of pouring selected container elements from one container into another.

ƒ The binding editor is available when defining: Workflow definitions Triggering events Workflow steps Workflow steps ( Standard roles/ Object methods with parameters)

ƒ The binding editor always references the container to receive the application data. Binding definitions can reference:

Constants Variables (container elements) System fields

Page 63: Introduction to Workflow-For Beginner

|

Container & Dataflow

TaskContainer

MethodContainer

EventContainer

Workflow Container

triggeringevent

synctask

syncmetho

d

synctask

syncmetho

d

role

asynctask

asyncmetho

d

4

terminatingevent

12

3

56

7

8

9

1011

12 13

1415

RoleContainer

Page 64: Introduction to Workflow-For Beginner

|

Writing/Reading Container Elements Defined as Field Values

SWC_GET_ELEMENT

SWC_SET_ELEMENT

Variable

Container Instance

Variable

SWC_GET_TABLE

SWC_SET_TABLE

delete value

InternalTable

InternalTable SWC_DELETE_ELEME

NT

Page 65: Introduction to Workflow-For Beginner

|

Writing to Container Elements Defined as Object Types

Container Instance:

CONTAINER

Object Element:MATRLDeclare a variable as an object:

DATA: MATERIAL TYPE SWC_OBJECT.

Create an instance of your object in your program:SWC_CREATE_OBJECT MATERIAL ‘MARA’ MATNR.

Declare a variable as the key of your object:DATA: MATNR LIKE MARA-MATNR.

Fill the key with a value:MATNR = ‘123456’.

Object type from B.O.R.

Key of object you previously defined

Transfer value of your object instance to the container element: SWC_SET_ELEMENT CONTAINER ‘MATNR’ MATERIAL

Page 66: Introduction to Workflow-For Beginner

|

Reading Container Elements Defined as Object Types

Container Instance:

CONTAINER

Declare a variable as an object:DATA: MATERIAL TYPE SWC_OBJECT.

Object Element:MATRL

Read value of container element to your object: SWC_GET_ELEMENT CONTAINER ‘MATRL’ MATERIAL.

Declare a variable as the key of your object:DATA: MATNR LIKE MARA-MATNR.

Read the object type key into your variable:SWC_GET_OBJECT_KEY MATERIAL MATNR.

Declare a variable to hold the object type:DATA: OBJTYPE LIKE SWOTOBJID-OBJTYPE.

Obtain the object type from your object type variable:SWC_GET_OBJECT_TYPE MATERIAL OBJTYPE.

Page 67: Introduction to Workflow-For Beginner

|

Writing to Container Elements Defined as Multiline Object Types

Container Instance:

CONTAINER

Element:PRItems

Declare a variable as an internal table object:DATA: REQITEMS TYPE SWC_OBJECT OCCURS 0.

Create an instance of your object for each table line:SWC_CREATE_OBJECT REQITEM ‘BUS2009’ PREQKEY.

Once the internal table is filled, transfer the internal table to the multiline container element:

SWC_SET_TABLE CONTAINER ‘PRItems’ REQITEMS.

Since this internal table has no header, declare a work area: DATA: REQITEM TYPE SWC_OBJECT.

Declare key fields of the object(e.g. called PREQKEY) and fill them

(e.g. within a select loop).

Append the object instance to the internal table:APPEND REQITEM TO REQITEMS.

Page 68: Introduction to Workflow-For Beginner

|

Reading Container Elements Defined as Multiline Object Types

Container Instance:

CONTAINER

Object Element:PRItems

Read value of multiline container element into your internal table object:

SWC_GET_TABLE CONTAINER ‘PRItems’ REQITEMS.

Declare your object:DATA: REQITEM TYPE SWC_OBJECT.

Loop through your internal table object REQITEMS into individual REQITEM entries.

Perform operations as needed.

Use this macro to get the keys of each entry:SWC_GET_OBJECT_KEY REQITEMS PREQKEY

Use this macro to get the object type of each entry:SWC_GET_OBJECT_TYPE REQITEMS OBJTYPE.

Declare a variable to hold the object type:DATA: OBJTYPE LIKE SWOTOBJID-OBJTYPE.

Page 69: Introduction to Workflow-For Beginner

|

Events

Page 70: Introduction to Workflow-For Beginner

|

Event

An event describes a possible status change for an object in the SAP System.

Before an event can be used in a workflow, it must be defined in the Business Object Repository for the object type.

Events must be triggered explicitly. The application itself can be the triggering agent.

Page 71: Introduction to Workflow-For Beginner

|

Types of Event Creation

Change Document

Status Management

MessageControl

Specific HR Tables

ABAP CodeIn User Exit

Page 72: Introduction to Workflow-For Beginner

|

Using Customizing for event trigger

Menu Path :Basic menu -> Tools -> Business Workflow -> Development -> Definition tools -> Events

Page 73: Introduction to Workflow-For Beginner

|

Event Creation of Change Document

Changing Master data

Event linkage is done to connect to the workflow/ task

Event creation (SWEC)

Change logged using

change documents

Page 74: Introduction to Workflow-For Beginner

|

Event Creation of Status Management

Event linkage is done to connect to the workflow/ task

Event creation (BSVW )

Status Management

When user status changes to E002 , event is triggered

Page 75: Introduction to Workflow-For Beginner

|

Event Creation of Message Control

Create Message type and define workflow as transmission medium

Create Condition Table

Create Access Sequence

Assign Access Sequence to defined message type

Define Condition Records

Assign message type To procedure

Triggering an event using message control occurs with NAST.

Maintain the processing program RSWEMC01

with the FORM routine CREATE_EVENT for

the output type EVEN and transmission

medium 9.

Page 76: Introduction to Workflow-For Beginner

|

Using ABAP Code

This is using done by writing custom code e.g. by using SAP FM like

SWE_EVENT_CREATE inside user exits, BADI etc. CALL FUNCTION 'SWE_EVENT_CREATE'

EXPORTING OBJTYPE = OBJTYPE OBJKEY = OBJKEY EVENT = EVENT CREATOR = APPLICANT START_WITH_DELAY = ' ' IMPORTING EVENT_ID = EVENTID TABLES EVENT_CONTAINER = CONTAINER EXCEPTIONS OBJTYPE_NOT_FOUND = 01.

IF SY-SUBRC = 0.COMMIT WORK.

ENDIF.

CALL FUNCTION 'SWE_EVENT_CREATE' EXPORTING OBJTYPE = OBJTYPE OBJKEY = OBJKEY EVENT = EVENT CREATOR = APPLICANT START_WITH_DELAY = ' ' IMPORTING EVENT_ID = EVENTID TABLES EVENT_CONTAINER = CONTAINER EXCEPTIONS OBJTYPE_NOT_FOUND = 01.

IF SY-SUBRC = 0.COMMIT WORK.

ENDIF.

Page 77: Introduction to Workflow-For Beginner

|

Event Creators, Receivers and Event Linkage

PublishedEvents

Receivers

Event

Linkage

Creator

Anybody wantthis event?

Page 78: Introduction to Workflow-For Beginner

|

Type Linkage Entry

Transaction: SWE2Menu Path :Basic menu -> Tools -> Business Workflow -> Utilities > Other tools >Event linkage

Page 79: Introduction to Workflow-For Beginner

|

Event Trace

Transaction: SWELMenu Path :Basic menu -> Tools -> Business Workflow -> Development -> Utilities -> Events -> Event Trace.

Page 80: Introduction to Workflow-For Beginner

|

Organisational Structure

Page 81: Introduction to Workflow-For Beginner

|

Organizational Structure Business Scenario

ƒ An organizational plan in SAP describes the organizational structure of a company.

ƒ The workflow system finds the agents of the individual tasks by evaluating the organizational plan

ƒ The functions to create and maintain organizational plans are part of the Personnel Planning and Development (PD) part of the SAP HR module

ƒ You must connect this organizational structure to the workflow

Page 82: Introduction to Workflow-For Beginner

|

ƒ Organizational units contain positions, occupied by employees.

ƒ Jobs are abstract descriptions of task assignments.

ƒ Positions can be linked to jobs. They inherit all the tasks assigned to that job.

ƒ Users. A user is an SAP logon user ID. It thus represents a single person.

ƒ Persons. A person is a specific employee created in the HR module.

ƒ Workflow tasks can be assigned to organizational units, positions, jobs or users.

ƒ The workflow system uses organizational structure to route work items to the correct recipients

Organizational Management

Page 83: Introduction to Workflow-For Beginner

|

Create Organisational Plan

Create root organizational unitCreate root organizational unit

Additional organizational unitsAdditional organizational units

Create jobsCreate jobs

Create positionsCreate positions

Assign HoldersAssign Holders

Assign tasksAssign tasks

Transaction: Menu Path: PPOCWTools Business Workflow - Development - Environment - Organizational Management - Simple Maintenance – Org plan basic data - Create

Create Executive BoardCreate Executive Board

Create Sales region , ProductionCreate Sales region , Production

Administrator , Sales ManagerAdministrator , Sales Manager

Sales Manager – eastern ZoneSales Manager – eastern Zone

Create Sales OrderCreate Sales Order

Page 84: Introduction to Workflow-For Beginner

|

Position: Secretary

Position: FI administrator 1

Position: FI administrator 2

Organizational unit: FI department

Position: Head of FI depatment

Job for FI employee

User 1

Manager job

Job for secretary

User 2

User 3

User 2

Task

Task

Task

Assigment Workflow Task Organizational Objects

Page 85: Introduction to Workflow-For Beginner

|

Agent Assignment and Role Resolution

- Workflow -

Page 86: Introduction to Workflow-For Beginner

|

Agent

Agent is an executor of a work item.

ƒ Agent is responsible for executing a task in a workflow.

ƒ Agent is determined by the system either through organizational chart or directly if user is assigned as agent for a particular task.

ƒ If the agents of the individual workflow steps are determined using the customer-specific organizational chart, your agent assignment in the workflow remains flexible to change.

Page 87: Introduction to Workflow-For Beginner

|

Types of Agents

Deadline Agents

Notification Agents

Processing Agents

Selected agentsare those possible agents who are elected to execute a task at runtime

Possible agentsare a collection of agents who qualify to execute a work item

Actual agent is the agent among those selected agents who actually processes the work item

Page 88: Introduction to Workflow-For Beginner

|

Role Resolution

List of possible agents (executors) of a task(All supervisors in a dept.)

Selected Agent(s)(Mr. Banning)

Role Resolution

(Supervisor of User PBACON)

Role = Rules

A role defines rules by which selected agents can be determined at runtime through

role resolution. Role resolution restricts the number of possible agents.

Page 89: Introduction to Workflow-For Beginner

|

Standard Rules

A rule container is defined for each rule.

The rule parameters determine which information is required for the rule resolution

to be executed at runtime.

If an error occurs during rule resolution, setting the termination indicator for the rule

resolution determines how the workflow will continue:

Flag is selected - the workflow assumes an Error status and a notification is sent

to the workflow administrator.

Indicator is not activated - the workflow forwards this work item to ALL possible

agents.

Page 90: Introduction to Workflow-For Beginner

|

Rule Basics

Transaction : PFAC_INS(Create)Menu Path: Tools – Business Workflow – Development – Definition tools – Rules for Agent Assignment – Create/Change/Display.

Each rule gets a 8 digit generated by the system prefixed with ACRules can be tested using PFTC or by function module ‘RH_GET_ACTORS’

Page 91: Introduction to Workflow-For Beginner

|

Rule Definition in a Activity Step Type

Various options to create standard rules :

1. Responsibility (Pure configuration no ABAP coding) Defined Value ranges are assigned to Agents Data is filled from workflow container at runtime

2. Evulution paths (Pure configuration no ABAP coding)

3. Organizational data (Pure configuration no ABAP coding) Jobs , positions

4. Functions to be executed – ABAP Code – Function Module

Page 92: Introduction to Workflow-For Beginner

|

Via organizational objects: Role resolution utilizing organizational data analyses

the assignment of an organizational object (plant, laboratory, MRP controller,

planner group, shipping point, sales office) to a position or organizational unit.

Plant Laboratory Sales Office

Execution of a Role Resolutionvia Organizational Objects

Page 93: Introduction to Workflow-For Beginner

|

Tasks: Possible Agents & Default Roles

User Position Job Org. Unit Person

TASK

Default role

Possible agents

Business Workplace

The workplace displays thework items for a agent

Page 94: Introduction to Workflow-For Beginner

|

How are Selected Agents Determined With and Without a Default Role?

Possible Agents

Task definition withno default role

Task definition withdefault role

Triggering Event

Page 95: Introduction to Workflow-For Beginner

|

How are Selected Agents Determined With a WF Agent?

All possible agents who qualify to execute task

Step definition at workflowdefn. level with an agentspecified. This overrides

default role at task defn. level

Task definition withno default role

Task definition withdefault role

Triggering Event

Page 96: Introduction to Workflow-For Beginner

|

Workflow and ALE

Page 97: Introduction to Workflow-For Beginner

|

ALE error handling

User action R/3 action

Execute Workitem

Fix error and reprocess IDocorFlag IDoc for deletion

Error in inbound function module

ALE triggers error event

Workitem appears in user's Inbox

Display IDoc for user processing

(IDoc method "InputForeground")

ALE triggers end event

Workitem completed

input Error Occurred

input Finished

Page 98: Introduction to Workflow-For Beginner

|

Workflow and ALE

Error Notification

Active Monitoring

IDOC Processing

Notification of successful posting

Page 99: Introduction to Workflow-For Beginner

|

Workflow and Error Notification

D eterm ineR ecip ients

U ser checks inboxand executes the

work item

Fix the error

P urge the ID oc

R estart theprocess

U ser/G roupgets no tified

via a work item

C an error befixed?

E nd

E xceptionR aised

Yes

N o

Business User Analysis

Page 100: Introduction to Workflow-For Beginner

|

Active Monitoring

Active monitoring allows to specify threshold values for the state of the systemFor e.g threshold can be on the number of IDocs in error or the time limit

Report Program RSEIDOCA can be executed periodically Selection screen takes as input the threshold values and persons to be notified When defined threshold is exceeded Single Step Task TS30200088 is executed

Page 101: Introduction to Workflow-For Beginner

|

Setting up Inbound Process via Workflow

The standard system can be configured to start a WF for an incoming IDoc. Useful when review is essential before posting Custom. SAP does not deliver standard. The settings are:

--Create the custom task or WF

--Create a new process Code ( WE42) and attach this

custom WF/Task.

--In the Partner Profile, attach the new Process code

Page 102: Introduction to Workflow-For Beginner

|

Notification of Successful Posting

The ALE/EDI interface can raise events on successful posting of an IDOC. The settings are:

--Identify the Appl.Obj created by the Idoc. Txn: WE57

--Identify the event that needs to be raised. --Go to BD67, select Process code and

populate Object type and Event. --Identify/Create tasks/WF and enable event

linkage.

Page 103: Introduction to Workflow-For Beginner

|

ALE error handling

Necessary Steps: Create new object type in Business Object Repository for IDOC; object

is child of IDOCAPPL Create new customer task Create event-couplings linking

Event ‘inputErrorOccured’ linked to standard task

Event ‘inputFinished’ to function module To support mass processing:

Create new object type as child of IDOCPACKET Maintain process code to refer the above objects and events


Top Related