SlideShare a Scribd company logo
1 of 35
SAP Workflow and Events - Control the flow!
Day and Time: Thursday, May 16, 2013 - 12:30 PM - 1:30 PM Session 0811
Content Area: Business Integration, Technology and Infrastructure (BITI)
Insert Speaker Names
LEARNING POINTS
 How to use an event to control the
SAP Business Workflow
 How to trigger an event
 Standard SAP Methods
 Know about the advantages of using events
 Traceable
 Deactivatable/activateable
 Forward-looking – feeds into Process Observer/SAP Operation
Process Intelligence
Radio example for events
SAP Programs
(One Radio Station
 one Object Type)
Transmitter
Events
Antenna
Receiver
“On”
Start
Workflow
Instance
Terminate
Workitem
Trace events
SWEL
Trace
Workitems
SWI1
Event
Linkage
SWETYPV
RFC
check
SM58
APAP
Program
Events
of different
Business
Objects
or
ABAP
Objects
Transactions
to configure
events
Event
queue
SWEQADM
Instance
linkage
SWEINST
Simulate
event
SWUO
Manual
(Re) Trigger
SWUE
Switch event
trace on or off
SWELS
Overview: Events to Control Workflow
 Trigger a new instance of a Workflow
• Select the Workflow to be started
• Check, if the workflow should be started at all
• Start Workflow instance immediately
• Use the event queue to start a Workflow instance
 Terminate a dialog workitem
• Set the workitem to complete,
so that the workflow instance can continue
 Wait for an event
• Complete a section of a Workflow instance
• Complete a whole Workflow instance
 Start a ABAP function module
• Consume the event without any impact on workflow
Different ways to trigger an event
 SAP Configuration of Events
 HR Events
 Status Management
 Change Documents
 Message Control
 Trigger a BOR event via the ABAP function module
SAP_WAPI_CREATE_EVENT (Commit Work)
 Transaction SWETYPV
Different ways to trigger an event
 Triggered by program
 SAP provided program triggers the event
 Read SAP Help for Workflow Scenarios,
to find the required IMG configuration steps
 Use the event trace to find events
 Custom developed program will trigger the event
 Trigger a BOR event via the ABAP function module
SAP_WAPI_CREATE_EVENT
 Note: The event only occurs after the ABAP statement “COMMIT WORK.”
Information delivered by events
 Object Type
 Object Key Value
 Name of the events
• The event name indicates the status change
 User who triggered the event
 This user will become the workflow initiator for a workflow start
 Or the actual agent who completed a workitem
 Additional parameters
 For example: the required release code of a purchase requisition
What
data
is
delivered ?
How is the data delivered ?
• The Binding definition in the Workflow Builder stores the data in the
• Workflow Container
• Task Container
Event of a Business Object Type
SAP Configuration of Events
 It’s all right here (Tools> Business Workflow>
Development> Events)
SAP Configuration of Events
 For HR Events, look at transactions SWEHR1 and
SWEHR2 – these are SAP-defined events
 Then, if you need to, configure your own events using
SWEHR3
SAP Configuration of Events
 SWEHR3 uses the same Object Type, Infotypes, etc as
SWEHR2
 You define the Rules for when your event is raised in
custom functions – make sure you follow the
templates!
SAP Configuration of Events
 Change Documents are useful to trigger events when you
know a Change Document is written if Master Data changes
 Quick Check - go to TX SE12 and check for the ‘Change
Document’ flag on the data element
If the Change
Document box is not
ticked, you may have
to use a different
method
SAP Configuration of Events
 If you can use Change Docs, there is a nice condition
editor to help you complete your mission
After you select
the Field(s) which
you need to
trigger the event
from, you have the
ability to format
complex
conditions prior to
raising the event
SAP Configuration of Events
 Many objects in SAP already use Status Management –
