cancel
Showing results for 
Search instead for 
Did you mean: 

Calculation of overtime on weekly basis

Former Member
0 Kudos

Current Scenario:

Currently the system is calculating overtime but this is on daily basis , and transferring the extra hours to time type . Now after that it is going to the Overtime quota on daily basis  .

Requirement :

Basically the requirement is to transfer the overtime on weekly basis . Let me explain with a example:

Currently if the planned working hours say 8 hours and employee recorded 10 hours then 2 hours is added to the overtime quota .

We need to make this calculation weekly, if the weekly planned working time is 40 hours and the employee worked for 48 hours then 8 hours would be overtime .

In my current scenario :

MondayTuesdayWednesdayThursdayFridaySaturdaySunday
Planned working time8888800
Employee recorded working hour410108800
Overtime22

My requirement is that for the above example the total planned working time sis 40 hours and the employee recorded 40 hours so there should not be any overtime recorded.

I suppose this cannot be done by customization ( if any please advice )

I understand that we need a PCR to first calculate the difference between weekly time sheet recorded and the weekly planned working time . Please advice on this grounds how can we proceed .

Accepted Solutions (1)

Accepted Solutions (1)

vianshu
Active Contributor
0 Kudos

Hi Debabrata,

SAP provides standard solution for this in schema TM04 for weekly overtime.

Kindly go through that and modify accordingly.

Thanks and regards,

Vivek Barnwal

leelamohan_kavali
Active Contributor
0 Kudos

Dear Debabrata,


Yes I agreed with Vivek, If you look in TW00 schema there is a one sub schema's

000040 ACTIO TW30                  Update weekly overtime hours

And check with PCR TW31.

Ur's Mohan

Former Member
0 Kudos

Hi Vivek ,

Thanks for the information . I am working on it . I will update on my status after I have implemented .

Regards ,

Deb

Sanky
Active Contributor
0 Kudos

Hi Deb,

If your query is answered then close the thread.

Regards,

Sankarsan

Answers (2)

Answers (2)

vianshu
Active Contributor
0 Kudos

Are you in positive time management or negative management? What is considered as start and end of the week? Is it at time level?

Thanks and regards,

Vivek Barnwal

Former Member
0 Kudos

Hi Vivek ,

We are working on positive time management

Hi Sankarsan ,

I have implemented as per your suggestion ,but i have one question , I have put the ZOTQ block in the overtime calculation block already exsisting , because there are few other checks for overtime before that . Hope this wont be a problem because i have put it before CUMBT .

I am asking this question because system is not generating any overtime in time evaluation now .

Regards,Deb

Sanky
Active Contributor
0 Kudos

Hi Deb,

I have given you the picture for your requirement. So you can add more into it.

Check that all scenarios are working correctly or not?

Regards,

Sankarsan

Former Member
0 Kudos

Hi Sankarsan ,

After lots of analysis i have found that only the PCR that is attached in the thread needs to be changed for calculating ovetime weekly .

Currently it is calculating daily , and we need to make some modification somewhere in the PCR attached above and this would give us the exact weekly data.

Hi Experts ,

Would you help me in suggesting a relevent change necessary in accordance of the PCR attached above .

Regards ,

Deb

Sanky
Active Contributor
0 Kudos

Hi,

Have you checked?

Regards,

Sankarsan

Former Member
0 Kudos

Hi,

I tried but the current schema is very complex, and hence adding the configuration suggested by you resulted in no update of quotas at all . May be because of the other custom PCRs . So I have asked if we can just change the existing overtime PCR and convert it from daily to weekly

Regards,
Deb

Sanky
Active Contributor
0 Kudos

Hi Deb,

I have tested in my system and it's working fine as per scenario.

Find the attached PCR and kindly do the changes.

Schema details about this above PCR insertion.

Now create Week day=7 pcr and quota updation pcr.

Schema details

Now testing:-

Planned working time 8.5 hours(09:00 am to 17:30pm) and employess has worked daily 9 am to 19:00 pm and where sunday os weekly off.

From 1st Sept2014 to 07th Sept 2014 employee's total working hours (6*10)= 60 hours and total Planned working hours for week (6*8.5)=51 hours. So 8.5 hours will be moved to quota and rest 0.5 will add to actula working hours of next week details.

On 6th September 2014, cumulate hours details of SALDO table.

On 7th September 2014, day quota updated in Ttyp9999 and this will link with absence quota.

Remaining 0.5hours will add to Ttyp 9998 to next week.

Hope so you got it and it will work definitly.

Regards,

Sankarsan

Sanky
Active Contributor
0 Kudos

Hi Deb,

Do littlebit modification of  ZUTQ as per below.

Regards,

Sankarsan

Sanky
Active Contributor
0 Kudos

Hi Deb,

Have you checked?...

If it's working then close the thread marking correct answer.

Regards,

Sankarsan

Former Member
0 Kudos

Hi Sankarsan ,

I am very thankful for your help .

I did implement as you said, but the problem is that your PCR are calculating for monthly again  . When i check the time type for accumulated  planned working time for the entire month it came to 1 month total  which should rather be only for the week .

