cancel
Showing results for 
Search instead for 
Did you mean: 

how to set delay hours or minutes to zero if calculated overtime covers detected delay?

anafea
Explorer
0 Kudos
850

I created time valuation to calculate late comer and overtime for example

Scheduled working time is 08:00 am to 05:00

if entered time event: In 09:00 am and Out is 07:00 pm the system will calculate 1 hour delay and 2 hour overtime

but customer want to if overtime hours cover delay time then calculate overtime to be 1 hour and set delay to 0

I tried to have solution but I couldn't .

please advise.

Accepted Solutions (0)

Answers (3)

Answers (3)

TB
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello anafea,

can you please check both Time Valuations (TV105, TV106) which route the Time Type Group TTG104? Can you test the result when TTG104 is used as Comparison Time Type Group in these Time Valuations?

The Time Type Group TTG104 needs to be used as Input Time Type Group and Comparison Time Type Group in these Time Valuations.

Best Regards,

Timo

anafea
Explorer
0 Kudos

Hello timo.biedenbender

Thanks.

I tried your solution it working to fix last test case I sent to you but I tried other test cases and it fail.

sorry may I didn't explain full scenario which is

1. scheduled working time 08:00 am to 05:00 pm

2. I did time valuation to get late comer, early leave and overtime and it calculate correctly for many test cases.

3. the client asked to calculate overtime after deduct any late comer or early leave (if exist) which mean employee can work flextime

the main issue that in SAP time valuation there is no valuation type to get number of hours/minutes worked before scheduled start time per day I can get but as full week. And after trying more time valuations (equations) with your help and support I asked the question

https://answers.sap.com/questions/14028525/how-to-get-early-hours-or-minutes-before-scheduled.html

Thanks again for your help and support.

TB
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello anafea,

Sorry that I ask again for details of this requirement. I would like to understand it in detail, so that I'm able to help.

Can you please describe in detail the other test cases you mentioned? Maybe, you can add screenshots from trace for them.

I'll answer your question about the main issue there. I assume it should be possible to determine recorded working time before the scheduled working time.

Best Regards,

Timo

anafea
Explorer
0 Kudos

Hello timo.biedenbender

Thanks for Your patience.

requirement details:

the Scheduled working time is: Start: 08:00 AM End: 05:00 PM

Employee can come before/after start time can leave before/after end time (2 hours)

Overtime will be calculated for early or late hours more than scheduled hours after deduct any delay or early leave

anafea
Explorer
0 Kudos

Trace for No.8 TV106 not exist

TB
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello anafea,

In relation to case 8, is it expected behaviour that 1 hour of potential overtime (07:00 AM 08:00 AM) and 2 hours of early leaving (03:00 PM - 05:00 PM) results in 1 hour of real "undertime" (delay time)?

After I analyzed case 8 using your screenshots from the trace, it seems that TV104, TV105, and TV106 are correct. This is the part of the configuration, which I described.

I think, that the value of the Input Time Type Group SAR Overtime Base (TTG013) causes the issue. TV015 would need to be analyzed to verify whether TTG013 calculation is right. This Time Type Group is used in TV104 as Input Time Type Group and, in my opinion, causes the issue.

Do note that a comprehensive understanding of the requirement and your Time Recording Profile would be required to describe the necessary changes. With both, I'm not familiar.

But taking into account my current knowledge of your configuration, it appears that the Time Type Group “Find First Gap...” might need to be removed from TV015 as an Input Time Type Group. When you remove this Time Type Group from the Time Valuation TV015, please be aware, that there could be negative side effects to other Time Valuations when they use the Time Type Group TTG013 as well.

The part "(2 hours)" of your sentence "Employee can come before/after start time and leave before/after end time (2 hours)" is slightly unclear. Does this mean, that only up to two hours must be considered as overtime/delay time? Or does this mean, that only two hours before/after start of scheduled working time and two hours before/after end of scheduled working time must be considered. If one of both conjectures is true, your configuration might not handle this situation accurately.

Best Regards,

Timo

anafea
Explorer
0 Kudos

Hello timo.biedenbender

Regarding to SAR Overtime Base (TTG013) You are right and I fixed it but I'm facing the issue that I can not calculate shortage hours (delay or early leave) between working hours and scheduled hours number per day (as employee can start before/after scheduled start time and leave before/after end time which mean I compare recorded hours with number of scheduled hours = 9 )

For The part "(2 hours)" of your sentence it's mean flextime for 2 hours but it may be more or less.

Regards,

TB
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello anafea,

Thanks a lot for your message.

I tested the described case with my configuration. For instance, on days with overtime 1 hour and delay time 0 hours, I get calculated 1 hour overtime and 0 hours delay.

Can you please check your configuration with help of the following Time Recording Profile Visualization?

Best Regards,

Timo

anafea
Explorer
0 Kudos

Hello timo.biedenbender

Thanks a lot for your time and support

Could you please check below case

Scheduled working time is 08:00 am to 05:00

if entered time event: In 07:30 am and Out is 05:00 pm the system should calculate 0 hour delay and 0:30 hour overtime but as shown in screenshots (as per your instruction system calculate -0:30 Delay and 0:30 OT)

please advise

TB
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Ahmed,

It's certainly possible to meet the described requirement with the following configuration. Results of my tests are promising.

Here are the assumptions for this solution:

  • Real Overtime must be calculated by subtracting delay from Overtime. A positive difference indicates remaining Overtime. A negative difference indicates Delay time.
  • Delay time is already calculated on a daily basis and is used as potential Delay in the configuration. The calculation is not described as part of this configuration.
  • Similarly, Overtime is also calculated daily and is used as potential Overtime. The calculation is not described as part of this configuration.

These assumptions are important to consider before implementing the suggested solution. Each organization might have slight variations in how they handle overtime and delay, so adjust the solution as necessary to fit your situation.

The solution looks like this

  • First, calculate the difference using the valuation type 'Difference Between Threshold and Input'. If Overtime is more than Delay, your result will be positive. If Delay is more, your result will be negative.
  • Next, if your calculated difference is less than 0 (indicating more delay), route this potential Delay to a separate Time Type Group as Time Type Group Below, using 'Compare Threshold with Comparison Group to Route Input'. Remember to set up the Input Time Type Group with Reverse Sign since the difference is negative.
  • If your calculated difference is more than 0 (indicating more Overtime), route this potential Overtime to a separate Time Type Group as Time Type Group Above. Use the same valuation type as above: 'Compare Threshold with Comparison Group to Route Input'.

With this setup, either the Time Type Group for real Delay or the real Overtime will be filled.

The different valuation types are described in more detail here: https://blogs.sap.com/2022/10/20/how-to-setup-time-evaluation-in-time-tracking/

I hope this helps! Let me know if you have any more questions.

Best Regards,

Timo

anafea
Explorer
0 Kudos

Hello timo.biedenbender

Thanks for your support

I applied your solution it works fine but in case there is Delay with value 0 and Overtime with any value result will be delay same as overtime.

"Next, if your calculated difference is less than 0 (indicating more delay), route this potential Delay to a separate Time Type Group as Time Type Group Below, using 'Compare Threshold with Comparison Group to Route Input'. Remember to set up the Input Time Type Group with Reverse Sign since the difference is negative.""