Sap Workflow Training
Sap Workflow Training
Sap Workflow Training
Content:
Sap workflow introduction
Creation of events
Creation of tasks
The SAP workflow can be linked to other software tools such as Microsoft
Outlook or Lotus Notes. Using SAP Workflow, each step of a business
transaction can be easily monitored throughout the initiation and completion
of the business processes.
Sap business workflow introduction
SAP Business Workflow is the R/3 tool for handling the process
automation within R/3 or between R/3 systems and other systems
involved in the business process. It is flexible enough to handle ad hoc
processes such as the circulation of an electronic document.
It is particularly beneficial:
when the duration of the process is critical and deadlines have to be met.
Sap business workflow introduction
How does it work?
When the workflow runs it creates work items which are like e-mails,
but
they have the advantage that they contain the intelligence needed to
execute the relevant task with the correct data when the operational
user executes them,
they provide their own functionality so that the operational user has
access to everything that is useful to improve the flow of the process,
Sap business workflow introduction
How does it work?
Automatic Customizing covers all the activities that concern the technical basic
settings.
The following standard settings are amongst those made:
Object Type:
the customer can create new object types or extend SAP objects
by creating subtypes (child objects).
Interfaces:
Attributes:
The subtype maintains references to all the attributes and methods of its
parent object. This means that any methods and attributes defined on the
parent can be executed and accessed on the child object
If a subtype object were merely a copy of its parent, then all the code
contained within the parent would be physically copied to the child. This is
not the case.
You can easily add your own business rules to the parent methods by
redefining the subtypes method. In the following example, I will show why
this distinction is so important.
Creation of sub object type
Create sub business object type:
Path: ABAP Workbench ->Development->Business Object Builder
T-code: SWO1.
Enter standard business object name for which you need to create sub type.
Creation of sub object type
Creation of sub object type
Delegation:
Now that you have implemented a new zrmsfmwfgetdetails method, you need to tell
the SAP system to use the defined version of zrmsfmwfgetdetails and not the version
that was delivered on the bus2000270 object. This is similar to object-oriented
inheritance but the two concepts do have fundamental differences.
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.
Creation of sub object type
Creation of sub object type
Creation of business objects
Creation of business objects
Methods:
Events
An event may start, terminate or continue tasks and workflows.
The list of possible events is defined with the relevant object type
in the Business Object Builder. This list can be extended
according to customer requirements using the delegation
concept. The actual creation of the events added must be
catered for.
Each event carries information from its creation context in its
event container. This information is available to the receiver of
the event and can be used for event-driven control and
communication mechanisms..
Creation of events
Types of event creation method:
A status is an indicator that can have only the states set (active) or not set (not
active). Statuses that can have more than these two states are not supported.
These statuses can be set by the system (system status) and by the user
(user status).
System statuses are indicators that are only set by the system. Their purpose
is to document the current state of an object from the system viewpoint.
User statuses are indicators defined by the user, which document the
processing state of the object from the viewpoint of the user.
Creation of events Upon Status Change
Choose Tools → Business Workflow → Development → Definition Tools → Events
→ Event Creation → Status Management. Alternately, you can go to transaction
BSVW.
Creation of events Upon Status Change
Creation of events Upon Status Change
Enter a status object type in the field StatusOT and the object type whose status
change is to be indicated by the event created in the field BusinessOT. Enter the ID
of the event to be created in the field Event. For ex-As an event is to be triggered for
a change in the status of a grantor application, then status object type should be
chosen as GRH and the object type has been created with BUS2000270 (Grant
application). zuser_status_e0018 (dept pending check) as triggering event for dept
level workflow.
Creation of events Upon Status Change
Then select the row and click on “Status Restrictions”. Click on new entries and add
the statuses with which the event needs to be linked. For ex- If the statuses E0018
(Dept pending check) are to be linked, then these are added to system statuses.
Afterwards, save the entries.
Thus, if any grant application are saved with status E0018, the event
ZUSER_STATUS_E0018 would be triggered. Thus this event can now be used as
the triggering event of a workflow or a task as usual.
Creation of events Upon Status Change
If you got this error message "No key information available for status object GRH".
Then go to SM30 enter view name BSVWVCOUP6
Creation of events
Evaluation and Maintenance of Type Linkages
The type linkage describes the assignment of a receiver function module and a receiver
type to a particular combination of object type and event.
A type linkage must be created if the system is always to react to an event of a particular
object type. The type linkages are evaluated at runtime by the event manager. The event
receiver should define a type linkage using a function module provided.
Creation of events
If you enter an event as a triggering event of a workflow, for example, the following
entries are made automatically:
Object type and event ID
Workflow to be started as receiver type
Function module SWW_WI_CREATE_VIA_EVENT_IBF as receiver
function module
Creation of events
Evaluation and Maintenance of Instance Linkages
This linkage defined by the receiver instance itself using a function module provided.
An instance linkage is always defined at event receiver runtime.
Creation of events
The general part of the instance linkage is the same as a type linkage that uses the
entry WORKITEM or EVENTITEM as receiver type. There can be several instance
linkages for one type linkage of this kind.
Creation of events using change document
Change Documents
Many business objects are changed frequently, and these changes are logged into
change documents to make the changes traceable. Change documents can be
created for changes already made as well as for planned changes. The creation of
an event can be connected to the writing of these change documents, thus
connecting them to triggering of workflows.
Click on New Entries and add a new record linking the change document to the
required event. It is to be remembered that the business object type to which the
event belongs and the change documents must have the same key fields.
Creation of events using change document
Finally, before a change document object can be used for event creation, certain
settings must be made. This information is required, for example, for correct
assignment between change document object and object type. To maintain the
workflow-relevant settings of change documents, choose Tools → Business
Workflow → Development → Definition tools → Events → Event creation → Change
documents → Define workflow properties. Alternately, you could go to transaction
SWED.
Creation of events using Business Transaction
Business Transaction Events:
G/L accounting and accounts receivable/payable accounting provide
publish and subscribe interfaces, which inform other application
components or external interested parties (partners, customers) that
particular events (such as document entered) have taken place in
financial accounting. The data this creates can be used by the
interested parties for their own subsequent processing. But no data can
be returned to G/L accounting or accounts receivable/payable
accounting.
SAP Business Workflow uses this interface to create events of object
types defined in the Business Object Repository from its events. These
events can be used as triggering events of a workflow.
Let us look at a simple scenario of configuring Business Transaction
Events:
Go to Financial Accounting → Financial Accounting Global Settings →
Business Transaction Events.
Creation of events using Business Transaction
Creation of events using Business Transaction
Execute and go to Environment → Infosystem (Processes).
Inside the created function module ZSAMPLE_PROCESS_00001120, you can call the
function module SWE_EVENT_CREATE to trigger any event which has been added
as the triggering element for a workflow or a task.
Creation of events using Business Transaction
Return to the main screen for Business Transaction Events. In order to assign the
function module to an event, create a product as shown.
Add a New entry as shown. Ensure that the Active check box is checked, otherwise
the BTE won’t trigger. Save and return to the main menu.
Creation of events using change document
Now, that the configuration steps are completed, if a new document is created
through transaction FB01, the triggering event for the workflow will be created along
with it.
Creation of events Upon LIS Exception
Creation of Events Upon LIS Exceptions
The Early Warning System uses the key figures of the Logistics Information System
(LIS). The Early Warning System enables you to select and check weak points within
Logistics. The Early Warning System enables you to search for exceptional situations,
thus helping you to recognize and rectify potential problems at an early stage.
You define the exceptional situation as Exception within the Early Warning System. An
exception consists of the specification of characteristics and/or characteristic values
(such as vendor, material) and conditions. Conditions can be created as threshold
values (such as materials/vendors with an order value greater than €5000), as trends
(such as a positive trend in the order value) or as planned/actual comparisons.
For more information on the LIS and the Early Warning System choose Logistics
->Logistics (General) ->Logistics Information System -> Early Warning System:
Overview.
Creation of events by calling function module
Creation of Events by Calling a Function Module
You can create events from application or system programs by calling one of the
relevant function modules SWE_EVENT_CREATE or
SAP_WAPI_CREATE_EVENT .
For the following special cases, there are other function modules, which actually
use the functionality of the above function module internally:
SWE_EVENT_CREATE_IN_UPD_TASK
This function module makes it possible to create events in an update task. In
contrast to the function module SWE_EVENT_CREATE , it can be called with the
addition of IN UPDATE TASK .
SWE_EVENT_CREATE_FOR_UPD_TASK
The event is created in the update task.
Creation of Events by Using ABAP Classes
The triggering of events described here relates to events that are processed by
the event manager. These events must be triggered by the ABAP class
CL_SWF_EVT_EVENT.
The respective error causes are designated with a letter. The legend can be consulted for
an short explanation of the error causes. The most common error causes are:
•There is no workflow definition for the workflow to be started (error cause a).
•The workflow is not activated (error causes b, c).
•The type linkage between the triggering event and the task or workflow has not been
activated (error cause e).
The binding definition from the event container to the workflow or task container has
errors (error causes h, i). The task or workflow may nevertheless be started but will
probably not be processed as expected.
Event Simulation
Path: ABAP Workbench->Development->SAP Business Workflow
-> Utilities-> Events-> Simulate event
T-code: SWU0
Event Trace
All events created correctly are logged in the event trace irrespective of whether
potential receivers exist.
If a receiver is entered in the event trace, it does not necessarily mean that this
receiver was called successfully.
Event Trace
Path: ABAP Workbench->Development->SAP Business Workflow
-> Utilities-> Events-> Event Trace-> Switch Event Trace On/Off
T-code: SWELS
Event data:
Triggering object type,
triggering object
Event ID,
Triggering program,
Trigger date and time.
Display Event Trace
Path: ABAP Workbench->Development->SAP Business Workflow
-> Utilities-> Events-> Event Trace-> Display Event Trace
T-code: SWEL
Creation of tasks
Tasks are the central element in the workflow system.
Tasks are used to describe a business process. These tasks may require a single step
(single-step task) to be executed or several, possibly parallel, steps (multistep task)
Customer tasks are client-dependent and have a period of validity. They are
therefore integrated in organizational management with its planning and time
limitation options.
Standard tasks are client-independent and are defined without a period of validity
Creation of standard task
The workflow system automatically makes proposals for the following binding
definitions:
Binding definition from workflow container to task container
Binding definition from task container to workflow container
Binding definition from task container to method container
Binding definition from method container to task container
Creation of standard task
Creation of sub object type
Task container is used to process the container elements. Each task container already
contains the workflow system elements and any additional elements for the method
parameters of the referenced object method.
Creation of sub object type
You can define bindings from the task container to the following containers:
Workflow container
Role container
Method container
Creation of standard task
Creation of standard task
Workflow builder
The Workflow Builder provides a graphical view of the workflow definition. The
alphanumeric workflow editor provides a textual view of the workflow definition in
a tree display, as an alternative to the Workflow Builder.
In a user decision, the recipients receive the task description together with the
possible decision options during execution. You can use a user decision in the
following situations:
Only one of several possible alternatives can be processed in the workflow from a
business point of view at execution time.
A decision about the progression of the workflow must be made in dialog with a user.
An instruction (= user decision with only one decision option) is required to continue
the workflow.
For approval and release steps, possibly in connection with a secondary method
(the latter is possible without the application having to cater for these functions).
User Decision
good,
in which place you are working in india?