Skip to Content
Author's profile photo Volker Ruof

EC Time hints and tipps Nr. 6: how to post a fix amount of hours to a time off in lieu account

Hello Time Community,

I promised in a blog on a similar but more complex requirement (click here to learn how the employees planned hours are posted to a time off in lieu account when he works on a public holiday) to describe how to post a fix number of hours to a time off in lieu account in specific circumstances. Here we go:

In this blog I want to show how a fix value is posted to a time off in lieu account when the employee works overtime on a non-working day. Quite easy, straightforward thing.

So assume a customer want to post always 5 hours into a time off in lieu account when an employee performs overtime on a non-working day. Even when he works only 1 hour or 10 hours. Non-working day could be a day without planned working time or a public holiday. In this example I show how this can be achieved with a view configuration steps.

So lets get started. I don´t write on how to detect overtime at all – I assume you are already familiar enough with time valuation when you read my blogs to cover this part on your own.

So lets assume we have already created some valuation rules to get a time type group called “calculated overtime”. This could be the result of a daily, weekly or monthly overtime calculation.

Now you take this time type group and apply a filter on it that checks if the overtime was performed on a non-working day. Of course you can also apply more/different filters like on a specific weekday, inbetween a specific clocktime frame and / or on a public holiday. But here we only check on non-working day.

Lets describe the filter first.

We need a filter that can be applied to check if attendance times exist on a non-working day. So the criteria is “non-working day”. We got an extra parameter for this in our filters. Looks like this:

screenshot

 

 

Now lets have a look on the valuation rule we need:

This time valuation rule uses as a to be processed input time type group the “calculated overtime” hours. The above described filter is applied via the valuation type “Filter input group” on the input time type group (calculated overtime) and those hours that “pass” the filter, means that fulfill the filter criterias, land in the “time type group below” time type group called “overtimes on non-working day”. The time type group above field can be blank. Here would land all overtime hours on a working day but we don´t need them further for our example.

Remember: the above / below concept is THE concept in our time valuation engine. When you understand how this works only the sky is the limit (okay, that´s a bit exaggerated ;-)). But it is essential to understand how this works, so let me tell you how I am doing it.

For me the above / below thing works like a big sieve. You pour something into the sieve, it gets processed on the basis of the valuation type. The hours that met the criterias pass the big sieve and land in the section “time type group below”. The remaining hours (cause they do not met the criteria or are splitted based on a threshold) remain in the upper section of the sieve, hence the time type group above section.

In our example overtime is filtered with a non-working day filter. The hours that met the criteria (overtime performed on a non-working day) are passing the sieve and put into the time type group below section. Overtime hours performed on a working day do not met the criterias of our filter and would be stored into the time type group above section. But in our example we don´t need them for further calculations so we can leave this field empty.

We got now the overtime hours based on working time on a non-working day. Now we need to “reduce” the overtime hours to 1 in order to be able to apply a multiplication factor to it. We could do this again with some comparisons with a threshold and route input function, but we can make life ourselves much more easier and just use the “counted events” for it.

Lets sort this out:

Remember, we are only interested in the fact that an employee has performed overtime on a non-working day, not on the actual hours that he has recorded. So we create a time type group of the category “counted events” for this. These events have the fantastic habbit to count just 1 when the defined criterias are met.

So we create first the counter (note that it is category “counted events” to get the 1 counting, a “collector” would give you the actual hours)

 

Now we need another time valuation rule that examines the overtime that we have pressed through to our non-working day filter and when some hours exist in this time type group a value 1 is posted to the counter:

This is exactly what in above time valuation rule is done. Input time type group is our initially created “overtime on non-working day” time type group that contains overtime hours performed on a non-working day. The valuation rule is a “valuate per day” rule and not “per period” – cause otherwise the counter would increase throughout the time sheet week. We compare with the fix value 0 and write all above into our counter.

This means in essence: each time the time type group contains overtime on a non-working day a counter with value 1 is created per day.

So, we got our 1. Now the last piece is to apply a multiplication factor to it and post this to the time off in lieu account.

Quite easy thing:

 

This time valuation rule takes as input time type group our above created counter for overtime on non-working days. We use the “aggregate input group and split” valuation function. The rule is triggered per day and we compare the counter value (it can be only 1 or 0 in the counter due to the rules we applied before) with the fix value 0. When there is a value 1 in the counter it is forwarded to what is defined in the “time type group above section”. And there we have got a time type group “hours to be posted to toil”. That´s it. But wait, where is the multiplication happening?