Quality Inspection, Projects, Engineering Change
Requests…
SAP Configuration of Events
For customer statuses, you
define the status (or use a
system (ie: I) status, and it can
be in conjunction with others.
Event Linkage
Check Function Modules -
define specific criteria that
must be met in order to raise
the event.
Receiver Type Function
Modules will dynamically
determine which workflow
you need to start
Have the Event send you mail
UserID as Receiver
You get mail in your
SAPOffice inbox, and can
see the Event
Parameters too
MESSAGE CONTROL
 Output documents are created using SAP’s output
determination procedure
 Access output management for applications via SAP
Reference IMG (TAC SPRO)
 Generally, output is created based on condition table
for communication purposes between business
partners, e.g. print, fax, EDI, or between systems, e.g.
ALE
 Instead of creating an output document, SAP raises an
event in the system
MESSAGE CONTROL
Create output type with
transmission medium ‘9’
Maintain condition record and
use communication to define
event
BUSINESS TRANSACTION EVENTS
 “Publish & Subscribe” interface available for FI-GL, FI-
AP, and FI-AR
 Business transaction event linked to business object
event, i.e. 00000130 Post Document -> BKPF.CREATED
 Template function modules for event processing with
parameter interface available for supported
relationships
 Transaction to access business transaction events is
SWU_EWBTE for BTE wizard; you can use special TAC
for custom development, e.g. FIBF
BUSINESS TRANSACTION EVENTS
BUSINESS TRANSACTION EVENTS
 SAP application creates business transaction event
 Function module processes data to be passed on to
business object event
 Business object event is raised
 Event manager determines available active link(s) and
starts corresponding workflows
Event of a ABAP Object Type
The Event
Parameter
can be an
object of
another type
Event Linkage
Event Queue
Transaction SWEQADM is used to schedule the event queue in every system.
By spreading out the events, this job provides a better system performance.
Based on the size of your system, you can double or triple the number of events per minute.
Workflow with triggering event
Hint:
• The standard binding is for “_EVT_OBJECT” and “_EVT_CREATOR”
• The release-code is an extra parameter
• The “Aggregate” is an attribute of the object
Trigger
Workitem with Terminating Event
Hint:
One outcome for each
(activated) terminating event
Note:
Binding to bring data back to
the task container.
Another binding defines the
transport from the task to
the workflow container.
Workflow with Wait for Event
Workflow for a
preliminary
posted FI document
or invoice
A user outside
of this workflow
has deleted
this invoice
- End WorkflowA user has
changed
the invoice
- Restart
approval
An approver has
rejected the invoice
- Inform the initiator
WORKFLOW START CONDITIONS
 Workflow start conditions allow to implement the
evaluation of predefined criteria before a workflow
instance is started
 Conditions are defined by event container elements
and logical operators and evaluated every time a start
mechanism tries to trigger the corresponding workflow
 If the condition is not fulfilled, the workflow instance is
not started
 Transaction to access workflow start conditions is
SWB_COND
WORKFLOW START CONDITIONS
Select existing start conditions
based on standard criteria
Review and change details
of start condition
Workflow with and without events
Workflow with events Workflow without events
No delay for the triggering program.
Advantage:
No impact on triggering program
Triggering program waits for the
workflow instance to start.
Problems could have an impact on
the outside transaction
Dialog Workitem is completed, when
one of the terminating events has
occurred.
Advantage: Less risk of completing a
workitem too early.
Dialog Workitem is completed, when
the user backs out the launched
transaction or (if configured)
clicks on the ‘Complete Workitem’
button.
Use the “Wait for event” step to react
on object status changes, which
occurred outside of the workflow
process
Users can only influence the process,
by executing a workitem.
Trigger events to communicate with
other workflows
BEST PRACTICES
 Connect your SAP Business Workflow to SAP via events
 Trigger of a new workflow instance
 Example: A certain Sales Order status was applied
 Re-act on object status changes,
which were caused by activities outside of your workflow
 Example: Purchase requisition was changed
 Use events to complete a workitem
 Example: Specific System or User Status was set on a plant
maintenance order
 Use the event queue for events,
which could occur too often within a short period of time
KEY LEARNINGS
 Use events where ever possible
in your workflow design
 Trigger Workflow
 Terminate a workitem
 Wait for an outside event
 Activate the Workflow Event Trigger
(customizing transport)
 Check the events in the test system
 Turn off the event trace in the production system
THANK YOU FOR PARTICIPATING
Please provide feedback on this session by completing a
short survey via the event mobile application.
SESSION CODE: ####
For ongoing education on this area of focus,
visit www.ASUG.com

More Related Content

What's hot

Sap sapscripts tips and tricks
Sap sapscripts tips and tricksSap sapscripts tips and tricks
Sap sapscripts tips and tricks
Kranthi Kumar
 
Step by step guide to basic web dynpro abap
Step by step guide to basic web dynpro abapStep by step guide to basic web dynpro abap
Step by step guide to basic web dynpro abap
Kranthi Kumar
 
Chapter 01 user exits
Chapter 01 user exitsChapter 01 user exits
Chapter 01 user exits
Kranthi Kumar
 
Creating attachments to work items or to user decisions in workflows
Creating attachments to work items or to user decisions in workflowsCreating attachments to work items or to user decisions in workflows
Creating attachments to work items or to user decisions in workflows
Hicham Khallouki
 
Sap abap modularization interview questions
Sap abap modularization interview questionsSap abap modularization interview questions
Sap abap modularization interview questions
Pradipta Mohanty
 

What's hot (20)

Sap sapscripts tips and tricks
Sap sapscripts tips and tricksSap sapscripts tips and tricks
Sap sapscripts tips and tricks
 
Table maintenance generator and its modifications
Table maintenance generator and its modificationsTable maintenance generator and its modifications
Table maintenance generator and its modifications
 
Abap Objects for BW
Abap Objects for BWAbap Objects for BW
Abap Objects for BW
 
SAP Landscape
SAP Landscape SAP Landscape
SAP Landscape
 
Sap Purchase Order Workflow
Sap Purchase Order WorkflowSap Purchase Order Workflow
Sap Purchase Order Workflow
 
Step by step guide to basic web dynpro abap
Step by step guide to basic web dynpro abapStep by step guide to basic web dynpro abap
Step by step guide to basic web dynpro abap
 
Sap workflow training
Sap workflow trainingSap workflow training
Sap workflow training
 
Business workflow
Business workflowBusiness workflow
Business workflow
 
Bapi step-by-step
Bapi step-by-stepBapi step-by-step
Bapi step-by-step
 
Chapter 01 user exits
Chapter 01 user exitsChapter 01 user exits
Chapter 01 user exits
 
Creating attachments to work items or to user decisions in workflows
Creating attachments to work items or to user decisions in workflowsCreating attachments to work items or to user decisions in workflows
Creating attachments to work items or to user decisions in workflows
 
Sapscript
SapscriptSapscript
Sapscript
 
Field symbols
Field symbolsField symbols
Field symbols
 
Report Painter in SAP: Introduction
Report Painter in SAP: IntroductionReport Painter in SAP: Introduction
Report Painter in SAP: Introduction
 
Step by step lsmw tutorial
Step by step lsmw tutorialStep by step lsmw tutorial
Step by step lsmw tutorial
 
Sap abap modularization interview questions
Sap abap modularization interview questionsSap abap modularization interview questions
Sap abap modularization interview questions
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAP
 
Bdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONBdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATION
 
Workbench and customising request
Workbench and customising requestWorkbench and customising request
Workbench and customising request
 
Technical Overview of CDS View – SAP HANA Part I
Technical Overview of CDS View – SAP HANA Part ITechnical Overview of CDS View – SAP HANA Part I
Technical Overview of CDS View – SAP HANA Part I
 

Viewers also liked

Workflow Part1 1
Workflow Part1 1Workflow Part1 1
Workflow Part1 1
evil66_in
 
Workflow
WorkflowWorkflow
Workflow
isa0418
 
Ananda_SAP_HRABAP_WDP_Workflow with 4+ Years Exp
Ananda_SAP_HRABAP_WDP_Workflow with 4+ Years ExpAnanda_SAP_HRABAP_WDP_Workflow with 4+ Years Exp
Ananda_SAP_HRABAP_WDP_Workflow with 4+ Years Exp
Anand Uppara
 
m-Workflow: SAP Workflow on Any Mobile
m-Workflow: SAP Workflow on Any Mobilem-Workflow: SAP Workflow on Any Mobile
m-Workflow: SAP Workflow on Any Mobile
SquirrelSoftech
 

Viewers also liked (13)

Workflow Part1 1
Workflow Part1 1Workflow Part1 1
Workflow Part1 1
 
SAP Business Workflow - Best Practices
SAP Business Workflow - Best PracticesSAP Business Workflow - Best Practices
SAP Business Workflow - Best Practices
 
SAP workflow classics
SAP workflow classicsSAP workflow classics
SAP workflow classics
 
Workflow
WorkflowWorkflow
Workflow
 
Ananda_SAP_HRABAP_WDP_Workflow with 4+ Years Exp
Ananda_SAP_HRABAP_WDP_Workflow with 4+ Years ExpAnanda_SAP_HRABAP_WDP_Workflow with 4+ Years Exp
Ananda_SAP_HRABAP_WDP_Workflow with 4+ Years Exp
 
About work flow
About work flowAbout work flow
About work flow
 
David Carhuamaca Glenni - Indra - Caso de Éxito Integración Tarifaria Guipuzc...
David Carhuamaca Glenni - Indra - Caso de Éxito Integración Tarifaria Guipuzc...David Carhuamaca Glenni - Indra - Caso de Éxito Integración Tarifaria Guipuzc...
David Carhuamaca Glenni - Indra - Caso de Éxito Integración Tarifaria Guipuzc...
 
m-Workflow: SAP Workflow on Any Mobile
m-Workflow: SAP Workflow on Any Mobilem-Workflow: SAP Workflow on Any Mobile
m-Workflow: SAP Workflow on Any Mobile
 
Metrics
MetricsMetrics
Metrics
 
La newsletter de mgrh 48
La newsletter de mgrh 48La newsletter de mgrh 48
La newsletter de mgrh 48
 
Dashboards
DashboardsDashboards
Dashboards
 
HRDPower.net Recruitment Module Walkthrough
HRDPower.net Recruitment Module WalkthroughHRDPower.net Recruitment Module Walkthrough
HRDPower.net Recruitment Module Walkthrough
 
Talent Analytics
Talent AnalyticsTalent Analytics
Talent Analytics
 

Similar to SAP workflow events

03 01 whatisworkflow
03 01 whatisworkflow03 01 whatisworkflow
03 01 whatisworkflow
tflung
 
05 b 01workflowcustomizing
05 b 01workflowcustomizing05 b 01workflowcustomizing
05 b 01workflowcustomizing
tflung
 
07 a 01templates
07 a 01templates07 a 01templates
07 a 01templates
tflung
 
05 a 01workflowarchitecture
05 a 01workflowarchitecture05 a 01workflowarchitecture
05 a 01workflowarchitecture
tflung
 
The cornerstones of SAP workflow
The cornerstones of SAP workflowThe cornerstones of SAP workflow
The cornerstones of SAP workflow
Norikkon, LLC.
 

Similar to SAP workflow events (20)

]project-open[ Workflow Developer Tutorial Part 4
]project-open[ Workflow Developer Tutorial Part 4]project-open[ Workflow Developer Tutorial Part 4
]project-open[ Workflow Developer Tutorial Part 4
 
03 01 whatisworkflow
03 01 whatisworkflow03 01 whatisworkflow
03 01 whatisworkflow
 
Workflows via Event driven architecture
Workflows via Event driven architectureWorkflows via Event driven architecture
Workflows via Event driven architecture
 
05 b 01workflowcustomizing
05 b 01workflowcustomizing05 b 01workflowcustomizing
05 b 01workflowcustomizing
 
0801 sap business_workflow_and_business_rules_framework_plus_brfplus
0801 sap business_workflow_and_business_rules_framework_plus_brfplus0801 sap business_workflow_and_business_rules_framework_plus_brfplus
0801 sap business_workflow_and_business_rules_framework_plus_brfplus
 
07 a 01templates
07 a 01templates07 a 01templates
07 a 01templates
 
05 a 01workflowarchitecture
05 a 01workflowarchitecture05 a 01workflowarchitecture
05 a 01workflowarchitecture
 
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBuilding workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
 
Hbb 2852 gain insights into your business operations with bpm and kibana
Hbb 2852 gain insights into your business operations with bpm and kibanaHbb 2852 gain insights into your business operations with bpm and kibana
Hbb 2852 gain insights into your business operations with bpm and kibana
 
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...Process State vs. Object State: Modeling Best Practices for Simple Workflows ...
Process State vs. Object State: Modeling Best Practices for Simple Workflows ...
 
]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3]project-open[ Workflow Developer Tutorial Part 3
]project-open[ Workflow Developer Tutorial Part 3
 
Process mining with Disco (Eng)
Process mining with Disco (Eng)Process mining with Disco (Eng)
Process mining with Disco (Eng)
 
Drools & jBPM Info Sheet
Drools & jBPM Info SheetDrools & jBPM Info Sheet
Drools & jBPM Info Sheet
 
Salesforce Lightning Process Builder IS the next-generation workflow tool
Salesforce Lightning Process Builder IS the next-generation workflow toolSalesforce Lightning Process Builder IS the next-generation workflow tool
Salesforce Lightning Process Builder IS the next-generation workflow tool
 
Click, View & Do! - English
Click, View & Do! - EnglishClick, View & Do! - English
Click, View & Do! - English
 
Sue Keohan presents at BPX Day: Successful Collaboration between Business and IT
Sue Keohan presents at BPX Day: Successful Collaboration between Business and ITSue Keohan presents at BPX Day: Successful Collaboration between Business and IT
Sue Keohan presents at BPX Day: Successful Collaboration between Business and IT
 
Are processes masquerading as projects hurting your business
Are processes masquerading as projects hurting your businessAre processes masquerading as projects hurting your business
Are processes masquerading as projects hurting your business
 
The cornerstones of SAP workflow
The cornerstones of SAP workflowThe cornerstones of SAP workflow
The cornerstones of SAP workflow
 
TAG Presents: NetSuite SuiteFlow 101
TAG Presents: NetSuite SuiteFlow 101 TAG Presents: NetSuite SuiteFlow 101
TAG Presents: NetSuite SuiteFlow 101
 
Gain insights into your business operations with BPM Analytics
Gain insights into your business operations with BPM AnalyticsGain insights into your business operations with BPM Analytics
Gain insights into your business operations with BPM Analytics
 

More from Norikkon, LLC.

DocSet for SAP Projects
DocSet for SAP ProjectsDocSet for SAP Projects
DocSet for SAP Projects
Norikkon, LLC.
 
DocSet for SAP Human Resources
DocSet for SAP Human ResourcesDocSet for SAP Human Resources
DocSet for SAP Human Resources
Norikkon, LLC.
 
DocSet for SAP Plant Maintenance
DocSet for SAP Plant MaintenanceDocSet for SAP Plant Maintenance
DocSet for SAP Plant Maintenance
Norikkon, LLC.
 
DocSet for SAP Master Data
DocSet for SAP Master DataDocSet for SAP Master Data
DocSet for SAP Master Data
Norikkon, LLC.
 
DocSet for SAP Financial Accounting
DocSet for SAP Financial AccountingDocSet for SAP Financial Accounting
DocSet for SAP Financial Accounting
Norikkon, LLC.
 
DocSet for SAP Delivery Management
DocSet for SAP Delivery ManagementDocSet for SAP Delivery Management
DocSet for SAP Delivery Management
Norikkon, LLC.
 
DocSet for SAP Purchasing
DocSet for SAP PurchasingDocSet for SAP Purchasing
DocSet for SAP Purchasing
Norikkon, LLC.
 
DocSet for Microsoft SharePoint
DocSet for Microsoft SharePointDocSet for Microsoft SharePoint
DocSet for Microsoft SharePoint
Norikkon, LLC.
 

More from Norikkon, LLC. (9)

DocSet.ECM for Sales
DocSet.ECM for SalesDocSet.ECM for Sales
DocSet.ECM for Sales
 
DocSet for SAP Projects
DocSet for SAP ProjectsDocSet for SAP Projects
DocSet for SAP Projects
 
DocSet for SAP Human Resources
DocSet for SAP Human ResourcesDocSet for SAP Human Resources
DocSet for SAP Human Resources
 
DocSet for SAP Plant Maintenance
DocSet for SAP Plant MaintenanceDocSet for SAP Plant Maintenance
DocSet for SAP Plant Maintenance
 
DocSet for SAP Master Data
DocSet for SAP Master DataDocSet for SAP Master Data
DocSet for SAP Master Data
 
DocSet for SAP Financial Accounting
DocSet for SAP Financial AccountingDocSet for SAP Financial Accounting
DocSet for SAP Financial Accounting
 
DocSet for SAP Delivery Management
DocSet for SAP Delivery ManagementDocSet for SAP Delivery Management
DocSet for SAP Delivery Management
 
DocSet for SAP Purchasing
DocSet for SAP PurchasingDocSet for SAP Purchasing
DocSet for SAP Purchasing
 
DocSet for Microsoft SharePoint
DocSet for Microsoft SharePointDocSet for Microsoft SharePoint
DocSet for Microsoft SharePoint
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 

SAP workflow events

  • 1. SAP Workflow and Events - Control the flow! Day and Time: Thursday, May 16, 2013 - 12:30 PM - 1:30 PM Session 0811 Content Area: Business Integration, Technology and Infrastructure (BITI) Insert Speaker Names
  • 2. LEARNING POINTS  How to use an event to control the SAP Business Workflow  How to trigger an event  Standard SAP Methods  Know about the advantages of using events  Traceable  Deactivatable/activateable  Forward-looking – feeds into Process Observer/SAP Operation Process Intelligence
  • 3. Radio example for events SAP Programs (One Radio Station  one Object Type) Transmitter Events Antenna Receiver “On” Start Workflow Instance Terminate Workitem Trace events SWEL Trace Workitems SWI1 Event Linkage SWETYPV RFC check SM58 APAP Program Events of different Business Objects or ABAP Objects Transactions to configure events Event queue SWEQADM Instance linkage SWEINST Simulate event SWUO Manual (Re) Trigger SWUE Switch event trace on or off SWELS
  • 4. Overview: Events to Control Workflow  Trigger a new instance of a Workflow • Select the Workflow to be started • Check, if the workflow should be started at all • Start Workflow instance immediately • Use the event queue to start a Workflow instance  Terminate a dialog workitem • Set the workitem to complete, so that the workflow instance can continue  Wait for an event • Complete a section of a Workflow instance • Complete a whole Workflow instance  Start a ABAP function module • Consume the event without any impact on workflow
  • 5. Different ways to trigger an event  SAP Configuration of Events  HR Events  Status Management  Change Documents  Message Control  Trigger a BOR event via the ABAP function module SAP_WAPI_CREATE_EVENT (Commit Work)  Transaction SWETYPV
  • 6. Different ways to trigger an event  Triggered by program  SAP provided program triggers the event  Read SAP Help for Workflow Scenarios, to find the required IMG configuration steps  Use the event trace to find events  Custom developed program will trigger the event  Trigger a BOR event via the ABAP function module SAP_WAPI_CREATE_EVENT  Note: The event only occurs after the ABAP statement “COMMIT WORK.”
  • 7. Information delivered by events  Object Type  Object Key Value  Name of the events • The event name indicates the status change  User who triggered the event  This user will become the workflow initiator for a workflow start  Or the actual agent who completed a workitem  Additional parameters  For example: the required release code of a purchase requisition What data is delivered ? How is the data delivered ? • The Binding definition in the Workflow Builder stores the data in the • Workflow Container • Task Container
  • 8. Event of a Business Object Type
  • 9. SAP Configuration of Events  It’s all right here (Tools> Business Workflow> Development> Events)
  • 10. SAP Configuration of Events  For HR Events, look at transactions SWEHR1 and SWEHR2 – these are SAP-defined events  Then, if you need to, configure your own events using SWEHR3
  • 11. SAP Configuration of Events  SWEHR3 uses the same Object Type, Infotypes, etc as SWEHR2  You define the Rules for when your event is raised in custom functions – make sure you follow the templates!
  • 12. SAP Configuration of Events  Change Documents are useful to trigger events when you know a Change Document is written if Master Data changes  Quick Check - go to TX SE12 and check for the ‘Change Document’ flag on the data element If the Change Document box is not ticked, you may have to use a different method
  • 13. SAP Configuration of Events  If you can use Change Docs, there is a nice condition editor to help you complete your mission After you select the Field(s) which you need to trigger the event from, you have the ability to format complex conditions prior to raising the event
  • 14. SAP Configuration of Events  Many objects in SAP already use Status Management – Quality Inspection, Projects, Engineering Change Requests…
  • 15. SAP Configuration of Events For customer statuses, you define the status (or use a system (ie: I) status, and it can be in conjunction with others.
  • 16. Event Linkage Check Function Modules - define specific criteria that must be met in order to raise the event. Receiver Type Function Modules will dynamically determine which workflow you need to start
  • 17. Have the Event send you mail UserID as Receiver You get mail in your SAPOffice inbox, and can see the Event Parameters too
  • 18. MESSAGE CONTROL  Output documents are created using SAP’s output determination procedure  Access output management for applications via SAP Reference IMG (TAC SPRO)  Generally, output is created based on condition table for communication purposes between business partners, e.g. print, fax, EDI, or between systems, e.g. ALE  Instead of creating an output document, SAP raises an event in the system
  • 19. MESSAGE CONTROL Create output type with transmission medium ‘9’ Maintain condition record and use communication to define event
  • 20. BUSINESS TRANSACTION EVENTS  “Publish & Subscribe” interface available for FI-GL, FI- AP, and FI-AR  Business transaction event linked to business object event, i.e. 00000130 Post Document -> BKPF.CREATED  Template function modules for event processing with parameter interface available for supported relationships  Transaction to access business transaction events is SWU_EWBTE for BTE wizard; you can use special TAC for custom development, e.g. FIBF
  • 22. BUSINESS TRANSACTION EVENTS  SAP application creates business transaction event  Function module processes data to be passed on to business object event  Business object event is raised  Event manager determines available active link(s) and starts corresponding workflows
  • 23. Event of a ABAP Object Type The Event Parameter can be an object of another type
  • 25. Event Queue Transaction SWEQADM is used to schedule the event queue in every system. By spreading out the events, this job provides a better system performance. Based on the size of your system, you can double or triple the number of events per minute.
  • 26. Workflow with triggering event Hint: • The standard binding is for “_EVT_OBJECT” and “_EVT_CREATOR” • The release-code is an extra parameter • The “Aggregate” is an attribute of the object Trigger
  • 27. Workitem with Terminating Event Hint: One outcome for each (activated) terminating event Note: Binding to bring data back to the task container. Another binding defines the transport from the task to the workflow container.
  • 28. Workflow with Wait for Event Workflow for a preliminary posted FI document or invoice A user outside of this workflow has deleted this invoice - End WorkflowA user has changed the invoice - Restart approval An approver has rejected the invoice - Inform the initiator
  • 29. WORKFLOW START CONDITIONS  Workflow start conditions allow to implement the evaluation of predefined criteria before a workflow instance is started  Conditions are defined by event container elements and logical operators and evaluated every time a start mechanism tries to trigger the corresponding workflow  If the condition is not fulfilled, the workflow instance is not started  Transaction to access workflow start conditions is SWB_COND
  • 30. WORKFLOW START CONDITIONS Select existing start conditions based on standard criteria Review and change details of start condition
  • 31. Workflow with and without events Workflow with events Workflow without events No delay for the triggering program. Advantage: No impact on triggering program Triggering program waits for the workflow instance to start. Problems could have an impact on the outside transaction Dialog Workitem is completed, when one of the terminating events has occurred. Advantage: Less risk of completing a workitem too early. Dialog Workitem is completed, when the user backs out the launched transaction or (if configured) clicks on the ‘Complete Workitem’ button. Use the “Wait for event” step to react on object status changes, which occurred outside of the workflow process Users can only influence the process, by executing a workitem. Trigger events to communicate with other workflows
  • 32. BEST PRACTICES  Connect your SAP Business Workflow to SAP via events  Trigger of a new workflow instance  Example: A certain Sales Order status was applied  Re-act on object status changes, which were caused by activities outside of your workflow  Example: Purchase requisition was changed  Use events to complete a workitem  Example: Specific System or User Status was set on a plant maintenance order  Use the event queue for events, which could occur too often within a short period of time
  • 33. KEY LEARNINGS  Use events where ever possible in your workflow design  Trigger Workflow  Terminate a workitem  Wait for an outside event  Activate the Workflow Event Trigger (customizing transport)  Check the events in the test system  Turn off the event trace in the production system
  • 34.
  • 35. THANK YOU FOR PARTICIPATING Please provide feedback on this session by completing a short survey via the event mobile application. SESSION CODE: #### For ongoing education on this area of focus, visit www.ASUG.com

Editor's Notes

  1. Since HR data is very date-driven, you may need to take special measures to ensure that you have the most-current data, or that you do not trigger an event retroactively. The sensitivity of HR data may mean that actions are taken after the fact. It may also mean that you need to be able to de-activate the event (and the workflow) in your Production system.Example: Simple Event being raised: DATA: beforeimage LIKE p0001. DATA: afterimage LIKE p0001. DATA: l_objtype LIKE swr_struct-object_typ,l_objkey LIKE swr_struct-object_key,l_event LIKE swr_struct-event. DATA: BEGIN OF plog_tab_key,mandt TYPE mandt,plvar TYPE plvar,otype TYPE swr_struct-object_typ,objkey TYPE swr_struct-object_key, END OF plog_tab_key. DATA: it_cont TYPE TABLE OF swr_cont.l_objtype = 'PDOTYPE_S'. CONCATENATE plog_tab_record-plvarplog_tab_record-objid INTO l_objkey. CALL FUNCTION 'SAP_WAPI_CREATE_EVENT' EXPORTINGobject_type = l_objtypeobject_key = l_objkey event = 'TRANSFERRED'commit_work = 'X'* EVENT_LANGUAGE = SY-LANGU* IMPORTING* RETURN_CODE =* EVENT_ID =* TABLES* INPUT_CONTAINER =* MESSAGE_LINES =* MESSAGE_STRUCT = .Example: More complex work – check the dates and the BeforeImage data before raising the event!DATA: BEFOREIMAGE LIKE P0001.DATA: AFTERIMAGE LIKE P0001.DATA: ACTION LIKE PA0000-MASSN. BEFOREIMAGE = BEFORE_IMAGE. AFTERIMAGE = AFTER_IMAGE. CASE OPERATION. WHEN 'DEL'. WHEN 'INS'.* Before image initial IF BEFOREIMAGE-PERNR IS INITIAL. ELSE.* Before image not initial IF BEFOREIMAGE-BEGDA NE AFTERIMAGE-BEGDA. PERFORM CHECK_DATE USING CUTDATE. IF AFTERIMAGE-BEGDA GE CUTDATE. SELECT SINGLE MASSN INTO ACTION FROM PA0000 CLIENT SPECIFIED WHERE MANDT = SY-MANDT AND PERNR = AFTERIMAGE-PERNR AND SUBTY = AFTERIMAGE-SUBTY AND OBJPS = AFTERIMAGE-OBJPS AND SPRPS = AFTERIMAGE-SPRPS* AND ENDDA = AFTERIMAGE-ENDDA AND BEGDA = AFTERIMAGE-BEGDA AND SEQNR = AFTERIMAGE-SEQNR. if sy-subrc EQ 0. IF ACTION = 'H4' OR "Reinstate ACTION = 'H5' OR "Rehire ACTION = 'J0' OR "Rehire retiree ACTION = 'J1' OR "Reinstate retiree ACTION = 'J3' OR "Rehire EE (former ext no gap) ACTION = 'J4' OR "Rehire retiree (no gap) ACTION = 'P5'. "Reengage (former) retiree EVENT = 'ZREHIRED'.* Move from PA0302 for timing reasons - the P3 action* started the Workflow before the Organization Assignment* was changed resulting in the wrong fields being selected. ELSEIF ACTION = 'P3' OR "External Re-engagement ACTION = 'J6'. "Reengage external (no gap) EVENT = 'ZEXTERNALREENGAGED'. ENDIF.endif. ENDIF. ENDIF. ENDIF. WHEN OTHERS. "UPDATE ENDCASE.ENDFUNCTION.
  2. The Change Document settings on data elements can be changed – so that you CAN tick that box.But you may have to cozy up to your Basis people to do it.Change Documents are identified in the transactions and tables as Change Doc Objects – which may not be familiar at first.With a little sussing out, you will be able to determine that CDObject EINKBELEG is the Business Object Purchase Order (BUS2012).Things to consider will include how often this field changes and the load in the Change Doc tables – which could be prohibitive.
  3. The condition editor will allow you to use multiple fields to check, combinations of new values, old values, arithmetic and string functions.
  4. Status Management may require the configuration of statuses on the business objects – if you begin using TX BSVW – and choose ‘System Settings’ and do not see any ‘status objects’ that look familiar, you probably need to use ‘Customer Settings’.But for System Statuses, you can drill into the Status Restrictions and see what relevant status changes will be impacted.So here, if an ECM is withdrawn, the Checked and Approved statuses will be made inactive.Notice also that these statuses begin with ‘I’ = a clue that they are System Statuses not user statuses.
  5. As with the system settings you can configure the statuses to be made active or inactive.
  6. Start Conditions – SWB_COND, Receiver Type function modules must follow the template SWE_TEMPLATE_RECTYPE_FBCheck Functions must use SWE_TEMPLATE_CHECK_FB