cancel
Showing results for 
Search instead for 
Did you mean: 

Count weeks in a payroll period

paul_baldacchino
Explorer
0 Kudos

HI all,

How can I count weeks in a payroll period.

I want to know how many weeks are in

01.01.02015 - 31.01.2015

what operation or function do I use?

Regards

Paul

Accepted Solutions (0)

Answers (3)

Answers (3)

Sanky
Active Contributor
0 Kudos

Hi Paul,

If there have a integration in between payroll and time management then its easy to bring the no weeks value from time management  .

Now the week is keep varying by month to month and I don't think so there have any standard operation is available in payroll so its better go with custom function which will give you the required output.

Regards,SD

former_member193210
Active Contributor
0 Kudos

You could create a Constant in table view V_511K that would hold the number of weeks in a month, and query that constant in a pcr.

Example:

ZWKIMWeeks in month01.01.201531.01.20154,43
ZWKIMWeeks in month01.02.201528.02.20154,00
ZWKIMWeeks in month01.03.201531.03.20154,43
ZWKIMWeeks in month01.04.201530.04.20154,28
ZWKIMWeeks in month01.05.201531.05.20154,43
ZWKIMWeeks in month01.06.201530.06.20154,28
ZWKIMWeeks in month01.07.201531.07.20154,43
ZWKIMWeeks in monthand so on until 2020 or more

Note that if you require more decimals, you could use 428571.43 (instead of 4.43) and divide the value of Constant ZWKIM by the value of Constant GENAU (100000.00) in your PCR.

0 Kudos

You also write a rule. If you look at the documentation of the operation NUM, using t code PE04, you can verify the information for 6 place operand. From here you can go into 2nd Variant(highlighted). That will tell what to use to determine number of calendar days in a month using specification G. Using this you can store the number of days for the month in a variable and then divide that by 7 to determine number full weeks in a month. If you want to find out how many calendar weeks are in a month, that can be tricky but you can figure that out from here.

Using this you can also count how many Sunday's are in the month or Monday's in the month. Based on the counted days of each week day you can determine the number of calendar weeks.

antoine_foucault
Active Contributor
0 Kudos

Hi Paul:

Not sure you can achieve this using standard operation. I know you can use SETIN X=WW when processing ZL table but that would only fetch week number into your variable split.

Cheers,

Antoine