cancel
Showing results for 
Search instead for 
Did you mean: 

Date/Time difference based on working days

Former Member

Hi Guru's,

I am having a problem getting the difference between two timestamps. A normal difference between 2 timestamps is possible however i would like to calculate the hour difference between 2 timestamps excluding public holidays, weekends and also after office hours. Is there a series of FM or a logic to extract this kind of info. Hope you guys can shed some light into the matter.

Thanks in advance.

Anand

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

hi

based on your factory id and calendar, you can get the total no. of working days between two dates (this excludes public holidays maintained in your factory calendar and weekends), use this fm 'RKE_SELECT_FACTDAYS_FOR_PERIOD'...after this you could use any fm to calculate the time stamp difference.

if helpful, reward

Sathish. R

Former Member
0 Kudos

Hi,

Use FM DATE_COMPUTE_DAY. DATE in MM/DD/YYYY format.

This FM returns the date in form of weekday number ie the date which you give is tuesday then it will return 2.

Give call log date and call handled date.

eg A call is logded on tuesday 3.00 pm and handled on Thursday 10.a.m.

First check the days difference from the return of this FM.

IF the call handled date return - call loged date return is positive means no sat sun , if negative means sat and sun.

then from call logged date time start counting the office hours till call handled time.

Office hours can be easily calculated using 24 hours clock.

For public holidays have to check whether between the twodates any public holiday if is there then subtract that much office hours.

Hope this helps.

Thanks,

Niketa

Former Member
0 Kudos

Hi Jothi,

That function module returns the difference literally without excluding weekend or after office hours. What is needed is the hour difference between two time stamps. For example a call was lodged on Friday 5:00 pm and it was handled Monday 10:00 am. So the difference in hours are 1 hour 30 minutes , considering working hours is 9:00 am to 5:30 pm, Monday to Friday.

Hope this clarifies.

Thanks.

Anand

Former Member
0 Kudos

Anand,

Did you get any FM to calculate this? I am working on a similar issue.

Thanks

Former Member
0 Kudos

Anand,

WElcome to SDN.

Use FM <b>CCU_TIMESTAMP_DIFFERENCE</b>

Rgds,

Jothi.P