cancel
Showing results for 
Search instead for 
Did you mean: 

Calculate the time between different timestamps using factory calender.

Former Member
0 Kudos

Hello ,

I would like to calulate the time between two timestamp by considering factory calender in SLA percentage calculation .

Currently I am using below method,

    CALL METHOD cl_foev_time_func_brf=>difference_timestamp
      EXPORTING
        iv_timestamp_1 = lv_upd_ts
        iv_timestamp_2 = lv_now_ts
        iv_timezone_1  = 'CET'
        iv_timezone_2  = 'CET'
        iv_timeunit    = 'MINUTE'
        iv_fac_cal     = 'CH'
      IMPORTING
        ev_difference  = lv_diff.

It gives time difference without considering factory calender.

My factory calender configuration is right as i used it in other methods.

But in calculating difference, it gives actual difference between two time.

Please suggest to calculate the time between different timestamps using factory calender

Thanks in advance.

Thanks,

Vikas.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Vikas,

Use FM HOLIDAY_GET to get holidays between two dates based on calendar.Then find difference between two date as follows:

Correct diff = actual - holiday.

Also make use of the FM DATE_COMPUTE_DAY and have a look at this discussion to get the logic for excluding weekends.

https://scn.sap.com/thread/350710

Hope it helps you. Plz let us know if you face any issues.

Don't forget to mark helpful/correct if ma answer is useful.

Thanks,

Karthik