Skip to Content
Author's profile photo Mansoor Ahmed

SAP Fiori and SAP ESS/MSS Leave Request Approval – A Bad Bad Romance – Part 2

In part 1 we have established a concrete case for the Approval of Leave Request from Fiori and ESS/MSS Synchronously. We also established one business scenario and a practical one. We also discussed that there are numerous discussions posted in SCN and are still unanswered.

In this part we will discuss and develop a solution to cater almost all Leave Request Approval problems regarding the Workflow. So here we go with the Solution.



  1. Customized SAP Standard Leave Request Workflow (single level) to Multi-Level and according to the customer requirement
  2. Make the workflow synchronous for ESS/MSS and SAP Fiori. This means that the Approval task would be one and should work for both technologies.

Steps to handle Challenges

Customize the Workflow to Multi-Level

I am quite sure that most of have done that with ease despite of the issues you faced but I feel like putting this up because this is important. Below you see is the snapshot of the workflow customized to make it up and running for Multi-Level Approvals. I have changed the workflow logic altogether and it’s working.

First of all, Request ID and initial approval is set just before the approval process is started. Then, the approval process starts.

Here, I am starting the approval process and checking if Request status is Approved or Withdrawn or Rejected. If REJECTED or WITHDRAWN complete the workflow. If APPROVED check if there is a next approver or not.

Above snapshot is simple but a bit tricky, I am checking next approver is there or not? If there is no agent why I am setting status to APPROVED and if there is next agent why am I setting the status to SENT? Confusing! Yup, this is confusing but I can clear this right away.

  1. If there is next agent, then the request status should be changed to SENT else it won’t go to next approver. Another reason for setting the request status to SENT is that, in table PTREQ_HEADER latest row for the request ID is APPROVED so this has to be changes to SENT in order to loop the workflow to next agent

Now, the tricky part! Sometimes I don’t know how but this happens, the request status is not set to APPROVED somehow. So, in order to cater, I am checking if there is no agent, then the status should be changed to APPROVED and workflow should get completed by failing the loop condition. I hope this clears everything up.

Above screenshot is very easy, I am getting the current status of the Request, is it SENT (means there are other approvers as well), is it APPROVED (means no other approver). In Loop I have put the following condition: &EV_NEW_STATUS&  ≠ SENT. In case of next approver loop condition would get true and loop with work else it won’t and will go to next step.

Above part is standard, I have just made one change if there Leave Request is REJECTED or WITHDRAWN send an email and SMS.

Rest of that is standard, wait for status change. Only change is, when a leave request is posted in the system, send an Email and SMS.

Technical Part – Workflow Explanation – Part 3

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Anand Dandekar
      Anand Dandekar

      Dear Mansoor,


      Thanks for such informative and detailed blog on leave request workflow.

      I am facing one similar yet different issue.

      I am able to submit leave request from portal successfully, the request then goes in the queue of approver in UWL, but when approver clicks on this, it gives 404 NOT FOUND error.


      • When i am executing this report  'RPTARQAPP' , I am getting Dump ' Access using a 'ZERO' object reference is not possible.' 


      • From SBWP inbox, i am getting message like " the process can not be started from a business workplace.

      Code line:

      SPAN {
      font-family: "Courier New";
      font-size: 10pt;
      color: #000000;
      background: #FFFFFF;
      .L0S52 {
      color: #0000FF;
      .L0S70 {
      color: #808080;
      >>>>>>>>>>>>CALL METHOD me->if_pt_req_request~set_next_processor



      Please suggest on this issue.


      Note: We have S/4 HANA in the backend and SAP EP 7.5 as front end interface and using PFCG roles through portal to access ESS application.



      Thanks in Advance.