SAP Flexible Workflow Custom Scenario development with My Inbox Integration (2022)

Flexible Workflow is a new concept introduced in SAP S/4HANA with the objective to simplify workflow configuration. It is recommended that we use the new Flexible Workflow functionality in S/4HANA.

The flexible workflow is based on a set of predefined workflow scenarios and tasks. This provides the functionality to define condition-based workflow for different processes in the system.

It is possible to define single or multi step approval processes, and the relevant workflow items are made available in the My Inbox Fiori App for the approvers. Manage Workflows Fiori App is available to configure flexible workflow scenario, and these apps allow the Business process specialist to set up workflows based on the business requirement.

SAP pre-delivered many such flexible scenario in procurement, finance etc. and SAP help is available to set up/activate those templates. However, I found some difficulty to create custom template by using this new technology and integrate them in my inbox. To address that, I have prepared this blog post to fulfil one simple multi step scenario which we come across in every implementation.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (1)

Multi Step Approval Flow

  • Flexible workflow scenario Development
  • Responsibility rule to get L1 approver
  • Workflow Class to manage workflow
  • My inbox task configuration
  • Manage Workflow setup for custom workflow
  • Email Templates

Tcode : SWDD_SCENARIO

New tcode being used to create flexible scenarios in S4 system. Flexible block is the main component which will play important role in scenario. We have to first decide all possible decision tasks and activities (background method executions) as per business requirement. As per our sample workflow, we have 3 decision tasks and 1 activity.

Create new flexible workflow scenario with class based.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (2)

New Scenario details

Create one container element employee of class type to hold all employee object details.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (3)

Workflow Element

Go to Header and update start event details. I have created one START event in custom class which will be used to trigger this WF.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (4)

Create all required activities as per business requirement. As per our sample requirements, we have user decision steps like Level1 Approval, Level 2 Approval, To Requestor and activity like Post Employee data by final approver.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (5)

Activites

Create all required Agent rules as per business conditions. For the sake of POC, I have used one responsibility rule with one agent maintained manually to get L1 Approver. But in real time scnario, these agents will be determined in FM based on some roles or any other conditions. That FM being used in PFAC rule.

(Video) My Inbox Fiori App | Workflow items in Fiori | BADI Implementation My Inbox | Fiori Approval

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (6)

PFAC Rule

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (7)

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (8)

The moment we create activities in Flexible block, it will ask us to provide all task details for that activity. We need to provide required task details whether user decision or activity. I’m not going too much here as this is normal workflow functionality.The moment we create activity, then flow will be created for this activity.Since we have 4 activities in sample workflow, so we can see 4 flows visible in this workflow.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (9)

Flexible workflow triggering is just same as classic workflow mechanism. We can trigger this either by using BO or Class events. I have created one simple method in class to trigger this wf with some event parameters. I’m passing employee details to workflow through start event for the sake of POC.

Redefine standard WF interface methods at least with empty implementation and activate class.

I have declared one public key attribute in this class and instantiated this value in constructor of the class.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (10)

START Event to trigger workflow

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (11)

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (12)

Event Parameters

STARTWF method code to trigger this workflow: Below is the sample code to trigger workflow. In real time situations, you can use your own event parameters and populatate those. Based on your requirement, we will call this event in some exits, BADIs, Odata function imports or create/update methods or custom programs etc.

DATAlv_objkeyTYPEsibfinstid.
DATAls_empdetailsTYPEzhcm_st_telecommuting.
DATAlv_param_nameTYPEswfdname.
DATAlr_event_parametersTYPEREFTOif_swf_ifs_parameter_container.

DATAg_evt_param_containerTYPEREFTOif_swf_cnt_container.
DATAl_event_refTYPEREFTOif_swf_evt_event.
DATAvl_returncodeTYPEsysubrc.
DATAl_objtypeTYPEsibftypeidVALUE‘ZCL_WF_EMPLOYEE_FLEX’.DATAl_eventTYPEswo_eventVALUE‘START’.
DATAl_event_containerTYPEREFTOif_swf_ifs_parameter_container.

