SAP S4HANA in 40 Min PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

How to Build an SAP Workflow on

SAP S/4HANA in 40 Minutes


Martin Maguth, MaxECM Solutions and
Sue Keohan, Lincoln Labs
Session ID: ASUG82847

May 7 – 9, 2019
About the Speakers
Speaker Name Speaker Name
• Martin Maguth • Susan Keohan
• Managing Partner at • Senior Workflow Developer at
MaxECM Solutions LLC and Lincoln Labs and long-time
long-time ASUG Volunteer ASUG Mentor
• Fun fact: Workflow Hacker • Fun fact: Workflow Authority
Key Outcomes/Objectives
1. Key components of SAP Workflow engine on
SAP S/4HANA
2. How to build a real workflow process
3. Key tools for SAP Workflow administration
Agenda
1. Introduction
2. Workflow architecture
3. Container concept
4. Event concept
5. Workflow administration
Introduction – OnPremise Vs. Cloud Platform
Introduction – Fiori integration

• Work items can be accessed via SAPGUI and FIORI out of the box
• Note: Workflows created on-premise with SAPGUI development are
available for configuration in ‘Manage workflows’ app in FIORI, but
not vice versa
Agenda
1. Introduction
2. Workflow architecture
• Object types
• Single step tasks
• Workflow templates
• Responsibilities
3. Container concept
4. Event concept
5. Workflow administration
Object types
• Represent a “real-world” object that exists in the business
environment
• Stored in SAP Object Repository (Transaction SWO1)
• Object type components are
– Interfaces (where does the object apply)
– Key (how is it identified)
– Attributes (how is it described)
– Methods (what can be done with it)
– Events (what can happen to it)
Object types • Example:
Object BUS2081
(Incoming invoice)
• Key consists of document
number, and fiscal year
• Many standard methods
and events to process
invoice in workflow
Single step task
• Represents a specific step in a workflow process
• Access with transaction PFTC
• Key components of single step tasks are
– Object type (what is worked on)
– Method (what is done with the object)
– Possible users (who may execute the task in general)
– Work item text (task headline that appears in inbox)
– Descriptions (texts for inbox and deadline notifications)
– Triggering/terminating event (when is task started/complete)
Single step task

• Example: TS20000704 (Display invoice)


• Work item text (?)
• Object method reference: Use BOR object
or ABAP Class
• Define task container
• Assign events and default rules
• Determine execution type
Workflow template
• Represents a chain of single step tasks and events
• Access with transaction SWDD (Workflow
Builder)/SWDD_SCENARIO (New Workflow Builder)
• Multi step task components are
– Control
• Single step task
• Dialog vs. background
– Responsibility
• Selected agents at runtime
– Deadlines
• Earliest/latest requested start/end
• Notifications
Workflow template

• Example: WS1000062
(Leave of absence with
HTML)
• Shown in Workflow
Builder
Responsibilities
• Represent the possible and the selected user(s) for the
execution of a task
• Can be assigned statically or dynamically
• Generally defined based on the HR organizational structure
• Users can be excluded
Responsibilities

• General task assignment for single


step as possible users

• Rule 1000003 assigned for agent


determination at runtime in
workflow template definition
• Many other options possible …
Rules
Rules allow for the dynamic agent
determination to a task in a
workflow at runtime.

Rules are created and maintained


This Photo by Unknown Author is licensed under CC BY-SA

with transaction PFAC.


Rules

• Rule definition categories:


• Responsibility
Allows the use of elements in the rule
container to determine agents at
runtime without programming
• Organizational data
Assign an object from HR organizational
model as selected user, such as
organizational unit, position, or job
• Function module
Create and assign a function module that
will execute at runtime to determine
selected users
Workflow architecture
Multi step task

Agent Single step Agent Single step Agent


task task
Single step tasks Agent Agent
Single step Single step Single step
task task task

Business object
Business object Business object Business object Business object
repository
Workflow architecture - Demo
Step 1: Explore BUS2081 object
Step 2: Create single step task
Step 3: Create workflow template
Agenda
1. Introduction
2. Workflow architecture
3. Container concept
• Definition
• Container types
• Architecture
4. Event concept
5. Workflow administration
Container definition
Containers store information and allow the exchange of that
information among the different components
of a workflow process.

The information is stored as a data element


and processed at runtime through bindings.
This Photo by Unknown Author is licensed under CC BY-SA

Bindings administer the flow from one container to another.


Bindings are defined at time of implementation and are used at
runtime.
Container types
Method
Contains all variables
parameter
for method execution
Contains all variables container
of the workflow definition

Task Contains all variables of


Workflow
the task display and
container container completion

Role Contains all variables of


parameter the role determination
container

Contains all variables of


Event
the event trigger and
container receiver
Workflow architecture
Workflow
Multi step task
container

Single step Single step


task task Task
Single step tasks
Single step Single step container
task task

Method
Business object parameter
Business object Business object Business object
repository
container
Agenda
1. Introduction
2. Workflow architecture
3. Container concept
4. Event concept
• Definition
• Event types
• Event creation
5. Workflow administration
Events
An event is an occurrence on an object in
the system.

Events are published and managed by the


event manager who creates the link
This Photo by Unknown Author is licensed under CC BY-NC

between creator and receiver and


transfers the information between the
two.
Event types
Triggering event Terminating event
• Triggers a single step or a • Terminates a single step task
multi step task • Has to be defined in task
• Has to be defined in task
• Has to be activated in the
event link table
Event creation
• Events are published by the “Event Creator” and transferred to the
“Event receiver” by the “Event manager”
• Events can be created in multiple ways
• Program code with function module (SWE_EVENT_CREATE)
• Link to change management
• Link to status management
• Link to message system
• Link to HR tables (administration of info-types)
• Event has to be defined for a business object in the SAP object
repository
Container & Events - Demo
Step 1: Create workflow container element BUS2081
Step 2: Integrate with task container
Step 3: Integrate with work item description and mail
Step 4: Link event BUS2081.CREATED to workflow template
Step 5: Test workflow
Agenda
1. Introduction
2. Workflow architecture
3. Container concept
4. Event concept
5. Workflow administration
Workflow administration
• Access workflow administration by using transaction SWLD, then go to
Administration->Workflow runtime

• Important administrative transactions


– SWI2_ADM1: Work items without agents
– SWI2_DIAG: Diagnosis of workflow errors
– SWPR: Restart workflow after error
– SWU3: Basic workflow customizing
– SWEQADM: Manage event queue
– RSWWERRE: Execute workflow error monitoring
– SWW_SARA: Archive work items
Take the Session Survey.

We want to hear from


you! Be sure to complete
the session evaluation on
the SAPPHIRE NOW and
ASUG Annual Conference
mobile app.
Presentation Materials
Access the slides from 2019 ASUG Annual Conference here:
http://info.asug.com/2019-ac-slides
Q&A
For questions after this session, contact us at
[email protected] and [email protected]
Let’s Be Social.
Stay connected. Share your SAP experiences anytime, anywhere.
Join the ASUG conversation on social media: @ASUG365 #ASUG

You might also like