Upload
api-3823432
View
1.344
Download
6
Embed Size (px)
Citation preview
WorkFlow
An Overview
• Workflow is automation of business Workflow is automation of business practices as a whole or their parts, practices as a whole or their parts, during which documents, information during which documents, information or tasks are moved from one or tasks are moved from one participant to the other for further participant to the other for further processing, which corresponds to the processing, which corresponds to the defined organizational structure.defined organizational structure.
DefinitionDefinition
• Why do we need Workflow?
• In most business processes, the time involved in the• actual processing of data is only a fraction of the• total time required to complete a transaction. Most • of the time from start to finish is consumed by• moving data from one person to another and waiting• for that data to be used.
• SAP Business Workflow provides you with infrastructure and tools that enable you to manage your human resources and business processes more efficiently. It helps you get data quickly to the right person-even if that person is in a different office or a different country-and makes it easy for approvers to deal with transactions and send them on to the next step.
• SAP Business Workflow uses the existing transactions and functions of the R/3 System and does not change the functions. You can combine the existing functions of the R/3 System to form new business processes with SAP Business Workflow. The workflow system takes over control of the business processes.
• If you are already using SAP Organizational Management, you can use the organizational structure created there to have the relevant agents carry out the individual activities. It is possible to have an activity carried out by a position.
What does Workflow do ?
• To define business processes that are not yet mapped in the R/3 System
simple release approval procedures creating a material master associated coordination of the departments involved.
• Particularly suitable for situations with repeated work processes, or situations involving a large number of agents in a specific sequence for a business process.
Where and why ?
• Improvement of information flow
• Increase of effectiveness of practices and decrease of total costs
• Making the activities and communication in the business practice more effective
• Transparency of business practices
• Deadline Control
Profits from implementation of Workflow :
•
• Workflow Builder- SWDD• Workflow Wizard Explorer-SWF3• Business Object Builder –SWO1• Business Workflow Explorer-SWDM• Business Workplace - SBWP
Features & Tools Available
From a technical point of view, a SAP workflow consists of 3 main components :
• Workflow
• Task
• Object Method
Workflow Components
Workflow TaskObject Method
The workflow :
•A series of tasks which represents a business process (e.g. Leave Approval Business Process)
•Defines what tasks are executed (sometimes based on outcomes of previous tasks)
A task :
• Usually akin to a specific step in a process (ie. Display Employee Leave History)
• Define Agents (which users can and cannot execute the step)
• Deadline monitoring is defined here
An object method :
•The ABAP which actually executes the task. (ie. SQL, etc)
•This could be straight ABAP
•Or Call Transaction (dialog task)
•Call to a FM, subroutine, etc
• As SAP Business Workflow was developed• on an object-oriented basis, it is possible to • enter relevant information as object types• in the SAP system.
• Examples : Material Master• Sales Order
Business Object Builder
Objects are comprised of:
•Key fields •Attributes •Interfaces •Methods •Events
Business Object Builder
•In order to define an object in SAP, it must have a key. Normally, this is done with reference to some database table via SAP's data dictionary (DDIC). The key may be comprised of one or more fields. If more than one field, the object key is then a concatenation of the fields.
Key Fields
•The attributes of the object are any other non-key data related to the object. Again, this is defined via the data dictionary. If so, SAP will generate the code necessary to retrieve the data.
•Attributes can also be freely defined by using the Virtual option. In this case, the developer must write the code in order to retrieve the attribute's value.
Attributes
•Interfaces are predefined components inherited by the object. This is SAP's mechanism by which Virtual functions may be implemented.
•The 'Interface' object has a number of methods. These methods are then inherited by the Object.
•In order to use the methods, the Interface object must be extended and code added to the method in order to handle the particular object.
Interfaces
•Methods define which functions an object can do. Methods are coded. They may call any existing functionality in SAP. It has Import, Export, Table, Exception and Results parameters.
•A method can be viewed as a Remote Function Module (RFC), although it actually is executed as a tRFC (Transactional RFC) or aRFC (Asynchronous RFC).
Methods
•Events generally occur within a particular context. In this case, related to the Object under which it is defined. An event must be defined in order to be published (External event). In order to publish the event, the object's key must be specified in order to define the context. The event may also carry with it other data components. This is done by defining the event's parameters.
Events
Program
The definition of any object requires that a program be defined for it. When maintaining it's various components, SAP generates code which is placed in the program. The Key definition, Attribute access and methods are all stored in the program.
•Events (publish and subscribe mechanism)
Majority of workflow are triggered by events. A developer will register a workflow for a particular event. When this event occurs (ie. Sales Order.Created, Parked Document Deleted) the subscribed workflow will be triggered (ignoring Check FMs and starting conditions)
Status Management
Change Documents
User Exits and others
•Manual Triggering
–Various Function Modules
Triggering Mechanisms
Workflow Components
Workflow TaskObject Method
•
• Tasks describe elementary business activities. Tasks always refer to a method of an object type. Possible agents are defined for tasks. Tasks can refer to automatically executable methods (background tasks) or they can need a user to execute them (dialog tasks).
Task
•
• A task is referenced in an activity as a step in a workflow definition. A task can refer to
A customer task/standard task
A workflow task/workflow template.
Task as a Step in a Workflow DefinitionTask as a Step in a Workflow Definition
• • Within SAP Business Workflow you use
tasks for the following purposes:
• To use methods of an object type in a workflow (Single step task)
• As a framework for defining a workflow (Multistep task)
•
Creating a Workflow TaskCreating a Workflow Task
• Single step task
• You use a Single step task to define an activity that can be executed within a workflow definition or independently. This activity can be a transaction in the R/3 System.
• A single-step task can be part of a workflow definition as a step of the type activity.
• Task containing a workflow definition. It
describes the formal "framework" (interface, triggering events) for a workflow definition.
In addition to the reference to the workflow definition, the multistep task contains other information:
Definition of the workflow container (interface description)
Triggering events
Multiple step task
T For customer tasks
TS For standard tasks
WF For workflow tasks
WS For workflow templates
Task TypeTask Type
•The process of determining which Agent(s) is responsible for a particular Task.
•For Role Resolution to occur, the Task must be defined as a Dialog Task.
•The responsible Agents for a Task/Step are specified ‘Directly’ or ‘Indirectly’ in the ‘Responsibility’ screen of the Step or the ‘Additional Data->Agent Assignment’ menu option of the Task. At runtime, the system first looks in the Step definition, then in the Task definition.
Role Resolution – Determining the Agent(s)
Role Resolution – Determining the Agent(s)
•Directly’: Specification of the user name•‘Indirectly’: Association to another component linked to one or more users. eg. Org. Units, Job and Position Definitions and Work Centers. (based on the PD Org. structure shared by the HR module).•Standard Role is most flexible mechanism. •Determination of the Agent(s) is fully programmable via the creation of a function module.
• The exchange of information between the individual
components of the workflow system is based on standardized rules which are specified in the binding definition.
• Containers• Local data repository for a particular component. Used in:
Workflow Definition Step (Workitem) Task• Containers, with their table-like structures, are used to contain
values (constants) and object references for control purposes for the workflow process and execution of work items.
•
Dataflow: Containers and Binding
Binding
Information is exchanged between the individual containers according to the assignment rules specified in the binding definition.
•Mechanism by which data is transferred from one container to another.
•Essentially a data mapping step.
•Each container is defined with its components
• Container of a task for storing data from the task
environment.
• The task container contains the control information
• in the form of constants and object references:
• Information on execution of the object method (object reference to the object to be processed, current agent of work item, and so on)
• Information available after processing the method • The task container already contains some defined
• workflow system variables.
Task container
• The task container holds some container
elements as workflow system elements. You cannot edit these but you can use them. The workflow system assigns values to the workflow system elements as standard.
• _WI_Object_ID _WI_Result
• _WI_Actual_Agent _Attach_Objects
• _Adhoc_Objects _WI_Group_ID
• _Workitem
Workflow System Elements in the Task Container
• Defining tasks
• Maintenance of agent assignments
• Long texts for tasks
• Specifying a triggering event
• Activating linkage
• Defining binding between events and tasks
• Specifying a default role for tasks
• Defining binding between a task and a role
Defining Single-Step Tasks
Standard Task Creation – Material Create
Triggering Events
Dataflow – Binding between Containers
Agent Assignment
Agent Assignment - User
• Enhancements to object type• · Events• · Attributes
Creating subtypes for existing object types
Adding an event Adding attributes Activating object types
Identifying and Enhancing Object Types
Creating your own Business Object Types
Creating Attributes
Creating Methods
Creating Methods
Creating Methods
Creating Events
• Change documents always refer to a business change document object. One or more tables are assigned to each change document object.
• Change documents are written when the value in a table field changes, but only
• · if the table is assigned to a change document object,
• · if the data element in the table field is marked as requiring a change document.
Raising Events via Change Documents
Creating an event when a change
document is written
Assignment between change document objects and object types
Flexible Event Creation
Change Document Objects : Overview - SCDO
Data Element of the table field marked as Change Document
• · BUS1001 (Material)
Connection to Workflow Functionality
Events for Change Document - SWEC
Workflow Components
Workflow TaskObject Method
A workflow template is a modular grouping of
individual steps. Example : activity(task
reference ) multiple / single
conditions loopThe steps can either be arranged as a
sequence or to be processed in parallel.
Each step is a determining component of “its” block.An operation on a single step always affects the whole block containing that step.
Workflow Template
Workflow Template Create – Multi Step Basic Data
Workflow Template Create – Multi Step Container
Workflow Template Create – Multi Step Triggering Events
Workflow Template Create – Multi Step Agent Assignment
Workflow Template Create – Multi Step Defining Steps
Steps
Steps perform some action - Execute a method, Compare/set values, Request user decisions.
Activity Condition / Multiple Condition Event Creator / Wait For Event Workflow Control / User Decision Loop Until / Loop While Container Operation Fork
Activity
An activity step executes the code of an object’s method via a Task. When creating the Task, we specify which object and method the Task is to execute.
Dialog Tasks and Background Tasks Background tasks do not need a user.
Therefore, the method is executed immediately.
Dialog Tasks
Dialog tasks involve user input. Workflow determines the agents(users) via
Role Resolution. The Agent(s) receives a Mail informing that
they must complete the relevant task by ‘Executing’ the Mail.
When executed, the method associated with the task will run.
The method may now do anything that is required, such as display a Purchase Order or run a report.
Condition / Multiple Condition
Condition Allows for the ability to test the value of an
expression (normally a container variable). This will generate a True/False branch and associated events.
Multiple Condition Allows for the ability to associate the value(s)
of an expression (normally a container variable) with any subsequent events (along with subsequent ‘Undefined’ steps).
Event Creator /Wait For Event
Event Creator Raises an external event, which must be associated with an object. It can be used to trigger other workflows, signal the end of an asynchronous process or to communicate to a running Workflow.
Wait For Event Listens for a particular external event (which must be associated with an object) to be raised. Used to wait for a particular user process to occur (which would raise the event).
Workflow Control / Container Operation
Workflow Control Allows for the cancellation of the Workflow or of a work item (Runtime key must be supplied).
Container Operation sets a value to a container element.
User Decision
Sends a message to an Agent. Upon execution, a popup box will
display a set of options to the user. This is based on the default generic
task TS8267 (which can be swapped if it is needed to add special instructions to the user).
Loop Until / Loop While
Loop Until creates a feedback loop. At the end of the loop, a condition step is inserted. Continuing looping or not is controlled via the contents of a particular container variable.
Loop While creates a feedback loop. At the start of the loop, a multiple condition step is inserted. Continuing looping or not is controlled via the contents of a particular container variable.
Fork
Will create a fork of n specified branches which can run parallel steps.
Workflow Template Create – Multi Step Defining Binding between task and workflow container
Workflow Template Create – Multi Step Defining Agent to the step
•APPLICATIONS
• CA - Cross-Application Components
Processing Document Info Records .
Message Control .
EDI Status Record Processing .
• FI - Finance
Workflow Scenarios in Finance .
Workflow Scenarios in Asset Management .
Triggering a Workflow From a Validation .
• LO - Logistics
Changes with Reference to an Engineering
Change Request or Change Request or Engineering Change Order .
Logistics Information System: Trigger Workflow from an Exception in the Early Warning System.
• MM - Materials Management
Releasing a Purchase Requisition.
• QM - Quality Management
Quality Notification .
Quality Inspection .
• PM - Plant Maintenance
Maintenance Order Management .
Purchase Order Change .
Service Management
• PS - Project System
Workflow in the Project System .
PA - Personnel Administration
Recruitment .
Personnel Administration .
Process Absence Approval .
Automatic Generation of Documents for HR
Applications Using SAP Business Workflow.
•Questions ?