Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Chantele
Active Participant

Welcome to my first blog post.  I hope you find this informative/useful.  This post is about how I customised the My Leave Request App within my organisation to meet our corporate policy.

For this post I will be starting from the point where the app has already been downloaded in to the WebIDE and an extension project exists.  In the case of this example the extension project is HCM_LR_CREExtenstion.


I won't be going in to too much detail about every single change I made, this is only to give and over view of the extension.

Introduction

After researching the SAP standard implementation of My Leave Request(v1) it was decided it did not meet the requirements of our organisations Leave Policy.  As a result the decision was made to customise the app and a specification was drawn up:

Specification

  1. Users should only be able to book either a Full Day or Half Day Leave
  2. Users should not be able to manually enter times for leave.
  3. Users in Personnel SubArea 1000 (not the actual sub area just an example) can still book partial leave and manually enter time.

Implementation

In order to implement the three elements of the specification I had to extend Views, Controllers and Services.  I also had to create some new utility files.


View Customisations

Views

When I customised the views for this project, rather than extend the views I chose to replace the ones I needed with a copy so I had more control over the elements.


S1

S1 is the view where the user manually enters their leave request details.   As you can see below the time selection fields have been removed and replaced with two radio buttons, offering "Full Day" and "Half Day" options


If the user selects "Half Day", they are presented with two additional radio buttons to allow the user to identify which half of their day they would like off.  It will also populate the "Notes" with the details of the leave.



S3 and S6

S3 and S6 are the views that show your leave history and further details.  Only minor changes we made to these pages to hide the leave time, and only show the leave days.



Controllers

Again with controller rather than extend i replaced the original with a copy.  This way I could just uncomment the function I wish to customise.


S1 Controller

The majority S1's changes involved making sure the new fields showed correctly, the next couple of images show some simple hide/show functions, but also additions to the standard onTapDate() function.




In order to account for the new inputs I also made changes to the Submit() function.



S3 and S6

Only a small minor change was made to these controllers, so that the times were not output in the view.  This meant changing the setMasterListItems() function in S3, and the handleRouteMatched() function in S6.



Service

Because of the changes I made in the previous 2 elements I needed to edit the OData service in order to extract new data fields and accept new inputs in to the database.  The two main OData classes that changed were made ConfigurationCollection and WorkScheduleCollection.  In the two images below there are two new fields at the bottom of the ConfigurationCollection - PersonnelArea and PersonnelSubArea.  WorkScheduleCollection now shows WorkingHours, StartOfDay, EndOfDay, StartOfBreak, EndOfBreak, and BreakDuration.  We don't need all of these field, but they will be useful in future.


Note: These changes were made in our ABAP system!




This was probably the most challenging task! as a lot of elements within the standard service had to copied so that the code could be extended.  Also having no experiance in ABAP this was a big learning curve!


Utilities

In order to cope with the service changes I had to create some new utility files.  This included a customFormatter  and CustomDataManager.


Custom Formatter

Handles formatting any new elements I have added, the image below shows the code to format the new time fields I collected in the workScheduleCollection.

Custom Data Manager

The new data manager collects new data from the OData service and makes it usable in the app.  The image below shows the method for getting the new work schedule data and also shows some submit funcitonality, due to changing the input values.



There you go.  I think I have covered everything, but I left a lot in the hope this post generates some questions/comments.  This is my first blog post on here so I hope people find this useful.  We are making more changes to this app, so hopefully I will be able to post new updated blogs soon!!

14 Comments
Labels in this area