Skip to Content
author's profile photo Former Member
Former Member

Calculate the time between different timestamps using factory calender.

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on May 16, 2014 at 01:42 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.