Leave Request two layer approval

Dear Experts,
I'm trying to implement two layer approval leave request workflow by copying and modifying standard workflow WS12300111.
I follow the guide from this link:
http://wiki.sdn.sap.com/wiki/display/ERPHCM/CustomizingtheESSLeaveApprovalusingBusiness+Workflow
My workflow step is as follow:
1. first approver has approve the request
2. reset req object status to SENT
3. set next approver using method if_pt_req_request->set_next_processor
4. send the request to the second approver
I have implement badi PT_GEN_REQ to set first approver (method IF_EX_PT_GEN_REQ~FIND_RESP_AND_DEFAULT_NEXT_PRC) so that the first approver name shown correctly when requestor create the request.
Now there are 3 problems I'm facing:
1. After the FIRST approver approve the request, the note he input is shown twice. I found out this is because the status change create new version of the document. I have tried to clear this note when changing the status using method if_pt_req_request->set_notice. However, the method ignore if the notice is set to blank. Is there anyway to hadle this?
2. When SECOND approver reject the request, I want the request to be revised by the requestor, and then forwared to FIRST approver after that. For this purpose, before send the workitem to requestor back, I put step to set approver back to FIRST approver again using method if_pt_req_request->set_next_processor. But it seems this doesn't work and the request is sent to SECOND approver after revised. The supervisor name that is shown when requestor revise the request also show the SECOND approver name instead the FIRST approver.
3. I find difficulties to create email notification if the request is changed by the requestor during approval process, since there are no event triggered. Is there anyway to trigger this event or is there any workaround?
Thank you.
Regards,
Ponty

Hi Ponty,
I am trying to implement two layer approval for leave request, too.
I took a copy of standard WS12300111 as you did.
I followed the guide, you mentioned. For one level approval this works nearly out of the box.
But I don't understand the second half of the guide.
For me it will be the first time to implement a BAdI. I never did this before.
Can you please explain me, how to do it and how you enhanced the workflow for two layer approval?
Some screenshots might be useful. Eventually you can enhance the guide you mentioned.
Regarding the numerous questions on multi level approval, these hints might be useful for a large number of users.
I would be very happy, If somebody can help me, becaus I didn't know any workflow experts who can help me implementing the BAdI.
Thank you.