I guess the PCR ZUTQ has ADDMBXXXX , which I suspect is the problem .

My requirement is as follows :

Take any week : 01.09.2014  to 07.09.2014

01.09.2014    =  8(planned)       4 (Actual)

02.09.2014    =  8(planned )     10(Actual )

03.09.2014    =  8(planned )     10(Actual )

04.09.2014    =  8(planned )      8 (Actual )

05.09.2014    =  8(planned )      8 (Actual )

06.09.2014    =  0(planned )      0 (Actual )

07.09.2014    =  0(planned )      0 (Actual )

Total planned = 40

Total Actual = 40

Overtime =0

Take any week : 08.09.2014  to 14.09.2014

01.09.2014    =  8(planned)       8 (Actual)

02.09.2014    =  8(planned )     10(Actual )

03.09.2014    =  8(planned )     10(Actual )

04.09.2014    =  8(planned )      8 (Actual )

05.09.2014    =  8(planned )      8 (Actual )

06.09.2014    =  0(planned )      0 (Actual )

07.09.2014    =  0(planned )      0 (Actual )

Total planned = 40

Total Actual = 44

Overtime =4

Accordingly :

I would need 3 time types as below :

One time-type should find out total planned hours : say 9996 ( weekly )

One time-type should find out total actual hours :  say 9997 ( weekly )

One time- type should find difference  planned hours - actual : say 9998  ( weekly )

Now this time type 9998 should update to quota type :

For next week the value for all the above time types should start with zero .

If you can help me with 3 PCR;s to perform the above operation , it would be very great !

Hope I am clear now .

Regards ,

Deb

Sanky
Active Contributor
0 Kudos

Hi Deb,

PCR ZUTQ will be active only when week day equal to 7 and have you written the ZWEK pcr with IF ENDIF condition.

I am taking your time type to make the clarification again.

Suppose for the second week on 7th day Time type 9996= 40 hours ; Time Type 9997= 44hours

and difference is 4hours. This four hours are not equal to dws planned working time so we will not update Time Type 9998 with 8 else make zero to Time Type 9996 and replacing time type 9997=4hours which will be added with next week deatils actual work hours.

Hope so you understand the logic flow.

You can go through my below document 

Any query ask me.

Regards,

Sankarsan

Sanky
Active Contributor
0 Kudos

Hi,

This weekly hours is fixed or employee can be on saturday and sunday then what will be?

Regards,

Sankarsan

Former Member
0 Kudos

Hi Sankarsan ,

Thanks for your quick reply . The weekly planned working hours are fixed , but employee can record time on Saturday and sunday as well and this would be considered as overtime .

Basically is it always weekly ( planned - actual ) = overtime (weekly) 

Regards,

Deb

Former Member
0 Kudos

Hi

In current system how you are calc. daily Over time, is it through PCR or any other process.

Former Member
0 Kudos

Hi ,

It is through PCR which is calculating Daily .

Regards,

Deb

Sanky
Active Contributor
0 Kudos

Hi Deb,

Tell me another thing that cross monthly week is there then how you will calculate?

Suppose Sept2014 to Oct2014

Mon       Tue       Wed      Thu        Fri       Sat     Sun

29/09     30/09    1/10       2/10       3/10     4/10   5/10

Regards,

Sankarsan

Former Member
0 Kudos

Hi Sankarsan ,

That would be considered as week 40 i suppose  in the calculation.

Regards,

Deb

Sanky
Active Contributor
0 Kudos

Hi Deb,

Try to design your PCR like below.

1. Create three time type.

a) 1st Time type:-Will store the daily planned working hours and cumulate upto day's 7. for this day balance, month balance, transfer prev period are 1.(XXXX)

b) 2nd Time Type:- Will store the daily actual working hours and cumulate upto day's 7. for this day balance, month balance, transfer prev period are 1.(YYYY)

c) 3rd Time Type:- Will store the Actual-Planned hours and it's assigned with your absence quota type. For this time type only day balance would be 1.(ZZZZ)

Now write below PCR and insert after P2011.

ZTST

*

****

     COLOP *

     HRS=PNUM

     ADDDB YYYY

     ADDMB YYYY

Use this PCR with PTIP function.

ZPLN

*

****

     HRS=IDHRS

     ADDDB XXXX

     ADDMB XXXX

User this PCR with ACTIO and insert just after the above PCR.

ZWEK

*

****

     VARSTLWDY7

             Y

               SCOND=T  IF

             N

                SCOND=F IF

Insert this just before the CUMBT function in time schema.

IF  ZWEK

after this write insert the below PCR with ACTIO function.

ZOTQ

*

****

     HRS=MYYYY

     HRS-MXXXX

     HRS?0

          *

           Leave

           >

          HRS=R

          ADDDB ZZZZ

          HRS=0

          ADDDBXXXXZ

          ADDMBYYYYZ

and insert ENDIF after this PCR in time schema.

Check and tell me.

Regards,

Sankarsan