Creating a Custom Fiori Application for Approving Time Events
This blog contains the overview section of the document entitled “S4HANA – Approve Time Events.pdf“. The document is a guide for creating a custom solution that allows managers to create, edit, audit, and approve time events.
This custom application is dependent upon an enhanced version of the “My Time Events” Fiori application.
Overview
Purpose
The purpose of this document is to describe the required components of a custom Fiori Application called “Approve Time Events”, which was built to run on SAP S/4HANA 1511. These components include:
- HANA CDS Views
- Gateway Service Development
- Launchpad Configuration (LPD_CUST)
- Launchpad Designer Configuration
- SAPUI5 Development
The “Approve Time Events” application allows managers to approve Time Events (Clock-in/Clock-out) Currently, SAP does not deliver a Fiori application that provides this functionality, instead SAP offers time event approval functionality in the “My Inbox” application (see the comments section of Gertrud Beisel’s blog, “My Time Events – The New Fiori App for Clock-in/Clock-out“). Using the “My Inbox” application, to approve time events, could be problematic for managers with a large number of direct reports. This new “Approve Time Events” application was created to simplify the process of approving time events.
The “Approve Time Events” solution includes an audit trail of changed time events. It captures the creation and changing of time events into a custom table that can be used for reporting purposes.
The “Approve Time Events” solution is dependent upon enhancing the standard “My Time Events” application. The “My Time Events” application was enhanced to allow employees to enter an attendance type, position type, and cost center when creating time events. These fields are also present when a manager creates or edits a time event in the “Approve Time Events” application.
The Gateway Service Builder project, for this application, was created by extending the enhanced version of the “My Time Events” service.
Since the “Approve Time Events” service is a subclass of the “My Time Events” service, some of the code, required for this “Approve Time Events” application, resides in the “My Time Events” super class and its corresponding API. The required code can be found in the document “S/4HANA – My Time Events”.
Since this application was enhanced for a specfic set of requirements, it will most likely need to be adapted to the the HCM processes of any other implementing customer. This document and the incuded source code could greatly reduce the effort to build a similar application.
Caution:
This solution uses direct table updates to tables TEVEN & TEVEN_MORE. This was necessary because a suitable RFC or BAPI could not be identified. The solution also uses standard and custom batch jobs to initially write the time events records to tables TEVEN & TEVEN_MORE, with the required status. A description of these batch job is included in the Appendix. The code of the custom batch has been included, with the permission of the code’s owner.
Functionality
The section highlights the features and functionality of the “Approve Time Events” custom application.
- The “Approve Time Events” application displays the employees of the manager in the Master list.
- When an employee is selected, the pending time events are displayed for that employee.
- Missing time event “stubs” are generated, so that the manager can easily create a missing time record.
- New time events can also be created by selecting the “Create” button in the footer.
- Managers can edit, delete, and view the notes for approval for an existing time event.
- By selecting the “Approve” button, all the time events, for an employee, for the day are approved.
- The Time Statement can be viewed by selecting the “Time Statement’ button in the footer. Once the Period is selected, the time statement is opened in a new tab. This functionality is identical to the time statement functionality in the “My Time Events” application.
- The Employee list can be filtered by the employee’s cost center.
- The Employee list can be sorted by the employee’s name, the number of pending time events, or the employee’s cost center.
- Selecting the “Stored Filter” button will apply the last filter that was selected. The last filter selected in stored on the user’s machine.
Figure 1 – The “Approve Time Events” tile, for the Fiori Launchpad
Figure 2 – Master / Detail views of the “Approve Time Events” application
Figure 3 – Filter by Cost Center
Figure 4 – Create Time Event from missing time event “stub”
Figure 5 – Edit Time Event
Figure 6 – Delete Time Event
Figure 7 – Approve Time Event
Figure 8 – View “Note for Approver”
Figure 9 – Create new Time Event
Figure 10 – Options for sorting the Employee list
Figure 11 – Display Time Statement
Solution
Please see the document entitled “S4HANA – Approve Time Events.pdf“, for the full solution.
New NetWeaver Information at SAP.com
Very Helpfull