103
SAP BUSINESS WORKFLOW

Workflow Session

Embed Size (px)

DESCRIPTION

workflow

Citation preview

Page 1: Workflow Session

SAP BUSINESS WORKFLOW

Page 2: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

SAP Business Workflow Architecture

Page 8: Workflow Session

|

Workflow Architecture

OrganisationalLevel

Process Level

Business Object Level

Page 9: Workflow Session

|

Workflow Definition

Page 10: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

Workflow Definition - Steps

A workflow definition is made up of individual modular steps.

Page 13: Workflow Session

|

Example Workflow Create a simple workflow

Page 14: Workflow Session

|

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: Workflow Session

|

Working with Workflow

Page 16: Workflow Session

|

How workflow gets executed

Page 17: Workflow Session

|

Workflow Toolbox - SWUS

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

Page 18: Workflow Session

|

Workflow Steps

Page 19: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

Task & Workflow Definition

Page 26: Workflow Session

|

Workflow Task To create workflow task use transaction –

PFTC

Page 27: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

Task Definition – Synchronous and Asynchronous Methods

Page 33: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

Work Items Types

Page 36: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

Business Object Definition and Implementation

Page 39: Workflow Session

|

ƒ 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: Workflow Session

|

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: Workflow Session

|

Object Type - Definition

Page 42: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

Attributes

Attributes provides access to data.

ABAP Dictionary Field Virtual

Page 45: Workflow Session

|

MethodsMethods 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: Workflow Session

|

– 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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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

Page 52: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

Business Object Repository (BOR)

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

Page 56: Workflow Session

|

Containers and Bindings- Workflow -

Page 57: Workflow Session

|

Types of Containers

Page 58: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

Other Types of Containers

Event parameter containerContains an element which can take the (object) reference to

the objectwhose change of status is announced via the event.

Role parameter containerContains the elements required as input in connection with the

roleresolution to be run at runtime.

Method parameter containerContains elements which will be required as import and export

parametersin connection with the method execution.

Page 61: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

Container & Dataflow

TaskContainer

MethodContainer

EventContainer

Workflow Container

triggeringevent

synctask

syncmetho

dsynctask

syncmetho

drole

asynctask

asyncmetho

d

4

terminatingevent

12

3

567

8

9

1011

12 13

1415

RoleContainer

Page 64: Workflow Session

|

Writing/Reading Container Elements Defined as Field Values

SWC_GET_ELEMENTSWC_SET_ELEMENT

Variable

Container Instance

VariableSWC_GET_TABLE

SWC_SET_TABLEdelete value

InternalTable

InternalTable SWC_DELETE_ELEME

NT

Page 65: Workflow Session

|

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: Workflow Session

|

Reading Container Elements Defined as Object Types

Container Instance:

CONTAINERDeclare 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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

Events

Page 70: Workflow Session

|

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: Workflow Session

|

Types of Event Creation

Change Document

Status Management

MessageControl

Specific HR Tables

ABAP CodeIn User Exit

Page 72: Workflow Session

|

Using Customizing for event trigger

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

Page 73: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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.

Page 77: Workflow Session

|

Event Creators, Receivers and Event Linkage

PublishedEvents

Receivers

Event

Linkage

Creator

Anybody wantthis event?

Page 78: Workflow Session

|

Type Linkage Entry

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

Page 79: Workflow Session

|

Event Trace

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

Page 80: Workflow Session

|

Organisational Structure

Page 81: Workflow Session

|

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: Workflow Session

|

ƒ 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: Workflow Session

|

Create Organisational Plan

Create root organizational unit

Additional organizational units

Create jobs

Create positions

Assign Holders

Assign tasks

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

Create Executive Board

Create Sales region , Production

Administrator , Sales Manager

Sales Manager – eastern Zone

Create Sales Order

Page 84: Workflow Session

|

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: Workflow Session

|

Agent Assignment and Role Resolution

- Workflow -

Page 86: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

Workflow and ALE

Page 97: Workflow Session

|

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: Workflow Session

|

Workflow and ALE

Error Notification

Active Monitoring

IDOC Processing

Notification of successful posting

Page 99: Workflow Session

|

Workflow and Error Notification

D eterm ineR ecip ients

U ser checks inboxand executes the

work item

F ix the erro r

P urge the ID oc

Resta rt theprocess

U ser/G roupgets no tified

via a work item

C an error befixed?

End

E xceptionR aised

Yes

No

Business User Analysis

Page 100: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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: Workflow Session

|

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