‎2009 Sep 17 9:53 PM
Anyone know if there is a FM to calculate the Working Hours that exist between two dates.
For instance ...entire year may = 2080 working hours. User wants to know Working hours between
any two dates .... like.... July 1, 2007 and May 5, 2008.....
Thanks
MPersson
‎2009 Sep 17 10:14 PM
You can find the working days between two dates but unless you want to assume that someone worked for 8 hours for each work day, you cannot find the working hours. Of course, if you implemented HR and time entry in your SAP, then maybe.
‎2009 Sep 17 10:31 PM
Srinivas
Thank you for your response.
I dug around some more and found that I can use
FUNCTION 'HR_99S_INTERVAL_BETWEEN_DATES'
to calculate the number of weeks between dates.
I can then multiple the #of Weeks by 40 hrs.
That ends up working for me.
Thanks again.
MPersson
‎2009 Sep 17 10:34 PM
And if there are holidays? Or fractions of weeks??
Rob
Edited by: Rob Burbank on Sep 17, 2009 5:36 PM
‎2009 Sep 18 3:02 PM
Rob,
Thats a valid point. In my case I am only determining the total possible working hours for a budget report.
Prior to this, the supervisors were simply using a full year of 52 weeks x 40 hrs = 2080. This report takes
the hours captured on the CATS timesheet and processes them accordingly. So Holidays and any leave
time is identified within the program code and handled then.
Thanks
MPersson
‎2009 Sep 18 3:08 PM
But FM HR_99S_INTERVAL_BETWEEN_DATES gives the wrong number of weeks for fractions. If you use today's and tomorrow's dates, I think you'll find that it returns zero weeks. Is that what you want?
Try using days and multiply by eight instead.
Rob
Edited by: Rob Burbank on Sep 18, 2009 10:09 AM
‎2009 Sep 18 3:13 PM
Hi You can find calendar settings in country specfic settings this where you maintain holidays. Look for an FM which takes country or calendar id as input it is easy to calculate Weeks * 40 or Days * 8 for these results. It gets really easy if you HR on same box. You can take teh concept from following and build one yoru own will eb handy for future.
FIMA_DAY_CONVERT_TO_WORKINGDAY
‎2009 Sep 18 7:11 PM
Both of you have provided good solutions.
Looks like I'll have to code some revisions.
Thank you
MPersson