cancel
Showing results for 
Search instead for 
Did you mean: 

Time PCR to calculate number of days in a month excluding sundays

Former Member
0 Kudos

Hi All,

Below is my requirement:

For each month employee is eligible for maximum of 1.5 days of quota. but, this 1.5 days should be accrued on daily basis except sundays. also, this 1.5 days would be divided by number of days in a month except sunday

for example, March 2014 has 31 days out of which we have 5 Sundays . so, 31-5 = 26 days. Hence, 1.5/26 = 0.05769 days would be accrued each day for each employee except sundays (no quota should be accured if it is sunday)

Similarly, for May 2014 it would be 31-4 = 27 . so, 1.5/27 = 0.05555 days would be accrued each day for each employee

Could you please advise how to write a PCR for the above requirement, can we calculate number of days in a month excluding Sundays..?

Thanks in advance!

BR,

Prem

(Prassu4u2003@yahoo.co.in)

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Prem,

Our Scenario is also based on number of working days employee will get the pl Quota ,but our case is if the weekoff also need to generate the quota ,but if employee has taken leave then that day need to be excluded ,but my strong recommendation is discuss with client explain him the difficulty in this scenario,and consider all the weekoffs to exclude because as per my understanding it should not possible to exculde only sunday .

Former Member
0 Kudos

Hi Anusha,

Yeah,i spoke to them but its their business requirement.previously they were doing mass upload via LSMW. now, they want to do via time evaluation. anyways, will speak to them about this again. meanwhile, if you find something similar to this that would be great.. if (at all) i find a solution  i will share that with you..

Thank You!

former_member193652
Active Contributor
0 Kudos

Hi Prem,

I also support Harish reply. You can spot if the day is Sunday or not. Just to know the last day determination is related to feature LDAYW (Determine last day of a week). Check it out through PE03.

As you know time evaluation is a day to day activity so you need to count how many sundays do you have in a period. As Haris mentioned you can change your client mind to accrued quota end of period(month) you will have number of working days and simply can calculate the quota amount. Otherwise I recommend to write your own function, maybe by ABAP, to count number of working days and call it at first day of each period(month).

Regards,

Omid

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Prem,

I understand that each client is different but see if you can convince client that by doing accrual at the end of beginning of the month will allow for a cleaner implementation. Any changes down the line are easier to maintain in standard configuration rather than PCR and complex rules. See if they buy into that .

If they agree with monthly accrual then you can use the standard configuration by using 1.5 days as your base entitlement and accruals set to end of the month or beginning of the month depending on when the client wans this 1.5 days to be transferred to IT2006.

OR

Another option could be but I don't recommend this unless you client does not want to change the accrual method...Use IT2012...and just load a transfer specification for all eligible employees with number of days in each month excluding sundays...so for 2014 you will have 12 entries per employee...each entry loaded for 01/01 of each month...

then in your PCR...on the first day of the month...you calculate the accrual...by dividing 1.5 by number of days from IT2012...store this in a monthly period balance...then all you have to do is...check each day...if its Mon - Sat...assign this value in your period balance to a daily balance which is tied to your base entitlement...do nothing if its a sunday...

harishtk1
Active Contributor
0 Kudos

Reddy MK wrote:

OR

Another option could be but I don't recommend this unless you client does not want to change the accrual method...Use IT2012...and just load a transfer specification for all eligible employees with number of days in each month excluding sundays...so for 2014 you will have 12 entries per employee...each entry loaded for 01/01 of each month...

then in your PCR...on the first day of the month...you calculate the accrual...by dividing 1.5 by number of days from IT2012...store this in a monthly period balance...then all you have to do is...check each day...if its Mon - Sat...assign this value in your period balance to a daily balance which is tied to your base entitlement...do nothing if its a sunday...

Well, if you want to go with this option, an alternative would be to have 12 constants created and loaded in T511K with the number of sundays in each month, This will be an annual config activity that would be needed once a year, instead of loading 12 records every year for each and every employee in the system.

or could just use an arbitrary value of 4 Sundays or something,

I simply do not understand the logic of this requirement, unless the employee is permitted to take time off in multiples of 0.06...It is better to either grant it in advance, or if you want to prorate based on actual days worked, grant it at the end of the period.

harishtk1
Active Contributor
0 Kudos

You can determine whether a day is Sat or Sun using VARSTRDYWW

This queries the relative day of the working week, and the working week is frmo Monday to Sunday, typically. so Saturday adn Sunday will be 06 and 07 respectively.

Why do you want accrue a fraction of 1.5 every working day? is it not enough to accrue 1.5 days at the end of the month - at this point you would already know how many Sundays have elapsed?

What is the benefit if  employee accrues 0.06 days on any given day?

Former Member
0 Kudos

Hi Prem ,

I have already worked with the same scenario , for this scenario only pcr will n give you the exact result,i have small doubt u have mentions no quota generation on weekly off and what about the public holidays and Leaves like if employee taken leave for 10 days ,will those days will be considered for the quota ,clarify these doubts ,based on that  i will give you the solution .

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Prem,

If employee is having weekoff on saturday and sunday based on your requirement ,it should calculate quota for saturday and not for sunday is it correct ,but my question is the system dont know whether it is sunday or saturday or any other day ,it only knows whether planned working hours are zero or not ,please clarify this doubt ,because if planned working hours are zero on saturday and sunday how can we exclude only sunday .please clarify this .

Former Member
0 Kudos

Hi Anusha,

You are correct, we can differentiate based on planned working hours whether its working day or not. but, client has this weird requirement that they need to exclude only Sundays even though Saturday they have off..am stuck up because of that. request you to let me know your scenario & solution.. let me see if i can pick something up from that...

Thanks,
Prem

sai_siva
Active Participant
0 Kudos

Hi Prasad,

Why are specifically looking for PCR??

The same can be done through Generation/Base entitlement rule also.

Sai