Skip to Content

How to Calculate actual working days(Calendar days - Week off - Public holiday)

Hello Experts,

I have scenario where i need to calculate only actual working days/ business days

Calendar days - (Weekends + Public holidays)

Eg : 365 days - ( 104 week-off + 9 public holidays) = 252 working days.

Add comment
10|10000 characters needed characters exceeded

  • Thank you for the reply, it shall be very helpful when i shall apply this logic in PCR, but at present do we have any standar way to generate this value, as this value is required by SD and PS module in my project.

  • Get RSS Feed

3 Answers

  • Best Answer
    Aug 24, 2017 at 04:38 PM

    In a Time Evaluation PCR, you can query on the Day of the Week (VARSTWEDAY), on the Holiday Class (VARSTHOLCL), and on the Daily Work Schedule (VARSTDAYPG) in order to identify if "Today" should be counted as a "Working Day/Business Day". In the affirmative, you could generate a Time Type (such as 9WKD) with HRS=1.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 24, 2017 at 03:33 PM

    Are you wanting to query this in a PCR? And are you wanting to know the amount for the full year? If so my suggestion would be to have three constants:

    Constant one (ZCON1) - The number of days in the calendar year to take into account leap years.

    Constant two (ZCON2) - The number of days that fall on a weekend within each calendar year.

    Constant three (ZCON3) - The number of public holidays that fall within the calendar year.

    All of the above will vary year on year but as you know, you can build that into each constant.

    The calculation in your PCR should read:

    HRS=CZCON1

    HRS-CZCON2

    HRS-CZCON3

    You could then add the resulting value into a time type.

    The only negative with the above solution is that you will have to update your constants year on year, personally I would create a few years in advance. However, the plus point is that because constants are driven by date, your calculation will work at every point in the year.

    Hope this helps if it is indeed what you meant.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 07, 2017 at 01:00 PM

    Hello Experts,

    I was able to get results from PT64, and with few abap help we achieved at final output.

    Thank you for help!

    Add comment
    10|10000 characters needed characters exceeded