lv_objkey=iv_employee.

CALLMETHODcl_swf_evt_event=>get_event_container
EXPORTING
im_objcateg=cl_swf_evt_event=>mc_objcateg_cl
im_objtype=l_objtype
im_event=l_event
RECEIVING
re_reference=lr_event_parameters.
*
ls_empdetails-ei_employeeno=iv_employee.
ls_empdetails-ei_lastname=‘Veshala’.
ls_empdetails-ei_firstname=‘Naveen’.
ls_empdetails-ei_postitle=‘Consultant’.
ls_empdetails-hr_telestartdate=sy-datum.
lv_param_name=‘EMPDETAILS’.
*
CALLMETHODlr_event_parameters->set
EXPORTING
name=lv_param_name“#ECNOTEXT
value=ls_empdetails.
**
TRY.
CALLMETHODcl_swf_evt_event=>raise
EXPORTING
im_objcateg=cl_swf_evt_event=>mc_objcateg_cl
im_objtype=l_objtype
im_event=l_event
im_objkey=lv_objkey
im_event_container=lr_event_parameters.

CATCHcx_swf_evt_invalid_objtype.
CATCHcx_swf_evt_invalid_event.
ENDTRY.

(Video) A Central Inbox for all SAP Workflows, SAP TechEd Lecture

COMMITWORK.

Open Manage Workflow app in Fiori launch pad and configure new workflow based on our custom template. As per our flow, we have 3 steps in workflow, L1 approval, L2 approval and finally posting data into SAP. When L1 or L2 clicks on Return button , then workitem routed back to Requestor and then restart workflow when Requestor clicks on Resubmit button.Let us configure workflow to fulfil this business scenario.

Open our custom scenario in Manage Workflow fiori app and click on + add button to create new workflow

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (13)

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (14)

Valid from and Valid to need to updated if we want to configure workflow for certain period of time else, leave it blank.

Configure steps. Click on Add in step sequence section and create new step.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (15)

Step1 – Level1 Approval

Choose Level1Approver Agent role in receipents. Pls note that these roles are coming from Agent Rules in Flexi block. So based on our business requirement, we have to create different rules to determine agents and use those rules in workflow step configuration.

Add Exception Handling actions as per our flow.

If approver Rejects – then workfow would get cancelled.

Returns – Then workflow routed back to Requestor.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (16)

Note : I have used our other decision step To Requstor as required action for Return action and selected Restart workflow as action result. Due to this, When requstor clicks on Resubmit button, it will again routed back to L1 Approval for review and approval.

Similarly, add other 2 steps as well.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (17)

Save and Activate workflow.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (18)

Generally, we will activate task filter in real time scenario to display ONLY required workflow tasks work items in My Inbox App. So, unless we add these in Task settings, new decision tasks won’t be displayed in My Inbox app.

(Video) SAP Fiori Travel Request Workflow | SAP Fiori My Inbox Integration | contact@anubhavtrainings.com

SPRO->SAP Netweaver -> SAP Gateway Service Enablement -> Content -> Workflow Settings -> Maintain Task Names and Decision Options

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (19)

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (20)

Sample Decision Keys for Return to Tequestor task, These desions will be displayed as buttons in My Inbox App.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (21)

Note: These are minimum steps needed to create one custom scenario and expose it to My inbox app. Let us start testing now.

Login with requestor role and execute test method STARTWF in our workflow class.

Login fiori launchpad with Level 1 Approver and check the work item in My Inbox app.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (22)

Click on Return button . As per our flow, it will be routed back to requestor.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (23)

Click on Resubmit, Workflow will restart again and work item goes to L1 Approver for approval.

Resubmitted by requestor and approved by L1. Workitem is awaiting final approval now.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (24)