Similar Messages

  • ESS leave request two-level workflow

    Hi All,
    We have a requirement for a two-level ESS leave workflow and need to know what would be the approach which can be taken to modify the standard 12300111 workflow.
    The status should be as follows
    STATUS                                                STATUS                                                  STATUS
    (SENT)                      Approves              (PENDING)                 Approves                (APPROVED)
    First Level approver -
    >   Second level approver -
    >
    As we can see, we need to add a new status namely, PENDING to the backend PTREQ tables. Can anyone please provide some kind of leads/info on this.
    Thanks and Regards
    Reshma

    Hi,
    You can take a copy of that standard workflow 12300111 and build your logic accordingly.and give that workflow number in SPRO settings.
    Kind Regards
    Hari SankarM

  • Preblem for Approver in Leave request

    Hi All,
       Well i am facing a problem in Create leave Request For the Approver that is selected by default based on the organisation head.I don't now how it happens but thing that i noticed thta for an employee if i maintain a head position in the org  it picks up that head position of org as default.
    My consulatant want this value to be picked up as we require i.e fetch a particular employee through coding on the screen itself and default on the screen.Can this be done else if any body can provide any better alternative for this solution is most welcomed.
    Well we can actually send or sellect the approver what he wants but what about the approver that comes as default on screen and if there is no approver workflow will  not be triggered as it gives the error
    Please reply soon.

    1)   go to swdd tcode,give workflow name and then click on step which finds out the approver of the employee.u will find FM which is finding approver.
    now u can go an change the FM in SE37 and put ur own logic to find the approver.
    suppose u want to find approver by A002 relationship of employee then u have to write followign code in the concerned FM -
    DATA: ls_sobid TYPE sobid.
      SELECT SINGLE sobid FROM hrp1001 INTO ls_sobid
       WHERE otype = 'S'
       and   plvar = '01'
       AND   objid = i_plans
       AND   endda >= sy-datum
       AND   begda <= sy-datum
       AND   rsign = 'A'
       AND   relat = '002'.
    e_objid = ls_sobid.
    2) if not by A002 then u can create a new relationship say 'ZTV' and maintain this relationship for employees and find approver based on tht then as follows -
    SELECT SINGLE sobid FROM hrp1001 INTO ls_sobid
       WHERE otype = 'S'
       and   plvar = '01'
       AND   objid = i_plans
       AND   endda >= sy-datum
       AND   begda <= sy-datum
       AND   rsign = 'A'
       AND   relat = 'ZTV'.
    e_objid = ls_sobid.
    3) reward poins if helpfull
    amit

  • Delete Approved Leave Request

    Hi all,
    My understanding is the program RPTARQPOST posts the leave request documents to IT2001.
    I am trying to find out what happens to a leave request that is approved and posted to infotype 2001 and then later gets cancelled/rejected/deleted.  Does the initial approved record get removed from infotype 2001? If so how is this handled. Is the same program (RPTARQPOST) going to remove the records from IT2001?
    Any suggestions and thoughts are appreciated.
    Thanks
    M

    Hi,
    I think removing the tick mark in the check box "Requests have to be approved" will cause that also the Request should not be approved by the Manager. But in our Case the Request should be approved and the deletion not.
    Is there a possibility to control this apart?
    Best Regards,
    Nadin Schaa

  • ESS leave request

    Dear friends
    in ESS leave request workflow , in approval process task i am maintaining 10 days deadline , after that by using process control i am making the workitem to be obselete , then same leave request is going to supervisor's supervisor . this is properly working, my problems are
    when the first supervisor opens some other leave request still the escalated leave request is showning in the table , still system is allow him approve . and also in the supervisor's supervisor  inbox then workitem remains if he opens the workitem there is no any leave for approval in that table , so deadline mointerting is not working propely for ess leave request , and also in supervisor's supervisor  inbox workitem is not going out from uwl .
    how to do deadline mointering for ESS leave request workflow ,
    can any one help on this
    reason which i could identify is details are picking from the document database based on the approver .

    You should check the forum, I think I saw a thread in the last two days which stated that deadline monitoring is not working for the leave request. (it could be the HCM forum). So this would be why the handling is not working as expected.
    The problem of no leave to be approved for the manager could be prevented if you set a terminating event on the task which will be triggered when the leave is approved.
    Regards,
    Martin

  • Leave Request workflow in MSS - copying standard

    Dear All,
    can you please help me! Im new to this HCM and SAP.
    My Requirement is Manage or Team Lead creates the Leave request (on behalf of employee).
    If team lead creates the LR, then the approval mail has to reach manager's UWL. he has to approve or reject.
    If manager  created the LR, then no need to send the mail.
    What i did is, i copied the standard LR workflow - WS12300111 into a customized one.
    right now i didnt change anything.
    And dont even understand that how mail is going for approval in standard, since there is no mail step in standard.
    i have seen about two report also - RPTARQEMAIL & RPTARQPOST .
    whether i also need to use this..???????
    Please advice.
    Thanks,
    Rani.

    Hi,
    First of all, you should know the difference between workitem and mail.
    Work item - Action that needs to be taken on the request (i.e.)approve or reject
    Mail - notification saying that your leave request has been approved (or) employee A's leave request lying with you for approval.
    Work item - workflow generates it and it will go to UWL.
    Mail - External program or workflow will trigger and it will go to Outlook. (But standard workflow WS12300111 won't send mail)
    Now tell me your requirement.
    Do you need work item or mail not to be sent when manager raises leave request?
    I mean, Is no approval required for manager's leave request?
    Cheers,
    Raja.D

  • ECC 6.0 leave request attendence overview

    Please can someone help me how to configure the field "status" in my ESS leave request attendence overview in ECC6.0?
    I'm using a leave request scenario without approval and the status of my posted absences in infotype 2001 show the status "informed". From a proces point this status makes no sense.
    Already thanks for reading. Hope for a solution.
    Robbert Bastiaans

    Hello,
    I would definitely say for you to have a look at the BADI PT_GEN_REQ. Also verify the implementation of your PT_ABS_REQ.
    REgards,
    Bentow.

  • Error  - While changing existing leave request from ESS

    We are trying to use the standard leave request application in ESS/MSS. The basic required standard configurations are done. Since we wanted custom notifications, the related workflow is copied into custom workflow and we have included required custom notifications. The custom workflow is also configured properly.
    Now, the standard functionalities like making leave request, triggering notifications, approving leave request and posting information into backend are working fine from the ESS/MSS.
    When the employee tries to change the existing leave request (before approval) from ESS, at the 2nd step (Review and Send), it is displaying one error message General task: can be edited by all users. But, it still allows submitting the records.
    Once it is submitted, the system throws one java error at the final step (after pressing SEND button) u2013 Failed to process request. Please contact your system administrator. - java.lang.NullPointerException. The complete error information is provided in the attached word document. Even though, it throws error the submitted data is getting saved into the backend.
    Please help to solve this issue.
    Thanks,
    Prabhu
    Edited by: Prabhu T on May 18, 2011 1:53 PM
    Edited by: Prabhu T on May 18, 2011 1:54 PM

    What custom notifications you require in leave request? We have all available in standard using Rptarqemail
    First of all, the WF task should be set as
    General task: can be edited by all users, which you have done presumably under task classification
    Now, for checking purposes, can you check with standard WF in table v_t554s_web for one absence only?
    ie WS12300111.
    Please test this and let us know if you have errors
    Also please check your custom WF whether it is working correctly or not?

  • Report on Leave request (with HTML ) using ITS version

    we are using ITS version of ESS and MSS version EP 6.0 and SAP R/3 5.0.
    Our client wants a report on Leave Request(with HTML). the worflow used is WS20000081. my question is there any standard report to check the Leave Request which are approved or rejected. In SAP there is one standard report
    RPTARQDBVIEW where in when we execute no output exists.
    Please help me whether is there any report to view the leave requests.
    Regards
    Santosh Ghanwar

    Dear Claude;
    Thanks for your kind assistance... I was out for sometime & got up in some other urgent tasks...
    Sorry for delay...
    I had created the loop Payroll? with following conditions
    &Employee.ControlRecordState&     =          1     or
    &Employee.ControlRecordState&     =           2     or
    &Employee.ControlRecordState&   =          3     or
    &Employee.ControlRecordDate&     <           %Current Date%         
    but result is always "True"
    Please help me out...
    Best Regards,

  • Leave Request work items are not showing in SBWP TCODE under OUTBOX .

    Hi
    Friends
    I used work flow 12300111 for leave request process and I activated that work flow.
    I applied leave through ESS from portal(Employee login)employee sends a leave request sends good,
    and I got  Leave request(work items) Managers in box(uwl in Manager Login in portal).
    Manger Approve the leave request has been approved successfully.
    can I check whether leave request is processed in R/3.
    in tcode se38-RPTARQDBVIEW - UNDER leave request(Leave)->STATUS>COMPLETED,
    But in r/3 i execute the Tcode SBWP...
    here is no work items are not showing in outbox..
    Please help me
    Rafi Shaik

    it wont be shown in outbox of SBWP
    you need to check via SWIA or rptarqdbview or SWI5 for the user
    these are java based tasks so will be done in UWL. you can see only the tasks but after approval they are disappeared.
    The outbox shows the last 30 days by default. This default cannot be
    changed. This 30 days selection period is always set when you enter
    the outbox. However, the user can change the selection period by
    clicking the button 'Change selection period' on top of the grid
    control but this as you know will be reset once you log out.
    This is how the mapping from the
    backend workplace folders to the UWL tabs should work:
    UWL tab                        Backend folder
    Notifications                  Deadline Messages
    Tasks-> Completed Tasks        Outbox -> Workitems executed by me
    Tracking -> My Requests        Outbox -> Started Workflows
    Tracking -> Forwarded          Outbox -> Forwarded workitems
    Edited by: Siddharth Rajora on Aug 5, 2011 10:04 AM

  • Leave Request SENT but does not show in Worklist (duplicate PTREQ_ACTOR)

    I have a wierd issue in our ESS Leave System.  We are on ECC 6.0 with EP 7.0.  We are using the iView for leave approval and not workflow/UWL.
    The leave system is working great for all users except for one.  The situation is there is one employee in the approvers team that has leave requests that are sent to the approver but they do not show in the approvers worklist.  The requests are visible from the team calendar and the approver can approve them that way.  The approver has other employees in the same team that can send leave requests to the approver and they will show on the worklist with no problems.  We have checked all of the relationships and employee data and all looks OK.
    I have identified that the approver with this issue has 2 records in the PTREQ_ACTOR table.  The requests that are not showing are linked to one ACTOR_ID and the ones that are showing correctly are linked to the other ACTOR_ID.
    1) What caused the employee to have 2 ACTOR_ID records in PTREQ_ACTOR?
    2) How do we cleanup/resolve this issue from happening in the future?

    duplicate can cause  a issue in the system!
    the leave requests should be approved in some timeline and then we can
    delete the table entries which are not used anymore, then The entries which are not used should be deleted, you can write
    a custom program to delete the entries in the system.
    ie
    What we could suggest in your case is to delete one of the
    Actor Ids (the old one or the one which is less used) of the
    manager in question.
    Please identify how many entries are there in the system
    first of all.
    read and apply  the note 1316777.
    You can approve and post via the trans code in PTARQ.

  • Get Count of the number of Leave Request .

    Hi All,
    Can u suggest any FM or a particaular way which will return a number of leave request pending for approval on a particular name.
    See the scenario is i need to show a overview screen in which it will show number of Leave request or Time Regularization left in a persons name.
    i cant go in abap code of that program and get the count form the internal table cause delay in loading the application on the portal.
    Any Help ??
    Thanks n Regards
    SJ.

    hi it seems you are trying to implement mass leave approval??? anyways...
    check ptarq_reqlist_tab_flat (i dnt have r/3 connection check it is table or structure)
    a class defention where you can get help cl_pt_cor_reqs_list (open with tranx SE24)
    method -> sel_reqs_tevents_for_next_proc
    digging more into this you may get the more hints.

  • ESS - Leave Request - Workflow

    Our requirement was for the leave request process to be a simple approval process that only includes the option for the employee to u2018changeu2019 or u2018deleteu2019 a request if the manager hasnu2019t approved it yet.
    In line with this, we have configured to switched off the u2018changeu2019 and u2018deleteu2019 buttons.
    This still allows the u2018changeu2019 and u2018deleteu2019 buttons before a leave request has been approved. (which we wanted)
    And these buttons disappear once the leave request has been approved. (which we wanted)
    However, for leave requests that have been rejected, we still get these buttons. (which we donu2019t want)
    After a Leave Request has been Approved or Rejected by the manager, the "Approve another Absence" link on results page doesn't work. Can we do anything about this?
    Also, when a manager is rejecting a leave request he is not forced to enter a rejection reason.Is there a way we can force the manager to enter a rejection reason?
    Thanks
    WB

    Hi
    No your right, you shouldn't transport from IDES to DEV, What kind of development system do you have ?
    A quick way to check if it exist is to check the HR Tables e.g. HRS1205.
    And just to cover the security issue, verify that your not using structural authorization, ar at least that your having full access to the PD Object in question. You can check this in OOSB - If your not using structural authorization you will only have one entry in here - SAP* with full access. If this user is missing in this transaction, or if your user is in the table with less authorization, you wont have access to the workflow templates
    Regards
    Morten Nielsen

  • ESS Leave Request workflow customization

    Hi Guys,
    We are trying to customize the standard Leave Request Workflow WS12300111 in the ESS application for ECC6. The standard workflow passes the data to the workflow via the object REQ of type CL_PT_REQ_WF_ATTRIBS. I need to extract the leave information from the object.
    I tried creating an enhancement implementation for the Class CL_PT_REQ_WF_ATTRIBS and added my own method. But I can't see this method when I create a workflow task.
    I also tried copying the whole class and adding my code, but am not sure how to instantiate the new class in workflow. Pls help .

    Hi,
    Can you tell me the requirement.
    Do you want to change the Agent using a BADI ??
    or you want to send the leave request for another approval ??
    If you want to send the leave for another approval then just reset the status of the leave to SENT again using same class and using following code
    CALL METHOD cl_pt_req_badi=>initiate_state_transition
        EXPORTING
          im_request    = request
          im_event      = 'SENT'
       IM_RET_VALUE  = 0
        IMPORTING
          ex_new_status = me->status.
    After this, u can send this workitem to another processor..
    Another scenario could be:
    U want to determine a new agent for your workitem.
    In this case, u will have to implement BADI "PT_GEN_REQ"
    Read the documentation of this BADI.. this might help.
    And please tell me the requirement once again.. what you want to achieve.
    Regards
    Ashutosh

  • Error while employee accessing the rejected leave request workitem in UWL

    Hi
    I am getting this following error while employee accessing his rejected leave request workitem in UWL.
    Leave application is working properly to place the leave request and to approve the request, But am getting this below error when employee try to open the rejected leave request workitem through UWL.
    Application error occurred during request processing.
      Details:   com.sap.tc.webdynpro.services.sal.core.DispatcherException: Wrong WebDynpro-URL: no application name specified
    Exception id: [CA42F00060020059000017BD000630E2000492E154FAEE4C]
    Thanks
    Ram

    Resolved self.
    Applied Note 779075.

Maybe you are looking for