Skip to Content
avatar image
Former Member

Time PCR to get number of days from Monday to Friday till the end of the year

HI there!

I have the following requirement,

We maintain date type 01 "Technical date for holidays" in IT0041 "Date specifications" to calculate the number of holiday days the employee is entitle to, which are granted at the beginning of the year or as soon as the employee is hired.

If date type 01 is ≥ 01.07, a proportional holiday calculation will be made, assigning a day of holiday every 20 worked days, considering as worked days the days from Monday to Friday from the date type 01 until the 31st of December of the same year.

Since we don´t evaluate in the future, how can I get from the date type 01 the number of days from Monday to Friday till the end of the year?

Thank you so much for your help!

Cheers!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Mar 10, 2017 at 04:40 PM

    Hi,

    If I understand your question correctly you could use the following solution. This is assuming that you are evaluating the same date that is held in date type 01 in IT0041.

    • Create a PCR and query the how many days are left in the current time evaluation period (month) by using operation HRS=YXED, add this value into a new time type.
    • Now query the month by using operation HRS=BCURMO, depending on the month being evaluated you can add the number of days left in the year from the next month into the same time type. You can do this by creating 3 constants (T511K) which hold the number of months that contain either 28, 30 or 31 days. Note that my constant for 28 days takes leap years into account.pcr-page-001.jpgpcr-page-002.jpgpcr-page-003.jpgt511k.jpg
    • Divide the value by 7 and then multiply by 5 to give you the amount of M-F left in the year. If you don't want to include the current week then apply a rounding rule to the value held in your time type. Create or use a rule that rounds down to the nearest whole number.

    I have included the configuration required as attachments in this reply.

    Add comment
    10|10000 characters needed characters exceeded