Final L2 approver approved. As per flow, it called background activity and posted data and log updated and workflow got completed.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (25)

From S4 1909 onwards, SAP has provided to enable dead line feature for decision taks steps in Manage workflow configuration.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (26)

As shown below , overdue item was triggered after 10 min and reflected that in SBWP and My Inbox app of L2 approver.

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (27)

(Video) SAP Workflow- How to Analyse a Flexible Workflow from the Workflow Builder?

SAP provided Email template options to generate emails through flexible workflow scenario. Email template name plays main role while sending mail. We have to follow same naming convention as per our scenario to send email.

Copy Pre-delivered email template SWF_CRT_NOTIFY_RECIPIENTS and make changes as per your business requirement in custom template. When copying, you can name custom template as per your scenario correctly.

Naming Standards:

To send email before particular task id : YY1_(Scenario_ID)_CRT_(StepID)

For Ex : YY1-ZZ1_YY1_90000005_CRT_87 to send mail for L2 Approver

To send mail to requestor after completion of workflow with Approved or Rejection

Approve – YY1_(Scenario_ID)_COMPLETE_POSITIVE

Rejected – YY1_(Scenario_ID)_COMPLETE_NEGETIVE

Create one email template for L2 Approver as shown in below screenshot

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (28)

L2 Email Template

SAP Flexible Workflow Custom Scenario development with My Inbox Integration (29)

With this i conclude this blog post. My intenstion is to keep all required steps in this blog post, so it is useful to others as well.

I have referred other blog posts and taken flexible workflow introduction from below blog post.

References : https://blogs.sap.com/2020/08/25/flexible-workflow-for-sourcing-and-procurement-in-sap-s-4hana/ – Introductory text

www.help.sap.com – Overall documentation

Email Templates : How to set up email template in flexible workflow..

https://microlearning.opensap.com/media/How%20to%20Set%20Up%20the%20E-mail%20Notification%20for%20Flexible%20Workflow%20-%20SAP%20S_4HANA%20Cloud/1_3yuvoayt

Few Updates:

  1. When configuring ATO ( S_ATO_SETUP ) for in app enhancements, use prefix YY1_ , then we can able to create all email templates like for final approal (YY1_(Scenario_ID)_COMPLETE_POSITIVE) or rejection (YY1_(Scenario_ID)_COMPLETE_NEGETIVE) as per SAP naming standards, Otherwise,it will not take that much name like ZZ1_YY1_*.
  2. If you want to enable dead line monitoring email notification in custom scenarios , then create that template in backend ( SWDD_SCENARIO) and then we will get email options in Manage workflow app.
  3. In above example, i have used seperate background task to update the data in to SAP . How ever, we can still wrtie this code in flexible workflow run time adopter class which is inherited from standard class -CL_SWF_FLEX_IFS_RUN_APPL_BASE. You can check this class in SWDD_SCENARIO – control tab of scnario definition.

FAQs

How do I set up email alerts for flexible workflow? ›

Example: How to Set up the Email Notification for the Flexible...
  1. Enter the user data of Nora Sawyer. ...
  2. Add the business role that Nora Sawyer needs as an approver. ...
  3. Define Nora as Person Responsible in the master data of the cost center. ...
  4. Maintain the email template for approvers. ...
  5. Define a new workflow.

Which features are offered by SAP flexible workflow? ›

  • Enterprise Resource Planning.
  • Financial Management.
  • CRM and Customer Experience.
  • Human Capital Management.
  • Supply Chain Management.
  • Spend Management.
  • Business Technology Platform.
  • Small and Midsize Enterprises.
26 Dec 2019

Which application is used to design flexible workflows in SAP Fiori launchpad? ›

Manage Workflows Fiori App is available to configure flexible workflow scenario, and these apps allow the Business process specialist to set up workflows based on the business requirement.

How do you trigger a flexible workflow in SAP? ›

