Skip to Content

My Timesheet v2 app extension

Hi Experts,

We have a client requirement to add a text field to display remaining hours (target hours -(minus) clocked duration) below the calendar date.

How to extend sap.me.calendar control to add the remaining hours/day under the date? Is this attainable.. Pls help! 

Attached screenshot of the requirement..

Thanks and regards,

Saranya

timesheet.png (61.3 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 28, 2015 at 05:51 PM

    There's no extension point within the view to add your desired requirement, so you could use a view replacement extension with a copy of the original.  I would just add a FlexBox between the calendar and Object List Items.  Then create a controller extension of the s3 controller and add a function to perform the calculation.  You can get the targetHours and recordedHours from the TSM_WEEKLY model.

    Regards,

    Jamie

    SAP - Technology RIG

    Add comment
    10|10000 characters needed characters exceeded

    • You should be able to add the same functionality into the other controller, maybe add it as a utility.  You could either use a publish/subscribe or add another listener on the attachRouteMatched method to call the function and call it after your submit if you are staying on the view.

      Regards,

      Jamie

      SAP - Technology RIG

  • avatar image
    Former Member
    Oct 28, 2015 at 02:26 PM


    Hi Saranya.

    Did you prepared the development ambient to change this application?
    If not follow the links to mount the development machine.

    For installation part you can refer this

    http://help.sap.com/hana_one/SAP_UI5_Reference_for_SAP_HANA_en.pdf


    For using (developer guide)

    http://help.sap.com/hana/SAP_UI5_Developer_Guide_for_SAP_HANA_en.pdf

    Best regards

    Ricardo Pereira

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 28, 2015 at 05:41 PM

    so technically you can use the same logic to calculate width of day

    //oControl is a sap.me.Calendar

    var aWeekDays = oControl.getDays();

    var iWeekDays = aWeekDays.length;

    var iWeeksPerRow = oControl.getWeeksPerRow();

    var iDaysInRow = iWeeksPerRow * iWeekDays;

    var iDayWidth = (100 / iDaysInRow);

    //oRm.addStyle("width", iDayWidth + "%");

    that calendar is in S3.view.xml so you would need cretea an extension to modify it

    Add comment
    10|10000 characters needed characters exceeded