cancel
Showing results for 
Search instead for 
Did you mean: 

Night shift , Half day leave calculation

former_member197828
Participant
0 Kudos

Hi Experts..!!

I need one help.

Actually , Employee is working in night shift from 22:30 to 06:30  on , 13:04:2014 .

Previous day indicator is checked in R/3 .

This is the work schedule of an employee:

Now employee is willing to take half day leave :

So i am giving from date 13:04:2014 and to date 13:04:2014.

Time from 22:30 to 02:30 . But it is not getting the correct  hours  , It is taking full hours.

which is not correct.





Please help me how to resolve this issue.

Its Urgent , please help.

Thanks & Regards:

Gaurav Singh

Accepted Solutions (1)

Accepted Solutions (1)

harsha_jalakam
Active Contributor
0 Kudos

Hi Gaurav,

The difference of Start time and end time, in case of shifts/normal hours  can be calculated by this way.

First by converting the time into minutes and then into hours.

IF ( lv_start_time > lv_end_time ).

       lv_min = ( lv_end_time+0(2) - lv_start_time+0(2) ) * 60 + ( lv_end_time+2(2) - lv_start_time+2(2) ) .
       lv_hrs = lv_min / 60.
       DATA lv_hrs1 TYPE stdaz.
       lv_hrs1 = 24 + lv_hrs.
   ELSEIF ( lv_start_time < lv_end_time ).
       lv_min = ( lv_end_time+0(2) - lv_start_time+0(2) ) * 60 + ( lv_end_time+2(2) - lv_start_time+2(2) ) .
       lv_hrs = lv_min / 60.
   ELSEIF ( lv_start_time = lv_end_time AND lv_end_time = 0 ).
       lv_hrs = 0.
   ELSEIF ( lv_start_time = lv_end_time ).
       lv_hrs = 24.
     ENDIF.



If the application you have shown above is a standard one, you need to check the work schedules are maintained correct or not. Or else if it is custom one, then difference can be calculated with the above logic.


Regards,

Harsha


former_member197828
Participant
0 Kudos

HI Harsha,

Thanks for reply .

This is standard application , so how can we put this logic.

Secondary , the work schedules are fine because when i am  trying to create absence in 2001

for the same work schedule  , it is getting created successfully.

Answers (1)

Answers (1)

former_member197475
Active Contributor
0 Kudos

Hi Gauran,

Have you did the configuratoin for half day leave??? Check the  below threads.

BR,

RAM.