Now Let's start with the step-by-step Journey!
  1. Open the Manage Workflow for Purchase Orders. ...
  2. Go to the following the path in SPRO: SAPNETWEAVER–> Application Server –> Business Management –> SAP Business Workflow –> Flexible Workflow –> Scenario Activation.
  3. Maintain new entry for WS00800238 and set it as active.
1 Nov 2020

How do I send an email from workflow in SAP? ›

Click on the Workflow Builder Button as shown above. Now activate the workflow and execute it. You will get the mail.

How do you send a workflow notification email in SAP? ›

In the field User, enter WF-BATCH or the relevant service user for your workflow system. Choose ABAP Program. In the field Name, enter program SWN_SELSEN. Enter the language in which the e-mail message must be sent.

What is SAP flexible workflow? ›

The flexible workflow is a general function that allows you to define condition-based workflows for approval processes. The flexible workflow for purchase requisitions allows you to define one-step or multi-step approval processes for purchase requisitions according to your requirements.

How do you transport a workflow in SAP? ›

To configure the transport workflow:
  1. Log on to the SAP System that functions as the transport domain controller.
  2. Call Transaction STMS and then choose. ...
  3. to display the transport domain.
  4. Choose the tab Workflow Engine.
  5. Switch to change mode by choosing.

How do I create a workflow in SAP? ›

To start the Workflow configuration, navigate to Tools → Business Workflow → Development → Definition Tools → Workflow Configuration. This opens the window with the name - Process Workflow Configuration. You have to double-click on a step in the workflow definition to display the step definition to enter the values.

What is flexible workflow in s4hana? ›

Flexible Workflow is part of SAP Business Workflow and will allow you to set up and manage simple workflow scenarios in different lines of business, such as SAP S/4HANA Finance, Procurement, Human Resources, Manufacturing, and now SAP S/4HANA Sales and SAP S/4HANA Billing.

What is SAP Fiori used for? ›

SAP Fiori is a design system that enables you to create business apps with a consumer-grade user experience, turning casual users into SAP experts with simple screens that run on any device.

What is different when you access the S 4HANA server via Fiori versus SAP GUI? ›

Role-based – Classic SAP GUI was transaction-oriented whereas Fiori comes with simplified role based navigation and business function access; based on the user needs and how the user works with their environment. It is user-centric and goal-oriented.

What are the different types of WF agents? ›

1. What are the different types of WF Agents?
  • Possible Agents: a) Users who are authorized to execute the task. ...
  • Responsible Agents: ...
  • Actual Agents: Actual user who executed the dialogue task.
  • Excluded Agents: Users who are not supposed to execute the dialogue task (even if they are in possible agents)

How do we setup extended notifications in workflow? ›

Double Click on Subscription Settings if you need to open the inbox from the attachment and give ATTACH1 in SHOW_INBOX_AS If you do no want any attachment to open work item, leave the values as blank. Double click on Filter Basic Data and create New Entries (Z_SCRAP_DELTA) for Workflow Scenario as shown below.

How do I activate flexible workflow po? ›

The flexible workflow for purchase orders can be activated or deactivated by a configuration expert in the implementation cockpit. You can find out which other apps can or must be used to configure the flexible workflow for purchase orders in the document How to Configure the Flexible Workflow for Purchase Orders.

How do I send an email to SAP inbox? ›

The following steps are necessary the Creation.
  1. Log to Transaction Code SE37.
  2. Create a Function Module.
  3. Declare the input variables for external email id and SAP user id.
  4. Write the coding as shown below.
  5. Save and Active it.
  6. Execute the Function Module.
  7. Enter the Input i.e. External email id and SAP User id.

How do I send an email in workflow? ›

Create a new workflow. Select Actions, and then select Send an Email. In the Action, select these users. In the Select Users dialog, in the Or select from existing Users and Groups list, select Workflow Lookup for a User, and then select Add.

How do I send an email to multiple recipients in SAP workflow? ›

