Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
abhishek_goyal
Discoverer

Background


Purchase orders are essential for coordinating the acquisition of products and services during the procurement process. Many organization's use flexible workflows that enable individualized approval processes and decision-making to streamline and automate this process. To prevent delays and bottlenecks, it is crucial to make sure that these procedures follow pre-defined deadlines. The importance of deadline tracking with email notice increases at this point. By setting up deadline monitoring and configuring e-mail notifications, organizations can proactively manage purchase orders and ensure timely approvals.

Introduction


This blog post intends to offer a thorough tutorial on how to incorporate deadline monitoring with email notification in a flexible workflow for purchase orders. We will discuss the prerequisites, configuration steps, and the process of maintaining e-mail templates to effectively monitor deadlines and receive timely notifications.

Prerequisite


Before diving into the workflow scenario configuration & Email Template creation, ensure that the following prerequisites are met:

  1. PO flexible workflows scenario should be activated in configuration. For reference, follow path SPRO-> Materials Management -> Purchasing -> Purchase Order -> Flexible Workflow for Purchase Orders -> Activate Flexible Workflow for Purchase Orders.

  2. Knowledge of the purchase order process and the specific workflow steps involved.

  3. Understanding of the deadline requirements for Flexible Workflow step.

  4. Understanding on the Email templates creation & configuration.


Deadlines Options


There are two different types of deadlines that can be set up in "Manage Workflows for Purchase Orders" Fiori app.

After Start of Approval Workflow


In this, the computation of deadlines for each step begins as soon as the workflow is initiated. For instance, if the workflow has three levels of approval and the third level deadline is kept at ten minutes, the deadline for this step begins as soon as the purchase order enters the first level of review.

After Start of Workflow Step


In this case, the calculation of the deadline begins as soon as the specific step is completed.


Deadline Options


Here SAP S/4 2022 version provide 2 actions which can be selected once deadline option selected:

Mark Step as Overdue


Upon completion of deadline, workflow step will be marked as Overdue. I am not explaining this step in detail as we already have Blogs available for this step. Please refer to below link.

https://blogs.sap.com/2019/12/10/deadline-monitoring-in-workflows-for-purchase-order/

Send mail Notification


We will choose this Step to trigger E-mail and will go into more depth about this option in this blog.

As soon as we choose the Send mail Notification action from the dropdown menu, we have the option of selecting the email template, the recipient, and the roles to be assigned for recipient selection, as seen in the screenshot below.


Send Email Notification


In Recipients section, We have "Assignment By" dropdown which gives us an option to Select either 'Role' which gives us all Roles available in the Workflow Scenario WS00800238 or 'User' where we can provide SAP User ID and the email recipients will be determined accordingly.

To create a custom responsibility rule, you can check another blog created by me which has detailed steps on how to create a custom responsibility rule, extend a Standard Workflow scenario and assignment of Custom responsibility rule in the workflow scenario.

https://blogs.sap.com/2022/12/29/determining-sap-flexible-workflow-agents-with-custom-responsibility...

For E-mail template assignment, SAP has provided a Standard template MMPUR_PO_WFL_DEADLINE_EMAIL which we can utilize or create a custom email template and it will be available in dropdown.

Custom E-mail template creation & configuration is explained below in detail.

 

Custom Email Template Creation


You can create custom E-mail templates with 2 approaches mentioned below:

Maintain Email Templates Fiori App


Pass Standard E-mail template 'MMPUR_PO_WFL_DEADLINE_EMAIL' in the Pre-delivered Search section. Select the template and click on 'Copy' button as shown in below screenshot.


Maintain Email Template


Once you click on Copy, you will get a popup where you have to enter the custom E-mail template name and it's description. Here you can see that Prefix ZZ1_ is already provided which will be added after creation.


 

Once template is copied, it will be visible in Custom templates. By default, it will contain the Standard template Data Source (associated CDS),  E-mail subject & Body but we have an option to create New Implementation for different languages as per our custom requirement.


Custom E-Mail Template



Custom E-Mail Template Data Source


Now, we can always delete the Standard version of custom template and create a new version using Copy/Delete/New buttons based on our requirement.

So, till this point we have explored one option to create custom E-mail Template and modify the contents. However, there is a restriction here that we can't modify the Data Source. So, if we want to have more custom dynamic fields in Mail subject or Body which are not available in Standard CDS, either we have to extend the Standard CDS or we can follow the below approach which is to create custom template and assign custom CDS to the template.

Email Template using Report SMTG_WB_START (GUI Approach)


This report SMTG_WB_START provides us an option to Display/Change/Delete/Copy E-mail templates in SAP GUI. Here we don't need to follow any Fiori based approach and to create Custom template similar to PO Deadline Monitoring standard template, we will provide the Standard template in the selection screen of this report and execute it as shown below.


Once we execute the report, we can copy the template to Custom template and save it. After save we have the option to edit the content and assign custom CDS to get additional fields. Please refer the below screenshots.


Here I have updated the Name & Custom CDS to get more fields in the email template for Dynamic content assignment in mail body. Please note that the custom CDS should have WorkflowTaskInternalID field as a Key field defined else it will not work.


Custom Template GUI


 

Custom E-Mail Template Assignment in Workflow Scenario Configuration


Now when we have created the E-mail templates, last step is to configure this E-mail template in the "Manage Workflows for Purchase Orders" app. Once configured, whenever workflow reach deadline, it will trigger Notification Email.


Email Template Configuration


To test it, create a PO and trigger Flexible Workflow and once it reaches the deadline, it will create an entry in table SWW_WIREGISTER and than will be picked up Program RSWF_OUTPUT_MANAGEMENT with either should be running as a Batch-Job or needs to be executed manually with parameter productive in order to release the emails manually.



Once the above program gets executed, mail will be triggered and will be visible in SOST & Outlook if configured.


E-Mail Notification


I’ll end my blog article here. My focus is on including all necessary steps in this blog article so that it can be helpful to others as well.

I referred and followed multiple blogs and videos to achieve this requirement and below are the direct links:

https://blogs.sap.com/2019/12/10/deadline-monitoring-in-workflows-for-purchase-order/

https://microlearning.opensap.com/media/Utilising+Deadline+Monitoring+in+Flexible+Workflow+-+S+4HANA...

If you’d like to ask questions, share feedback and thoughts, please use the comment section and/or post questions in the SAP S/4HANA Cloud community and follow me for further blogs.

 

Thanks,

Abhishek Goyal
1 Comment
Labels in this area