cancel
Showing results for 
Search instead for 
Did you mean: 

calc time difference using factory calendar between 2 dates and time

Former Member
0 Kudos

BW experts,

I need your suggestions in how to calculate number of hours between 2 dates and time according to factory calendars. Calc results should not include holiday hours and include only business days hours.

input1 - order creation date and time

input2 - shipping date and time

difference should include hours on business days..and exclude 48 hrs of weekend as well as any holidays.

Thanks,

Rita

Accepted Solutions (1)

Accepted Solutions (1)

former_member210615
Contributor
0 Kudos

hi,

you can use FM HOLIDAY_GET to get holidays between two provided dates and provided calender

and the you easily cal difference between two date minus holidays

also the below wiki might help you in writing coding better for holidays on weekends

http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP-ToGetnoofHolidaysfallinginweekendsforaparticularfiscalperiod

to calculate the difference b/w the dates you can use FM SALP_SM_CALC_TIME_DIFFERENCE to get the difference in seconds.

then divide the result by 3600 to get output in hours

hope it helps

regards

laksh

Former Member
0 Kudos

thanks a lot. this is very helpful.

lakshminarasimhan_n4
Active Contributor
0 Kudos

It helped us!!  Thanks 🙂

Answers (0)