Create an element in the workflow container which is of type 'multiline'. Create a new task to get the agents as per your requirement from the Ztable and populate this element. Then use the same element in the Sendmail Step to send the mail to many recipients.

How do you send notifications in SAP? ›

Assign the 'Notification User' role to the SAP user ID to be able to send the push notification to the device.
  1. Login to SAP Cloud Platform Cockpit.
  2. Find the Provider and tenant account you want to use. ...
  3. From the subscribed Java Applications of that tenant, find and select CPms Java application.
22 Mar 2017

How do I send an e mail notification during the governance process? ›

Alternatively, navigate to the corresponding step in the navigation area, open the context menu and select Change. chose Send Mail and continue. 4 In section Recipients for Recipient Type chose E-Mail Address (U). 5 Enter the email address of the recipient.

How do you check email triggers in SAP? ›

Goto SM20 ->Extras->Enter SOST in transaction field, Change the time restrictions and execute Reread Audit Log.

What are the standard workflow in SAP? ›

Linking Process, Business Logic & People

In SAP Workflow, business processes are defined in the Workflow Builder. Each step is defined in the Workflow builder and is called an activity.

What is SAP workflow? ›

SAP Workflow Management allows you to digitize workflows, manage decisions, gain end-to-end process visibility, and configure processes in a low-code approach. It allows users to build, run, and manage workflows. It allows users to digitize and automate decision making.

How do you set up a flexible workflow for a purchase requisition? ›

On the screen Manage Workflows, choose Add to create Flexible Workflow. In the PRECONDITIONS area, select Company Code of purchase requisition is 1010. Choose Add another condition, then select Creation indicator of Purchase Requisition is S. In STEP SEQUENCE area, choose Add.

How do I transport a workflow template in SAP? ›

Transportation of workflows operates is as folows: - Create or make a change to a workflow in your development system and transport it to Test/QA. - If the workflow already exists in Test and it has running instances then a new version of the workflow is created automatically in Test.

How do you assign a transport agent in SAP workflow? ›

Enter task number which you want to transport agent details, check transport objects check box and click on execute button.

How do you approve a transport request in SAP? ›

To approve or reject a transport proposal:
  1. Call the TMS (transaction STMS).
  2. To display the TMS worklist, choose . ...
  3. If there is available documentation, choose to display it.
  4. Check if the requests, the list of target systems, and the import times and import options for the transport proposal are correct.

How do I create a custom task in SAP workflow? ›

Steps:
  1. Step1: Define Organization Plan or Orgn. ...
  2. Step3: Define 1st task (Create notification of absence)
  3. Step 4: Add activity > first task in workflow.
  4. Step 5: 1st Test in SAP Inbox (T-code SBWP)
  5. Step 6: Define 2nd Customer task (Check notification of absence)
  6. Step 7: Add activity > second task in worflow.
  7. Step 8: 2nd Test.
26 Nov 2012

What is the Tcode for SAP workflow? ›

SAP Workflow Transaction Codes
#TCODEDescription
1SWU3Automatic workflow Customizing
2SWDDworkflow Builder
3SWI1Selection report for workflows
4SWUSTest workflow
38 more rows

How do you create an event in SAP workflow? ›

An event can be created from any program by calling the function module SWE_EVENT_CREATE or SAP_WAPI_CREATE_EVENT. Knowledge and experience of ABAP Workbench are required.

How do we setup extended notifications in workflow? ›

Double Click on Subscription Settings if you need to open the inbox from the attachment and give ATTACH1 in SHOW_INBOX_AS If you do no want any attachment to open work item, leave the values as blank. Double click on Filter Basic Data and create New Entries (Z_SCRAP_DELTA) for Workflow Scenario as shown below.

How do I send an e mail notification during the governance process? ›

Alternatively, navigate to the corresponding step in the navigation area, open the context menu and select Change. chose Send Mail and continue. 4 In section Recipients for Recipient Type chose E-Mail Address (U). 5 Enter the email address of the recipient.

