Skip to Content

Subject Area: Employee Self services

Workset: Working Time

Service: Clock in/out Correction

Business Requirement:

Clock in/ out correction service has documentation that refers to reusing standard document workflow (WS12300111). But we need to make certain modifications and adjustments which are not mentioned clearly in the documentation.  There is an easy way to create workflow using standard approval report that is provided in R/3. This is a simple solution that meets the requirement for creating workflow using standard report for Clock in Clock out correction service available as part of Business Package for Employee Self-Services.

Solution for workflow that is not delivered with standard product.

Description : Clock in/ out correction service under employee self service has a facility to use the worklfow but there is no workflow available that can be readily used. SAP advises to copy the standard leave workflow (WS12300111) and use the same. There is an approval program available (Transaction PTCOR -> Approve Docuement) for administrator. Using the same program we will be creating an approval workflow.

1. Create  a custom transaction calling report program RPTCORAPP and selection screen 1000.(ZPT_APPROVE)

2. Create another custom transaction(Z_APPROVE_CLINOUT) with following code.

Call transaction ZPT_APPROVE AND SKIP FIRST SCREEN.

3. Using transaction sw01 create an object.  call the above tranasaction in the object created in step 3.

4. Create a custom task with the above object and method (STEP 3) (There will be no parameter passed between the task container and the workflow as we are calling a transaction only)

5. Create Copy of WS12300111 using transaction SWDD.

6. Delete the step Process Request by Employee (TS12300116) from copied workflow.

7. In the copied workflow in the Approval process instead of standard approval task use the custom task created in step 4.

8. Activate the customized workflow.

9. Under spro config please follow the link Personnel Management -> Employee Self-Services-> Service Sepcific Settings-> working time ->Clock in\out Corrections-> Processing Processes -> Define Processing Processes

Under workflow template select the checkbox Use SAP Business Workflow.

Provide the number of Custom Workflow activated in Step 8 in the following fields.

WF ID New Clock-In/Out Entries
WF ID for Deletion of Entries
WF ID: Changed Clock-In/Out Entries

Complete all the configuration that is provided in SPRO under clock in clock out correction.

Once you are done with this process then on entering the clock in/ out time the workflow will be received by the next agent defined in the rule / expression that is used in workflow.

The output will work according to the report(RPTCORAPP) if in case there is any need to make change then a copy of the classes can be created that are used in the approval report and customization can be achieved. 

To report this post you need to login first.

36 Comments