Check the line at the bottom of the rule where the Input time type group is defined. At the very end of the line you see a field called “factor” and a value 300. This means our event counter for non-working days value is not 1, but 300. So 300 is compared with 0 and passed to the time type group above. 300? Okay, this is now again a bit a weired technical thing where you have to think across 5 corners in order to come to the conclusion. Let me help you:

In the end we want to post hours and minutes to the time off in lieu account. Our time valuation rules calculate with minutes. When we post a value 300 to a time off in lieu account than these are 5 hours. 300 / 60= 5 hours.

 

And just for the sake of completeness here a screenshot of the time type group that we used in the above rule which is used as a tool to post the hours to the time of in lieu account.

 

And here is the result, we configured for better visualizing the result some of the time type groups as UI components (which you probably not do in real business implementations). Employee has recorded in the above example 1 hour on a Saturday (non-working day). You can see this below in the background of the result pop-up.

You see that 1 hour of calculated overtime is created. (In the configuration of this system are more evaluation rules triggered that calculate for example also a premium pay of Overtime 1.5- please neglect this). Consider only the end result which is: 5:00 hours have been posted to the time off in lieu account although only 1 hour has been recorded.

Success !

The time type group above in our example is defined as being an overtime premium. The hours are posted to the time off in lieu account when in the employees job info the “overtime compensation method” is set to: time off. If you want to pay out the hours the employees need to have the compensation method “pay out” set in the job information.

By the way, due to the fact that always several paths lead to Rome: you could have used a slightly different way as well to get the same end result.

Check again the valuation rule “Multiply counter by fix factor” 3 screenshots above where the 300-factor was used. You could have dropped the 300 factor-thing here and just use no factor at this place at all. Result would have been that the collector is filled with 1 and 1 passed to the “hours to be posted to toil” time type group. In the definition of the time type group there is also a factor possibility. This factor is used to multiply for example overtime hours with a premium factor. Like for example 1.5 when you want to pay out 1.5 hours for each calculated overtime hours. This factor can be used for our use case as well – but here you would need to enter 5 as a factor. So one time a factor is used within a valuation rule, the other time it is used at the very end of valuation process where results are created. This two different possibilities give you more flexibility to challenge more complex requirements.

But why do I have to use one time 300 and the other time 5? In the time valuation rule processing we calculate deep in our evaluation engine with minutes. So in order to achieve a result of 5 hours we need a factor of 300 cause here everything is in minutes. But when it comes to the end processing where pay types are created or postings to time off in lieu accounts are done we calculate with hours and minutes, so here are factor of 5 is needed.

Hope this helps.

Thanks to Priyanka Agarwal from the Time development team for providing the rules and the screenshots.

And compare the approach above with the already mentioned more complex requirement where employees work in different shifts. Some are 9 hours long, others 11 hours. And they need to work on public holidays. In the event of “normal” work on a public holiday due to the shift planning employees get not only for each hour worked a payment of 1.5. But additionally gets the planned hours completly posted into a time off in lieu account – even if he has worked not the full shift but only 6 hours or even more than his shift.

For this requirement the “route” function is needed. How this is done is described here:

How to use the “route” function

Stay tuned, more to come in future

Volker Ruof

EC Time Product Management

