Holiday Calculation

Is it possible to take into consideration Holidays when doing a TimeStampDiff in reporting?

Hi,
No, you cannot take into consideration holidays unfortunately. You can do working/non-working days based on weekends. Run a search in the forum for working days and you'll find the threads.
Thanks
Oli @ Innoveer

Similar Messages

  • Java holiday calculation

    This must be Global Crossposting Day.

    If you're a good little crossposter, Majinda will come on his eight chickens and leave something for you.

  • Struts html:form vs form

    Hi,
    I'm trying to get form validation working in struts but am running into a bit of difficulty. I have a couple of questions:
    1) When an ActionError is returned - does the input form have to have used <html:form> tags for the errors to be shown. The reason i ask is because at the moment i am using the original <form> tags and when the request is returned to the input page there is just a blank page - i though this might be because i am not using the specialised struts html tags? This leads nicely on to my 2nd question... :o)
    2)Now the reason i am not using these tags is because when i try and create a form using these tags the text input areas/buttons etc do not appear - here is my code:
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <html:html>
      <head>
        <title>iQ Holiday Entitlement Calculator</title>
      </head>
      <body>
        <p><html:errors property="date"/></p>
        <html:form action="/iq/hr/holiday/calculate" name="calculatorForm" type="iq.hr.holiday.calculator.forms.CalculatorForm" >
          <table width="45%" border="0">
            <tr>
              <td>Day: <html:text property="day" /></td>
            </tr>
            <tr>
              <td>Month: <html:text property="month" /></td>
            </tr>
            <tr>
              <td>Year: <html:text property="year" /></td>
            </tr>
            <tr>
              <td colspan="2" align="center"><html:submit styleClass="button" value="Go"/></td>
            </tr>
          <table>
        </html:form>
      </body>
    </html:html>The text literals "Day:", "Month:", "Year:" appear but no text field with which to enter the text!
    I would very much appreciate any help anyone can offer!
    Many thanks

    <%@ page contentType="text/html; charset=iso-8859-1"
    language="java" import="java.sql.*" errorPage="" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld"
    prefix="html" %>
    <html:html>
    <head>
    <title>iQ Holiday Entitlement Calculator</title>
    </head>
    <body>
    <p><html:errors property="date"/></p>
    <html:form action="/iq/hr/holiday/calculate"
    te" name="calculatorForm"
    type="iq.hr.holiday.calculator.forms.CalculatorForm"
    >
    <table width="45%" border="0">
    <tr>
    <td>Day: <html:text property="day" /></td>...
    </tr>
    <table>
    </html:form>
    </body>
    </html:html>try:
    1.check your Action to see if the forward is ok (I think that your forward=... is not reachable if you have some errors)
    2.delete property="date" from <html:errors.../>
    3.close <table>tag
    4.delete <html:html> and </html:html> from your code
    5.maybe you have some errors in your and you have errorPage=""

  • SLA Calculation needed to exclude Holidays, Weekends and Off business hours

    Hello all,
    I am to create a function that will calculate the minutes between two dates for company work hours, excluding the weekends. 
    The function here from RSingh() is ideal for this purpose; however I am now asked to excluded company holidays also.
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/de4f7661-c702-4a10-ad06-3e28e4e0a83c/sla-calculation-help-needed-in-excluding-weekends-and-off-business-hours-for-calculation?forum=transactsql
    With a table called 'holidays' that contains holiday dates. I would hope to modify the function to exclude these.
    Please, how can this be accomplished? 

    My approach would be something like this
    Populate a calendar table that includes a work start and work end time for each day (none for weekends and holidays)
    SELECT *
    INTO #cal
    FROM (
        SELECT CAST('20140117' AS DATE) AS CalendarDate
            , CAST('20140117 09:00' AS DATETIME) WorkStart
            , CAST('20140117 17:00' AS DATETIME) AS WorkEnd
        UNION ALL
        SELECT CAST('20140118' AS DATE) AS CalendarDate
            , CAST(NULL AS DATETIME) WorkStart
            , CAST(NULL AS TIME) AS WorkEnd
        UNION ALL
        SELECT CAST('20140119' AS DATE) AS CalendarDate
            , CAST('20140119 09:00' AS DATETIME) WorkStart
            , CAST('20140119 17:00' AS DATETIME) AS WorkEnd
        UNION ALL
        SELECT CAST('20140120' AS DATE) AS CalendarDate
            , CAST(NULL AS DATETIME) WorkStart
            , CAST(NULL AS TIME) AS WorkEnd
        UNION ALL
        SELECT CAST('20140121' AS DATE) AS CalendarDate
            , CAST(NULL AS DATETIME) WorkStart
            , CAST(NULL AS TIME) AS WorkEnd
        UNION ALL
        SELECT CAST('20140122' AS DATE) AS CalendarDate
            , CAST('20140122 09:00' AS DATETIME) WorkStart
            , CAST('20140122 17:00' AS DATETIME) AS WorkEnd
        ) X
    Use a query something like the following to work out the number of minutes
    DECLARE @Start DATETIME = '20140117 13:00'
    DECLARE @End DATETIME = '20140122 17:00'
    SELECT SUM(diff)
    FROM (
    SELECT DATEDIFF(MINUTE, CASE WHEN CAST(@Start AS DATE) = CalendarDate
    AND @Start > WorkStart THEN @Start ELSE WorkStart END, CASE WHEN CAST(@End AS DATE) = CalendarDate
    AND @End < WorkEnd THEN @End ELSE WorkEnd END) AS diff
    FROM #cal
    WHERE CalendarDate BETWEEN CAST(@Start AS DATE)
    AND CAST(@End AS DATE)
    ) X
    Edit: Totally mucked up the example calendar table so I've changed it

  • Calculate Date/Time Difference in a Calculated Column Omitting Weekends, Holidays and Non-Working Hours

    I am looking for a formula to use in a calculated column that calculates the difference between two date/time fields while excluding weekends, holidays and non-working hours
    6/1/2010 9:43 AM - 6/7/2010 1:45 PM
    Here is the closest that I have gotten; however, this formula gives me a result of 96:
    =IF(AND((WEEKDAY([Resolved Date],2))<(WEEKDAY(Created,2)),((WEEKDAY(Created,2))-(WEEKDAY([Resolved Date],2)))>1),(((DATEDIF(Created,[Resolved Date],"D")))-(FLOOR((DATEDIF(Created,[Resolved Date],"D")+1)/7,1))-3),(((DATEDIF(Created,[Resolved Date],"D")))-(FLOOR((DATEDIF(Created,[Resolved
    Date],"D")+1)/7,1)*2))*24)
    Any and all assistance is greatly appreciated!

    I don't know how to exclude holidays but i exclude weekends(Sat&Sun)-
    IF(ISERROR(DATEDIF([Start Date],[End Date],”d”)),””,(DATEDIF([Start Date],[End Date],”d”))+1-INT(DATEDIF([Start Date],[End Date],”d”)/7)*2-IF((WEEKDAY([End Date])-WEEKDAY([Start
    Date]))<0,2,0)-IF(OR(AND(WEEKDAY([End Date])=7,WEEKDAY([Start Date])=7),AND(WEEKDAY([End Date])=1,WEEKDAY([Start Date])=1)),1,0)-IF(AND(WEEKDAY([Start Date])=1,(WEEKDAY([End Date])-WEEKDAY([Start Date]))>0),1,0)-IF(AND(NOT(WEEKDAY([Start Date])=7),WEEKDAY([End
    Date])=7),1,0))
    -Thanks
    Swapnil

  • Excluding holidays from interest calculation

    Hi All,
    Question:
    How to exclude the holidays from interest calculation (item interest calculation)?
    Situation in details:
    I have configured the Item interest calculation in SAP. Using the transaction FINT and FINTSHOW interest is calculated and interest invoices are posted as required. Everything works fine... BUT! Now I have to exclude the holidays from interest calculation.
    In configuration ( Interest Calculation Global Settings -> Prepare Item Interest Calculation ) I have selected the "Factory Calendar ID" but it doesn't help. I have also checked the calendar - all public holidays for 2009 and 2010 are defined there, however interest calculation still doesn't exclude these days.
    Any ideas? Should I do any additional config. somewhere else?
    Need your help!
    Regards,
    Vlad

    Hi Vlad,
    Unfortunately there is no standard way to do this in SAP (ie via configuration or any particular setting).
    You will have to customize the function module behind FINT that uses the calendar and skip holidays when processing.
    Regds;

  • Need Help Calculating Business Days AND omitting Holidays...

    Post Author: dkotenoglou
    CA Forum: Formula
    Thanks to the people here I was able to get a nice formula to help me calculate the amount of business days between two days.//Crystal syntax
    Local DateTimeVar d1 := ;
    Local DateTimeVar d2 := ;
    DateDiff ("d", d1, d2) -
         DateDiff ("ww", d1, d2, crSaturday) - 
         DateDiff ("ww", d1, d2, crSunday) This works great.  I wanted to add the ability to omit US Holidays.  Now this is a straight Crystal Reports install without an SQL backend so I cannot use any formulas there.Is there a parameter? I can use to manually create a table of dates to omit?  The only reason I ask is that our company was closed during the holidays so my day reports are really high. I do not mind typing a long list of days manually (12/24/2007, 12/25/2007, etc) but I need to know how to best integrate that list into the formula.  

    Post Author: V361
    CA Forum: Formula
    If you have CR XI, there is another example as well, in the sample reports,  look at feature examples, custom functions.rpt   this code is from that example.
    Function cdDateAddSkipHolidays (nWorkingDays As Number, startDateTime As DateTime) As DateTime    'the result = startDateTime + nWorkingDays + nHolidays (including weekends)    'the algorithm below also works when nWorkingDays is negative
        Dim totalDays    'give a rough estimate for total days. For each 5 work days there are 7    'days. Also add in an extra 2 weekend days to account for a partial week.    totalDays = Fix(nWorkingDays * 7 / 5 + 1) + 2
        Dim iteratedDiff    iteratedDiff = cdDateDiffSkipHolidays (startDateTime, startDateTime + totalDays)
        If (iteratedDiff >= nWorkingDays) Then        Do While iteratedDiff >= nWorkingDays            totalDays = totalDays - 1            iteratedDiff = cdDateDiffSkipHolidays (startDateTime, startDateTime + totalDays)        Loop        cdDateAddSkipHolidays = startDateTime + totalDays + 1    Else        Do While iteratedDiff < nWorkingDays            totalDays = totalDays + 1            iteratedDiff = cdDateDiffSkipHolidays (startDateTime, startDateTime + totalDays)        Loop         cdDateAddSkipHolidays = startDateTime + totalDays    End If
    End Function

  • Calculating number of days without weekend and holidays

    Hallo all,
    can someone help me with a formular to calculate the number of days with Crystal Reports 2008 between two dates without weekends and holidays
    eg.
    date one = 03/24/2010
    date two = 03/29/2010
    Result should be 4 days as 03/27 and 03/28 will be a weekend.
    Plus how to exclude holidays ?
    Thank you very much
    Gerald

    As Doug mentioned, Holidays are very location specific, and are you talking about "corporate holidays" where the company is closed, or "public holidays" where banks (<g>) are closed?
    I'd suggest setting up a calendar table (if you don't have one already), one record per date.  You could make it work-days only, days-off only, or all dates with a flag to indicate if it is a work date.  You could then use that to count the number of work days.  By using a table, you wouldn't have to change any code to (a) extend your calendar to the following year, or (b) change holiday dates if the holidays change.  (I'm thinking corporate holidays, where the company might be closed Friday 12/24/10 in observation of Christmas, but would usually only close on the 25th.)
    HTH,
    Carl

  • Absence Deduction is calculated wrong for one employee

    Hi,  We have an employee who changed his absence booking for the year and all of sudden his absence deduction is not calculating properly.  His total absence quota was 20 days.  He initially booked all 20 days and then cancelled them and created a new booking for 9.5 days but his deduction is saying 16.5 days.
    Is there a way I can check his records why it's only happening to him.  Also I am new to this so not sure where to start investigating.  I did check the deduction rule and it's ok - calculates correctly for other employees, only this particular employee is calculating wrong.

    Hi Joe,
    I did replicate it for another employee belonging to the same group and it calculated correctly.  And the 9.5 days already excludes holidays and weekends.  Not sure what else to check at this point.  Although the only difference in the records of the 2employees is that the problematic employee has a negative carryover from previous year.  not sure exactly what that means.

  • Calculation of Safety Stock and Reorder Point under Forecast Model T

    Hi Gurus!
    Happy Holiday!
    I would like to ask for your assistance on how the the safety stock and reorder point was calculated with the following values available. I would really appreciate it if you could give me details on the calculation.
    Below are the values:
    Basic data
    Forecast date        01.12.2009        Unit                  CTN
    Forecast model       T                 Service level         0.0
    Period indicator     M                 Paramtr profile
    Control data
    Initialization                                Tracking limit        4.000
    Model selection      A                 Procedure selection   2
    Parameter optimizatio                Optimization level    F
    Alpha factor         0,10               Beta factor           0,10
    Gamma factor       0,00              Delta factor          0,30
    Basic value           5.464-           Trend value          5.603-
    MAD                      4.758            Error total              4.722
    Safety stock         1                   Reorder pnt.          1
    No. of values
    Consumption           6                Forecast periods       1
    Initial. periods      0                Fixed periods          0
    Periods per season   12
    Historical data
    Period                Original     Corrected value
    11.2009                3.000              3.000
    10.2009                0.000              0.000
    09.2009                0.000              0.000
    08.2009                9.000              9.000
    07.2009               21.000             21.000
    06.2009               20.300             20.300
    Forecast results
    Period                Original     Corrected value
    12.2009                0.000              0.000
    Appreciate your assistance!
    Thank you and Happy Holidays!
    Ji

    Sweth, you are asking for consulting, and in my opinion it is way beyond what can or should be reasonable to achieve in such a forum. You are asking complex questions, that most probable have more than one possible answer.
    I suggest that you get on-site help from a knowledgeable and experienced consultant. These are crucial business issues, and should be dealt seriously.

  • How to Calculate End-Date for a given Startdate in business hours without holidays

    Hello Experts,
    I need to create a plsql function where we need to determine end date for a task. For this, input will be only start date & number of hours allocated for that task. Based on this input we need to exclude Business hours & need to include only Business hours. and in the end we need to achieve the end date after the hour addition to the start date.
    Example : INPUT: 03-OCT-2013 12:00:00 PM /
                                  Hours Allocated 30 Hrs.
    Business Hours - 11 AM to 9 PM.
    So time starts from or Startdate is Friday 03-OCT-2013 12:00:00 PM. 
    So If I want to calculate the end-date by adding 30 hours to it, it should come WednesDay 09-OCT-2013 12:00:00 PM because I excluded Weekends & considered only business hours that is 11 am to 9 pm.
    I am not able to get any such guidance in Internet as most of the docs are having start & end date as input.
    Please help!
    Thanks in advance !!

    Hi,
    As Christ said, there's no nuilt-in Oracle function to tell whether a given DATE is a holiday or not, partially because there's so much local variation in holidays.  You can write a function like that (see http://forums.oracle.com/forums/message.jspa?messageID=3351081 ), but creating a table will be simpler and more efficient.
    I suggest creating a row for every date, whether it's a work day or not; that way, you can have variations in the schedule (e.g., schedule changes and
    partial holidays).
    CREATE TABLE  work_calendar
    (   dt  DATE       PRIMARY KEY
                       CONSTRAINT  work_calendar_dt
                           CHECK (dt = TRUNC (dt))
    ,   day_type       VARCHAR2 (8)  NOT NULL
                       CONSTRAINT  work_calendar_day_type
                           CHECK ( day_type IN ( 'HOLIDAY'
                                               , 'WEEKEND'
                                               , 'WORK DAY'
    ,   start_time     DATE
    ,   end_time       DATE
    ,   work_hours     NUMBER
    ,   work_hours_since_1970     -- or some point earlier than you'll ever need
                       NUMBER
    ,   CONSTRAINT  work_calendar_start_time
            CHECK ( TRUNC (start_time) = dt)
    ,   CONSTRAINT  work_calendar_end_time
            CHECK ( TRUNC (end_time) = dt)
    This will let you do a lot of the calculations you need without a function.

  • Issue in calculation of Absence days

    Hi,
    There is an issue in Time Management:
    1.Employee X had applied for - annual vacation from 04/05/09 to 08/05/09 - should be 5 days, but only 4 days are transferred to interface system.
    Wmployee Y had applied for - Annual vacation from 14/04/09 to 13/05/09 - should be 28 days, but only 27 days are transferred.
    2. For a large number of people vacation was calculated incorrectly .However, payment was calculated correctly and was paid for.
    I have checked all the configuration in TM and all are perfect, even Holiday calendar was made as moveable and it too works perfectly. Can any one help me - if any settings is missed.
    Last year it didnt have any problem only this year the calculation makes an issue.
    Thanks,
    Priya

    Hi,
    Check the following:
    1. In the scenario you have mentioned check whether Public Holidays which falls on Week endu2019s to be moved to next working day, as defined the next working day has inherited the same characteristics of that Public Holiday and the Day type and Holiday class becomes 1.
    2.Day type and holiday Calendar reflecting was 1 for those moveable Holidays (ie.:on the Public Holiday as well as for the next moved working day )
    3.Here the Day type and Holiday class character which has been moved has the same characteristics of Public Holiday and I think you want the applied leave to be deducted in the Quota used.( Am i right?)
    4.In the table T556c Change the Holiday class and Day type - select 1/3 & 4 and in the counting class for PWS - select 1 & 2 and in DWS select 1 - 9.
    5. In the Work schedule rule the class should get reflect ( say for e.g: if you have defined 4 it should get reflected for that Absence type .i.e: if a holiday falls on Saturday/Sunday and it is a Public Holiday and it is defined as moveable holiday,here if a person applies leave it should calculate the absence days correctly)
    6.Now the Quota is will get deducted u2013 on that moved holiday for which a person applies leave.
    7.Whereas for that PHC u2013 when a person applies leave the Quota used will be 0.
    8.And the Absence Quota used will be correct according to the requirement.
    Check all these settings and if you have any more questions please revert back.
    Regards,
    Selva

  • Calculation of basic date and schedule date

    I update material master from routing with CA97 to material master
    work scheduling data with base quantity 1000
    When MRP running, planned order for 54000 PCS is schedule with work scheduling data.
    when i schedule planned order (change)
    the calculation basic date & schedule date differs for 19 days
    cause basic start shift
    why is this happend?
    is this cause by rounding when transforming minute from routing to days in material master?
    is this because i used shift sequence and scheduling with breaks?
    some strage case again is
    for base qty 1000 processing time is 0.97
    for base qty 10000 processing time is 6.93
    is there any solution for this case?
    please help.
    Best regards,
    Freddy Ha
    Edited by: Freddy Halim on Jan 28, 2010 7:40 AM

    Hi,
    Yes. The schedule date is generated considering your factory calender also in addition to the routing data. For eg.. Suppose if Saturday and sunday are holidays, the schedule date will be extended to 2 days.
    Pl. check the  unit in your routing for the second query.
    Pl. refer the link
    http://help.sap.com/saphelp_47x200/helpdata/en/b1/c042b7439a11d189410000e829fbbd/frameset.htm
    Madhava

  • Payment term exclude holiday days

    Dear all,
    When calculating the aging report for Customer / vendor, I want to exclude holiday days which are defined in system. Is there anyway to do this ?
    It means, due date based on baseline date + days in payment term & public holiday days.
    Thanks so much for your advice,
    regards,
    Sylvecat.

    Hi Sylvecat,
    There is standard configuration in the Payment terms to achive payment due date excluding holiday. You need to take the help of your ABAP Technical team to either use routine or User Exit to meet this requirement.
    Regards,
    Santosh

  • Baseline date calculation

    Hi,
    We have a requirement to exclude non-Business days while calculating Baseline date(for the Accounting Document created on saving the Billing document)
    Currently the Baseline Date being populated in the Accounting Document is Document date + 5days(including Holidays).
    For eg
    Current Scenario
    Document Date: 12th Feb 2008
    Baseline date: 17th feb 2008.
    Requirement:
    Document Date: 12th Feb 2008
    Baseline date: 19th feb 2008(Excluding Sat & Sun).
    Request you to share useful info in this regard.
    Thanks
    Binu

    Hi,
    Use user exit RV60FUS5 for these base line date calculations.
    Thanks
    Krishna.

Maybe you are looking for

  • HRMD_A07 stauts is 53 data is not posted

    Hi I need to update the info types 0000 and 0001 for this Iam using idoc type HRMD_A07,Message type HRMD_A and inbound process code is HRMD. Idoc status is showing 53 and data is not posting into SAP.Can you please help me out of this... Thanks and r

  • ValidateDateTimeRange problem with minimum

    Page has an input date field with a minimum of today's date but the calendar grays out today's date too. Here's the snippet from the page: <af:selectInputDate value="#{bindings.theStartDate.inputValue}" label="Start Date:" required="true"> <f:convert

  • HTML5 course does not play in a browser CP8

    I have published it several times before, now I've got following errors from a console: CPM.js:1 SyntaxError: Expected an identifier but found 'window' instead index.html:17 ReferenceError: Can't find variable: cp Does anybody knows what does it mean

  • HT1535 Problem with manual management - I need help?

    When I click on the "Manually Manage Music and Videos" box, I am informed that my iPhone is synced with another library - and it wants to delete everything on this phone an replace it - I don't want that!

  • Connecting 2 phones to PC suite?

    Hi, Both me and my wife have got new N70's, I have installed PC suite from the disk version 6.6.16 I have backed up my data ok but when I connect my wifes phone it will not make a connection, is there any special way to get a 2nd phone to connect? I