You must be Logged on to comment or reply to a post.

  1. Christopher Solomon
    During the migration process problems have been reported for this blog. The blog content may look corrupt due to not supported HTML code on this platform. Please adjust the blog content manually before moving it to an official community.
    (0) 
        1. Umesh Chaudhari
          Hi Brain,

          I am also facing the same problem. so according to your solution i did following things.

          1. created the tcode ZPT_APPROVE for report RPTCORAPP.

          2. I created the BOR Object ZCLOCKIN. having a dialog Synchronous method Approve. In this method i wrote the code
          CALL TRANSACTION ‘ZPT_APPROVE’ AND SKIP FIRST SCREEN.

          3. I created the task TS91000022 which has a dialog method ‘APPROVER’ create in step 2.

          4. now i copied the workflow WS12300111 to my WS91000010. I did the agent assignments and all.

          5. I assigned this workflow in customization node for clockin clock out.

          6. i have also scheduled the back ground reports as described in the SAP documentation

          but my work flow is not getting triggered. when i try to see the started workflow for the employee i am not able to see any thing.

          please also tell mi should i add the entry in SWFVISU?
          if yes then what all parameters i should pass?
          which webdynpro Application should be mentioned in parameters for SWFVISU.

          Your reply is very much valuable to mi.

          Regards,
          Umesh Chaudhari.

          (0) 
          1. barin desai Post author
            1. go to pftc selecte template for workflow 91000010 and check if you have activated the workflow template by making it a general task(menu->additional data->agent assignment).

            As you are saying that the workflow is not getting triggered this is the common issue. please revert if this doesn’t solve the issue.

            (0) 
            1. Umesh Chaudhari
              Hi Barin,

              Thanks for your immediate reply. now here i am stuck with some EP error so i can not test this at this moment but definatelly i will check and get back to you once my EP problem is solved.

              Regards,
              Umesh Chaudhari.

              (0) 
              1. Umesh Chaudhari
                Hi Barin,
                I am having still some queries with clock in clock out. Now my workflow is getting triggered. And I am able to see the work item in the inbox now.

                But still I am getting following error when I clicked on the UWL work-item.

                Application error occurred during request processing.
                  Details:       com.sap.tc.webdynpro.services.sal.core.DispatcherException: The requested deployable object ‘sap.com/ess~lea’ and application ‘LeaveRequest’ are not deployed on the server. Please check the used URL for typos.Exception id: [0011855F5368006C0000005200006A0F000441B6DAD21D4B]

                I checked all the entries in SWFVISU. I also checked the XML file of UWL but still I am not able to solve this for this I am following with the Portal consultant.

                1)
                When I do apply for the leave request I get the request in the i-view
                Leave Request: Approval

                But when I apply for the clockin clock out correction. I am not able to see the same in Leave Request: Approval I-view. I am saying that this should happen as I copied the workfow WS12300111 and I am using the same task WS12300097.

                When I tried to approve the clock in clock out correction its goes successfully and employee is also able to see the same in clock-In clock out correction I view.

                2)
                Because my UWL is not working so I executed the report RPTCORAPP using the approvers login of R/3.

                When he rejects this application it comes to my task TS91000022.

                Here this is not going to UWL of Employee as there is no entry in SWFVISU. So for this do I have to develop new web dynpro application?

                I also tracked all the status of this document using report RPTCORDBVIEW.

                Please clarify my doubts. May be I am missing some thing.

                Regads,
                Umesh Chaudhari.

                (0) 
                1. barin desai Post author
                  you dont need any entry in swfvisu for this task.

                  Just remove the entry from swfvisu.

                  you need to understand the design of this as you are not doing the correct config. Unless and until you understand the design and do the required config you will keep on facing some or the other issues.

                  (0) 
                  1. Umesh Chaudhari
                    Hi Barin,

                    First thing is I have not made any entries in SWFVISU.

                    I agree that I do not know the design. But can do a favor to mi by telling how the manager will approve the clock in clock out correction?

                    Regards,
                    Umesh Chaudhari.

                    (0) 
                    1. barin desai Post author
                      Read your remarks. your query is on leave application or clock in out workflow.

                      in your comments you are talking about “when i apply for leave”

                      please answer the below questions if you expect me to help.

                      1. What config have you done to make your workflow work for clock in out in spro.

                      2. why are you refering the the leave application error while executing clock in out workflow.

                      3. does your custom workflow reaches the approver for clock in out correction.

                      4 if 3 is yes then what screen do you view on execution of workflow from uwl.

                      (0) 
                      1. Umesh Chaudhari
                        Hi Barin,

                        Soory barin if I did not write it properly. My leave request is working properly. Here onwards I am talking about only clock in clock out correction

                        Following are the customization I did

                        Spro->personnel management->Employee Self Service->service specif settings->Working time->clock in/out Correction->processing Processes

                        1)create rule group:
                        here rule group is default 00000001 SAP Standard

                        2)Define Periods for Clock-In/Out Correction Default
                        00000001 SAP Standard 01.01.1800 31.12.9999
                         
                        3)Define processing processes
                        Use SAP Business Work Flow
                        WF ID New Clock-In/Out Entries          91000010
                        WF ID for Deletion of Entries          91000010
                        WF ID: Changed Clock-In/Out Entries      91000010
                        System response
                        Correction have to be approved(Check Box selected
                        Clock in/out Entries Cannot be deleted(Check Box selected
                        User interface element Display Field for next Agent (Check Box selected)
                        Use notes (Check Box selected)
                        Determine next agent Last agent, Then LineManager

                        4)Define reports variants and background processing
                        Here variants created for
                        RPTCORTMAIL (Clock-In/Out Corrections: Request Correction of Errors)
                        RPTCOREMAIL (Clock-In/Out Corrections: E-Mails to Involved Persons)
                        RPTCORLIST (Clock-In/Out Corrections: Check Corrections)
                        RPTCORERR (Clock-In/Out Corrections: Process

                        Background reports scheduled are

                        RPTCORTMAIL (Clock-In/Out Corrections: Request Correction of Errors)
                        RPTCOREMAIL (Clock-In/Out Corrections: E-Mails to Involved Persons)
                        RPTCORPOST (Clock-In/Out Corrections: Post)
                        RPTCORSTOPWF (Clock-In/Out Corrections: End Open Processes
                         
                        5) Every thing else is default.

                        6) My WorkFlow is getting triggered and it is reaching the approver

                        7) Here approver is getting the Leave Request approver screen (Before approve or reject)

                        8)and when it is rejected by approver I am able to see the workitem in employee inbox in R/3. Nothing is coming in employee’s UWL in Portal.

                        Regards,
                        Umesh Chaudhari.

                        (0) 
                        1. barin desai Post author
                          what is the entry that you have maintained for task that you are using under wf91000010 in swfvisu transaction. please donot comeback without checking.
                          (0) 
                          1. Umesh Chaudhari
                            Hi Barin,

                            Do u really mean “wf91000010”?

                            i have not maintained any entry for wf91000010.

                            Actually previously it self I asked you that should I maintain some entry here?

                            Regards,
                            Umesh Chaudhari

                            (0) 
                            1. barin desai Post author
                              umesh i want you to read my questions very clearly before replying.

                              I want to know if you have made any entry of any of the templates/tasks used in your swfvisu. You dont have to maintain any entry for any of the task. If you have not maintained any entry of any task that you are using in this workflow then just re-register you uwl system and check.

                              It can be any task. Please reply if you donot understand my question.

                              (0) 
                              1. Umesh Chaudhari
                                Sorry barin again.

                                Under wf91000010 I am using following task
                                TS12300097
                                TS12300104
                                TS91000022

                                Following are entries in swfvisu

                                TS12300097
                                     APPLICATION     LeaveRequestApprover
                                     PACKAGE          sap.com/ess~lea
                                TS12300104
                                     APPLICATION     LeaveRequestAdmin
                                     PACKAGE          sap.com/ess~lea

                                No entry for TS91000022

                                Should I remove these?

                                Regards,
                                Umesh Chaudhari.

                                (0) 
                                  1. barin desai Post author
                                    7. In the copied workflow in the Approval process instead of standard approval task use the custom task created in step 4.

                                    you haven’t created the workflow as advised in the blog. if you are not clear regarding some steps then do revert back with specific query.

                                    you are using leave approval task in clock in / out workflow and that is the reason you are getting such output.

                                    (0) 
                                    1. Umesh Chaudhari
                                      Hi Barin,

                                      I did not read it correctly.

                                      Now I changed the tasks TS12300097 to TS91000022 and also I changed the task TS12300104 to my custom task.

                                      Now in approvers inbox in portal I am getting a task when I click on that I am getting the output
                                      “Clock-In/Out Corrections: Approve Documents”.

                                      Here manager is getting R/3 like screen, which is not desired.

                                      So here do I have to develop the web dynpro application and attach it?

                                      Regards,
                                      Umesh Chaudhari.

                                      (0) 
                                      1. Umesh Chaudhari
                                        Hi barin,
                                        Thanks for all your help. i undetstood that this the screen which you approver be getting without any development which is the obejective of the blog.

                                        we will try to convince the client for the same screen and avoid the development.

                                        Regards,
                                        Umesh Chaudhari

                                        (0) 
                                        1. barin desai Post author
                                          Right umesh.

                                          you  are most welcome. you can develop webdynpro screen thats not an issue at all.

                                          This blog is to avoid the development time.

                                          (0) 
  2. Anonymous
    Hi Barin,

    Thanks a lot for you to sharing this solution!
    In the last customer we creat a new workflow, but this is a good way to do this, without making any developments 🙂

    🙂
    Sónia

    (0) 
  3. Ashutosh Gulkhobre
    Hi Barin,

    Nice one… You can develop a function module and get the list of approvals as a result of the FM. And then you can write another FM to approve documents.

        PERFORM GET_WORKLIST_FOR_APPROVER
          USING
            APP_PERNR
            SPACE
          CHANGING
            EVENT_DATA.

    This is the key code to get all the pending requests for a manager. ( this is from RPTCORAPP) report only. If you dbl click on this perform, you will get detailed code. Use this code in your FM. Get the pernr from sy-uname and pass it to above perform. You will have to include some “includes” from that report.
    EVENT_DATA will have all the pending approvals now with request IDs and request information.
    This wud be your first FM to generate list of approvals pending.

    Now you want to approve the requests ..
    EVENT_DATA will have request ID. Develop a FM with req id and event as input parameter. Now there is a simple method to approve.

    CALL METHOD ca_pt_req_header=>agent->get_request
          EXPORTING
            im_request_id = request_id
          IMPORTING
            ex_request    = request.

      CALL METHOD request->initiate_state_transition
          EXPORTING
            im_transfer_event = event
          IMPORTING
            ex_new_status     = new_status.

    Here, new status you can set to ” Approve ” and the request will be approved.

    But to approve the request, you have to enqueue and deque the request. You can use
    CALL FUNCTION ‘ENQUEUE_EPTREQ’
        EXPORTING
          mode_ptreq_header = ‘E’
          request_id        = request_id
        EXCEPTIONS
          foreign_lock      = 1
          system_failure    = 2
          OTHERS            = 3.

    CALL FUNCTION ‘DEQUEUE_EPTREQ’
          EXPORTING
            request_id = request_id.

    Now its just up to creating a WD based interface.

    Off the record:
    I have developed this application in Reliance Retails last year. I dont have the code. I just pulled out the bits and pieces from standard programms. Can you please get that code for all of us ?? Sorry everyone for this discussion here.
    Barin, If you can please contact P. Rajesh and if he can get this code it will great. I also dont have the code and I want it for my reference now.

    (0) 
      1. barin desai Post author
        You have not understood the objective of this blog.

        Documentation in SAP help says that copy the workflow (document) and it will be done for clock in/out which is not right hence as an alternative I have suggested this approach. My focus is meeting the business requirement within minimum possible time(10 mins) with least possible code as I dont want my customer to write lot of code.

        I already know what was done in retail. I am unsure about your information but I have reviewed retail. I have worked with reliance for 6 years and I was the one who developed their ESS on 4.6B.

        We are aware of your approch too and that is perfectly fine provided you are ready to write extra code. But if you want to follow the standard documentation then this approch is what SAP recommends.

        (0) 
        1. barin desai Post author
          Ashutosh

          What do you mean by helping others by providing email address.

          I am unable to understand the same. I think I reply to this forum quite often and that is how I help. With email address what is extra that anyone is going to achieve. This forum is a better source than mail as everyone here can read all the solutions suggested.

          (0) 
          1. Ashutosh Gulkhobre
            Barin,

            Sorry for the misunderstanding I created.
            I have lost the code from Retail and I wanted the code. I did not ask for your mail ID, if possible, can you give me the code.

            Cheers!!
            Ashutosh

            (0) 
              1. Ashutosh Gulkhobre
                Hey Barin, wait I did not mean it like that.

                what I was hoping is if we could figure out a way to share the code with the community but I realized now that it was special project and may not apply to everyone – if there was a chance though I think the community might find it interesting.

                Thank you anyway and sorry for the confusion – seeing a blog related to work I did was very cool and I got carried away.

                (0) 
  4. Chun Fai Li
    Hi, I hope it won’t be too late to ask about this.

    I have followed the steps above to implement a the workflow accordingly. However, I am facing an issue now, please advise.

    When the supervisor rejected the correction. SAP will track the document status change (with event step). After the status change detected, it will go back to the approval step via the loop. At this point, the applicant can change the clock input, but CANNOT save the updated clock entry.

    Error message: you are not the receiver of the work item.

    Have you faced this before? Any idea to this issue? Please advise, many thanks.

    (0) 
    1. barin desai Post author
      hi thank you for the query.

      1. I assume that you are refering to the task where the workitem will go back to uwl of initiator post rejection by approver.

      for the above definately the dependency will be on the application that is being used in clock in out correction. I would suggest you donot send the workitem back to user. instead allow user to create new requests and handle this by informing the initiator on the mail.

      2. The error that you are getting suggests there is some issue with the workflow. i donot have a system where I can check this right now but I will reply once I get an opportunity to check this.

      The message suggests that the user is trying to access a workitem which he/she hasn’t received.

      This needs debugging at user level.

      (0) 
  5. Ioan Radulescu
    very fast way to make it work. i have the impression that the program RPTCORAPP also takes care of the defined proxy of the original employee boss, could any of you confirm that?
    what is not so good, is that popup as ITS Transaction in the browser. But it’s ok, because it works. Unbelievable that SAP doesn’t provide a way to do this through an application.
    (0) 
    1. Rodel Celo
      Hi,

      Thanks for posting this blog..although I haven’t tried it yet

      In any case, may I ask if there is a way to add a custom field in the layout for RPTCORAPP? Our requirement is to have the Employee Name displayed on the screen, but the given layout for RPTCORAPP does not have this information available.

      Your assistance is very much appreciated

      Regards,

      (0) 
      1. Ioan Radulescu
        make a copy of rptcorapp, replace the call to rptcorapp in the mentioned transaction with your new program.
        In the new program define your own structure for output in the alv, field catalog subroutine, your own user command subroutine (to be able to select on the new structure when approving).
        For name use RH_READ_OBJECT for your new field in your own structure.
        I used for the comments of the user class cl_pt_cor_reqs_list to get the details of the request, after getting the instance:
            CALL METHOD lr_cor_req->get_reqlist_entry
              EXPORTING
                im_request_id    = lv_y_event_alv-request_id
              IMPORTING
                ex_reqlist_entry = ls_wf_request.

            lv_y_event_alv-y_comment = ls_wf_request-version-curr_notice.

        (0) 
  6. Narasimha Anikekalva

    Hello Barin,

    Thank you for the procedure.

    I have followed all steps.But i got an issue.

    I am getting workitem to linemanger SAP INBOX but not to his UWL in EP login.

    Can u suggest any steps that i can take.

    (0) 
    1. Barin DESAI

      workflow in uwl has no link to this solutoin. you need to configure the xml property so that uwl can sync with inbox.

      let me know if more help required. this solution is applicable to ehp4  as ehp 5may would have brought some more changes.

      (0) 

Leave a Reply