Assigned Tags

      8 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo VijeyAananth SR
      VijeyAananth SR

      Hi VR,

      Thanks for the info, We have a similar scenario but I am unable to post the counted events to TOIL time group. I get an error "If the input time type groups have the time category "Counted Events", choose a time type group above or below with the time category "Counted Events". So as per our blog multiplying counter value and posting it to the TOIL account is prevented.

      Is there some upgrade later preventing this? what could be the alternative approach in this case.

      Thanks,

      Vj

      Author's profile photo Volker Ruof
      Volker Ruof
      Blog Post Author

      Hello Vijey,

      looks as if your configuration is wrong.

      Can you check that you have got 2 time type groups configured as "counted events" as described above? Looks as if you got only 1 set up as counted events.

      There was no upgrade change and the config above still works.

      Best regards

      Volker

      Author's profile photo Shilpa Thippamma Thimmacharlu
      Shilpa Thippamma Thimmacharlu

      Hello Volker Ruof,

      Can we configure above time valuations into a time recording profile and we would like to use Time account type AD HOC. We have requirement, if any employees works during weekend, regardless of his hours, 8 hours should be posted into Day in Lieu account and those 8 hours should be used a an absence within 15 days , if not used those should get lapsed. I am trying to implement below 2 functionalities,

      https://blogs.sap.com/2021/04/30/employee-central-time-off-multiple-time-off-in-lieu-toil-solution/

      https://blogs.sap.com/2018/08/01/ec-time-hints-and-tipps-nr.-6-how-to-post-a-fix-amount-of-hours-to-a-time-off-in-lieu-account/

       

      can you please confirm.

      Thanks

      Shilpa

       

      Author's profile photo Volker Ruof
      Volker Ruof
      Blog Post Author

      Hello Shilpa,

      yes, you need to combine mine and Parthibans approach.

      But keep in mind that it is not possible with the integration center to read the time account flag "posting only upon time sheet approval". So, even if the time sheet is not yet approved the posting is created. If the time sheet is rejected and the employee changes his recorded data then there is of course a recalculation.

      Best regards

      Volker

      Author's profile photo Shilpa Thippamma Thimmacharlu
      Shilpa Thippamma Thimmacharlu

      Hello Volker Ruof,

      Thanks for your quick reply.

      I have created above time valuations and added to time recording profile. I have assigned Time Recording profile and Time profile for an employee. I have used Ad HOC Time account, hence this account can not be added  in Time profile Time Account Type for Time Off in Lieu.

      For testing, While i was entering some OT hours, i am getting error ''Sorry, we couldn’t save the time sheet. See the reason below and if necessary try again. No time account type for time off in lieu is defined in time profile UKTIME''

      Can you let me know reason for this error ?

      Thanks

      Shilpa

      Author's profile photo Volker Ruof
      Volker Ruof
      Blog Post Author

      Hello Shilpa,

      sorry, but I cannot judge based on a few sentences. I guess that you have used a time type group with valuation factor "overtime premium". This of course requires a toil account in the time profile - cause this is the standard way how this works to post hours to a toil account.

      But if you use the alternative approach with the integration center cause you cannot use just 1 toil account then of course this mechanism does not work.

      So, proposal: try first to configure the ad hoc time account overtime account usage as described in Parthibans blog. Test it. If successfull then in a second step adjust your time valuations in a way that a fix value gets posted. I think the only thing you need to do is to create as a fix value to be posted a time type group other than with valuation factor "overtime premium". Check what Parthiban has used in his blog. And this is the timetype group you need to read in integration center.

      You cannot just copy what is written in both blogs and expect that the result gets automatically mixed, you have to adjust the approaches a bit. But I cannot give you a blueprint of what you have to configure, this extra effort needs to come from you.

      Best regards

      Volker

       

      Author's profile photo Samprada Iyer
      Samprada Iyer

      Hello Volker,

      Thank you for the detailed Blog, It helps us a lot!

      Can you pls help me with the below,

      we have a time type called "On call Onsite"

      Now i would like to add fixed 2 hours in the working time balance of the time type "Oncall Onsite" when the employee records 8 hours or 5 hours (Pls consider this an example)

      For eg- If the employee records time 8am-12pm i.e 4 hours on the time type "Oncall Onsite" and has worked for 40 hours in week, In time summary or the working time balance only 2 hours needs to be added, i.e 40+2=42 , we do not want 40+4=44 hours visible in the working time balance and time summary.

      is this possible ?

      If yes, can you pls help me with an example of the same.

      I am not able to develop the logic how to use time valuation with the same , any help would be appreciated.

      Regards,

      Samprada

      Author's profile photo Volker Ruof
      Volker Ruof
      Blog Post Author

      Hello Samprada,

      please understand that I cannot give a complete solution proposal on this - else I would get flodded with queries like this.

      But let me say that this is possible.

      You need to use the working time account calculation logic (see my other blogs on this) and not include into this the attendance type "oncall onsite". Then you need to use the "route" time valuation method (this acts like an if-statement) to check if an attendance type "oncall onsite" exists in the week.

      If so, you then use the above mentioned new valuation type with which you can add fix 2 hours to the time type group that fills the working time account. If this is not possible (cause you use only duration based employees and this new valuation type has currently the limitation to be applied only for clock time recorders) use my workaround as described in my early blog "how to post a fix amount of hours".

      Hope this ideas help.

      Best regards

      Volker