How do I create a workflow email in Dynamics 365? ›

Configuring Dynamics 365 Workflow Send Email By User

Go to the Options page via Settings > User Options and open the Email Provider Selection section under the Account tab. The parameters that you need to set values for are: Email provider ID. Sender email.

What are the 3 layers in SAP workflow architecture? ›

There are 3 layers in the Workflow Architecture: Business Object. Business Process. Organization Model.

What is the difference between workflow task and workflow template? ›

A workflow can contain many tasks. It can contain simple to complex logic, with multiple steps for users to act upon. A workflow template is indeed the design-time version of your 'workflow' and it is type 'WS'. A workflow instance is created when your purchase req needs release, or when your invoice needs approval.

How many different types of event delivery are possible in system? ›

The delivery generates five different events. The application system sends these to the corresponding event handler in SAP EM. The application system determines the event handler using the tracking ID specified in the extractor.

What are the main sections when you are configuring email notifications? ›

To configure email notification for your system
  • Click the Administration tab.
  • In the System Management section, click Email Settings > Notifications (System). ...
  • In the Notifications section: ...
  • In the File Attachments field, enter the maximum size permitted for outgoing attachments. ...
  • In the Email Address Filters section:
5 Mar 2018

How do I set email alerts? ›

Turn notifications on or off
  1. On your Android phone or tablet, open the Gmail app .
  2. In the top left, tap Menu .
  3. Tap Settings.
  4. Select your account.
  5. Tap Notifications and select a notification level.
  6. Tap Inbox notifications. ...
  7. Choose your notification settings, including sounds.

How do I set up notification in ServiceNow? ›

Login into your ServiceNow tenant & in the search bar type “notifications”. Now click on the “Notifications” option under the System Notification. Then click on the “New” button, to create the new notification.

How do I use an email template in workflow dynamics 365? ›

Specify the default email template for organization-wide workflows
  1. Click System administration > Setup > Workflow > Workflow parameters.
  2. Select an email template from the list. ...
  3. Click Close to save your changes.
29 Nov 2021

How do I setup a mailbox in dynamics 365? ›

Setting-up Mailboxes
  1. Go to Settings > Email Configuration > Mailboxes.
  2. Double-click on the mailbox you would like to configure.
  3. Modify the following values: ...
  4. Click on Save.
  5. Click on Approve Email (note that this will only work if you are an Office 365 Global Admin)
  6. Click on Test and Enable Mailbox.

How do I track emails in Dynamics 365? ›

Track an email message

In Dynamics 365 for Outlook, select the email message you want to track. Do one of the following: To track the email message without linking it to a particular record in Customer Engagement, on the Home tab, in the Customer Engagement group, click Track.

Videos

1. Flexible Workflow in SAP S4 HANA 1909
(TagSkills)
2. sitSYD SAP Tech Night Sydney: Classic Workflow and Flexible Workflow in S4HANA Customer Journey
(Adi Mogilevsky)
3. Exploring an Integrated DevOps Workflow in SAP
(Basis Technologies)
4. SAP Workflow Management - Integration and Visibility | SAP Community Call
(SAP Community)
5. Extension Suite - Digital Process Automation with SAP Workflow Management
(SAP Technology)
6. Floe Webinar: Transform SAP Workflow emails
(Arch)

Top Articles

You might also like

Latest Posts

Article information

Author: Kelle Weber

Last Updated: 12/02/2022

Views: 5331

Rating: 4.2 / 5 (53 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Kelle Weber

Birthday: 2000-08-05

Address: 6796 Juan Square, Markfort, MN 58988

Phone: +8215934114615

Job: Hospitality Director

Hobby: tabletop games, Foreign language learning, Leather crafting, Horseback riding, Swimming, Knapping, Handball

Introduction: My name is Kelle Weber, I am a magnificent, enchanting, fair, joyous, light, determined, joyous person who loves writing and wants to share my knowledge and understanding with you.