cancel
Showing results for 
Search instead for 
Did you mean: 

E-Mail Notification for 2nd Level Leave Request Approval

Former Member
0 Kudos

I enhanced a copy of standard leave request approval workflow WS12300111 with a second level of approval.

The case is that, first the teamlead has to approve a request, and after that the line manger hast to approve it.

Now I have the problem, that via Report RPTARQEMAIL the line manager get's both e-mails. The one for the first level of approval and the one for the second level of approval.

What I did so far:

I copied the approval task ts12300097 and added a rule for the agent assignmen to it, so that the team lead get's the work item in his uwl inbox.

After he had approved the request, the request status is reset from "APPROVED" to "SENT".

After that the workflow reaches the secon standard task ts12300097 with the line manager as assigned agent.

He approves the request. The requestor gets a e-mail notification that his request has been approved and the absence gets written into infotyp 2001.

My problem:

The report RPTARQEMAIL runs hourly as a job. But instead of first notificate the team lead, the line manager gets the mail two times. frist time before the team lead has approved and the second time bevor he has approved the leave request. The team lead doesn't get any notification mail.

Hope you can help me.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Me eeee,

I know i really shouldn't be asking you a question in response to your question, but please indulge me.  Could you tell me how you changed request status from "APPROVED" to "SENT", I have a need to do same and have been cracking my head on how to do this.

Cheers

Lukas_Weigelt
Active Contributor
0 Kudos

Hi,

it is not inevitably necessary to use RPTARQEMAIL for sending Emails. Since you are using a customer Workflow anyway, you could define a step which implements a custom method which sends emails directly. This way you wouldn't have this hourly-job problem.

It's pure theory though 😉

Cheers, Lukas

Former Member
0 Kudos

I figured out, that the manager is getting both e-mails because the teamlead is not set to be next approver in the 'request table' (PTREQ_HEADER/ PTREQ_ACTOR) from which report RPTARQEMAIL is getting the next processor for the first task.

I added a rule to the first approval task in my workflow, which 'calculates" the teamlead via an evaluation path. The teamlead is getting his workitem in his uwl, but he doesn't occur in the mentioned 'request table'.

I think I have to implement BAdi PT_GEN_REQ, but I have no idea on how to do this.

I hope you can help me fixing my workflow, so that not only the managers id is getting transfered to the 'request table' but also the teamlead who has to approve the request first.