Skip to Content
avatar image
Former Member

calc time difference using factory calendar between 2 dates and time

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Jan 16, 2012 at 07:18 PM

    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

    Add comment
    10|10000 characters needed characters exceeded