Annual Leave Form

Hi,
I have an annual form which i would like for it to calculate the working days between two dates. I have an error when i select the start date to be e.g. Thursday 31 October and end date Monday 4th Nov it only seems to caluculate 1 weekend day? I am using formcalc
I also have another issue as my table has buttons that allows for more lines to be added if more that one set of dates is to be added, how to i get the table to calculate the different date working days and then calculate the total days altogether?
Any help would be great
Thanks

Question 1:  this is javascript on mouseUp:
var dtStart = new Date(this.getField("StartDate").value);
var dtEnd = new Date(this.getField("EndDate").value)
var nDayStart = dtStart.getDay()
var nDayEnd = dtEnd.getDay()
var OneDay = 24 * 60 * 60 * 1000;
var TotalNumDays = (dtEnd.getTime() -  dtStart.getTime())/OneDay;
// Fix up for Starting on Saturday or sunday
if(nDayStart == 6)
nDayStart = 1;
  TotalNumDays - = 2;
else if(nDayStart == 0)
nDayStart = 1;
TotalNumDays - = 1;
// Fix up for ending on saturday or sunday
if(nDayEnd == 6)
  nDayEnd = 5;// Make it friday
TotalNumDays - = 1;
else if(nDayEnd == 0)
   nDayEnd = 5;// Make it friday
   TotalNumDays - = 2;
var NumWeeks = Math.floor(TotalNumDays/7);
var extraDays = 1;
var DaysLeft = TotalNumDays -  NumWeeks * 7;
if(DaysLeft)
   var sepDays = nDayEnd -  nDayStart;
   if(sepDays > 0)
      extraDays += sepDays;
   else if(sepDays < 0)// Week end Split
      extraDays += sepDays + 6;
var totalWorkingDays = NumWeeks * 5 + extraDays;
this.getField("TotalWorkingDays").value = totalWorkingDays;
I have a sample I can email if interested.

Similar Messages

  • Generation of Annual Leave Quota at a time for the whole  year

    Hi All,
    Kindly give some suggestions.
    I am working on Time evaluation. We have a quota , Annual leave which is now given on monthly basis, means lets 12 annual leave are for whole year and employee are getting 1 leave on each month.
    Now  my requirement is to give this quota at a time in the start of every year. That means all the 12 annual leave should be generated in the start of a year.
    When I select the option no pro rata calculation then I am getting all this leave in the start of the year. But when an employee is joined in the mid of the year then also 12 leave is been generated which is not correct.
    Please suggest me how to make this leave as prorated so that for new joinee , this leave is generated taking into account the period and generate the prorate value for the whole year at the time of joining.
    Thanks
    Tanuja.

    Hi Sikinder,
    I am using + time evaluation Status-2. We have to generate quota in PT60 for each period.
    Write now we are getting annual leave quota getting generated in monthly basis. We want to genarate whole quota  for the  year in the 1st month of the year.
    When I have given calender year in the accrual period , i am not getting any quota in the 1st month rather getting the whole quota in the end of the year.
    Please suggest me what to do.
    Regards,
    Tanuja.

  • How to view CEO annual leave on self selvice

    I have a requirement for the CEO HR personnel  to be able to view his annual leave details on self service.
    But as he is not her surbordinate, he doesnt appear in the list of 'My Employee'
    information she can view. Can someone please advise the best way to meet this requirement?
    How can we allow the HR personnel to view his entitlement etc details on self
    service.

    Hi
    What is the need to see Annual leave only through self service. I think HR should use professional screen.
    Just change the security profile of responsibility and check if this works. Not sure though.
    Thanks
    Avinash

  • Error while generating the annual leave quota.

    Hi All,
    For all the employee group's for the past 2 years we are generating the Annual leave quota.
    For one employee group, management decided not to give annual leave quota. i have done the necessary configuration so that the quota will not get generated for them.
    For the new employees quota is not getting generated.
    For the old employees i have deleted the annual leave absence quota and run PT60. For these employees system is throwing the following error.
        Error entry no. 83 Error when creating absence quota
         General information
         Rule: 000 quota type 00
        No quota type for key 7 99 01 20110930
    Please suggest the solution.
    Thanks & Regards,
    Sumathi.

    Hi ERP12345,
    This is for employee Group,
    We have 2 employee groups, 1. Permanent
                                                    2. Contract
    For all the contract employees, we have generated the annual leave quota for the past 2 years.
    Now management doesn't want any annual leave quota to be generated for this particulat employee group. so i have deleted all the configuration related to this employee group from base entitlement, accrual of quota generation, deduction rule,selection rule & couting rule.
    When i am hiring a new empoyee the quota is generating correctly, means annual leave quota is not generating, remaining leaves are generating.
    Is it a right way of doing, normally if this is the scenario, what we have do to,
    For the old employees, after deleting the 2006 IT also, system if thwoing the error as i mentioned in my first conversation.
    Please suggest.
    Thanks & Regards,
    Sumathi.

  • Report on Annual leave details

    Dear All,
           Would you please give a hint on the REPORT of giving all the annual leave details of the employees.
           Also, please advise the report name on leave balance.
    Thanks and best regards,
    Sophie Que

    HI,
    You can run the SAP Standard Progran RPTQTA10 in transaction SE28 or SA38.
    Regards,
    Kapil Kaushal

  • Annual Leaves calculating wrongly

    Hi All,
    I applied Annual leaves in IT2001 for 10 days. After running my time evaluation it is deducting only 4 days, It should deduct 10 days from year entitlement.
    How & where can i check ?
    Thanks,
    Kumar.

    Hi,
    The Min 0 and Max is 999 days.
    No entry in table T556C.
    It is used Calendar days, No records in IT2003.
    User applied leave From    14.06.2010 - 21.06.2010
    Absence hours           47.50
    Absence days             7.00
    Calendar days            7.00
    Amount of leave          7.00  Days
    But in infotype0005 showing only 4 days, it should show 7.

  • How to craete a 'annual leave 1/2day-AM'  in ESS  leave request

    Hi ,
    I have created 2001- subtype 670 : "annual leave 1/2day-AM".
    I wanted to see "annual leave 1/2day-AM" in the ESS leave request list down box ( already we have few ) ... please let me know what are the steps i need to follow ...
    thanks,
    sunitha
    Edited by: Sunitha Reddy on Sep 19, 2008 9:27 AM

    Hi,
    Your ABAPer will be the best person to let you know the table name or some experts here who have come across this situation will guide you. Also check where other types of leaves are populated in SAP and your new value is there or not.
    Thanks,
    Preetham

  • Shift employees annual leave submission

    Hi
    When shift employees in our company is submitting annual leave on the day when their daily work schedule is on afternoon or night then workflow error is occuring, eventhough annual leave is approved couldnt be saved and asking HR to create manually..Why getting error in work flow? any suggestions please...
    Thanks in advance..
    Regds
    Shaila

    hi
    can you try to make one more set of workschedule which will have thursdays and fridays excluded from the counting.
    Try once.
    Regards
    sameer

  • Creating Permission Lists for an Annual Leave Calendar

    Can Someone Help Please:
    I currently have a SharePoint Annual Leave Calendar i have created when users enter the date onto the calendar which then emails the line managers requesting them.
    I wanted to create permissions so all staff with contribute permissions for the calendar List can only edit their own items but the Line Manager who has owner rights to still be able to modify anyones items..
    Is that possible? If so how?
    Thanks in advance

    Hi,
    According to your description, my understanding is that you want to make the users can only be able to edit the events created by themselves in the calendar list.
    I recommend to go to the List settings > Advanced settings > check Create items and edit items that were created by the user in Item-level Permissions.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • The annual leave cannot be processed (Urgent)

    Hi All,
    I am using R11i. This is urgent.
    The annual leave cannot be processed in self service because its balance cannot exceeds -5.
    How can i modify the limit value -5 so that no constraint is imposed when taking the annual leave?
    Any solution for the above issue?
    Thanks.
    Roshan
    Edited by: Roshan30 on Apr 26, 2011 9:11 PM

    Some where you are putting limit for -5. Check BG_ABSENSE_FORMULA for debug this.
    Generally Global value should be set for these limit.
    Thanks

  • Anyone know how to update page artwork leaving Form Fields where they were?

    I set up my form fields just the right way and line them up right over where they are supposed to be, but the client makes a change to the artwork that the forms sit on.
    Is there any way to just update the page leaving form fields exactly where they were?
    As far as cutting and pasting to th enew pdf, thats too time consuming and there is no paste in place either. So I have to keep tapping them to back to where I put them the first time, but can’t do that every time not to mention it isn’t lockdown accurate and I have to make sure I have all the forms selected. Perhaps there is at least a Paste in Place for Acrobat plug-in somewhere, that would work.

    Wow, really? I keep using these links to find the answer to my question and the forum keeps bouncing me back to the forum starting page. Anyone have the current link, or is this just the Adobe server freaking out?

  • Absence Management-Annual Leave CarryOver

    Hi,
    I have a single BG with multiple companies, the requirement is, in absence Management- Annual Leave carryforward is different for different companies.
    For one of the companies the maximum carry over is 60 days and other company there is no limit for the carry overs.Employees can carry any number of leaves.
    Can i achieve the requirement. Appreciate your reply.
    Regards,

    For one accrual plan there is only one carry over formula.
    You have to handle multiple conditions to satisfy the different companies carryover policies in same Carry Over Formula.
    Thanks

  • How to craete  'annual leave 1/2day-AM' in ESS leave request

    Hi ,
    I have created 2001- subtype 670 : "annual leave 1/2day-AM".
    I wanted to see "annual leave 1/2day-AM" in the ESS leave request list down box ( already we have few ) ... please let me know what are the steps i need to follow ...
    thanks,
    sunitha

    Hi,
    Your ABAPer will be the best person to let you know the table name or some experts here who have come across this situation will guide you. Also check where other types of leaves are populated in SAP and your new value is there or not.
    Thanks,
    Preetham

  • Time Management - Annual Leave carry forward ceiling

    Dear All,
    We are implementing SAP HCM - Negative Time Management. Here the sceanrio is to have a ceiling for the Annual leave carry forward. For example , the employees should not be able to carry forward not more than 15 days of Annual leave
    Guess we can achieve this using User Exit ? Would be helpful if anyone could tell me the Name of the User Exit to be used
    Thanks in advance.
    Kind regards
    Sathya

    No iam not looking for Annual leave entitlements.
    We need to have ceiling on Annual Leave Carry Forward. for example let say an employee has 20 days as Annual leave Balance he / she can carry forward only 15 out of that 20 days to next year.
    Kind regards
    sathya

  • How to display balance days for annual leave in payslip report

    hi all,
    cn sm1 let me know how i can display the leave balance days of each employee on their payslip.
    please let me know the tables where i can find the info of the employee annual leave days balance.
    The leave defined is decreasing.
    Plz i need your assistance gurus.
    All comments are welcomed!

    No one out there to response buddies?

Maybe you are looking for

  • IPhone will charge but not be recognised by iTunes or iPhoto, other iPhones will though with same cable, How can i fix it?

    Suddenly my iphone stopped being recognised by the Mac, ive tried other iphone which work so I know the cable and itunes work but my iphone is simply not picked up. I dont know why although in june 2010 I got it slightly wet but it dried out and work

  • Networked Macs can no longer see iTunes 7.6 shares

    Since installing iTunes 7.6 (29) I cannot access my library from any of the Macs in the house. I keep getting a firewall blocking error message. The only way I can gain access is to switch off the Leopard OS 10.5.1 firewall altogether! Nasty. I delet

  • Extended classic scenario PO not created

    Hi Guys, Hope someone could give me some hints on this. This is an isolated case.System works fine for all other shopping cart except for below case. The shopping cart approved and suppose to create the PO. I could see the PO number generated in BBP_

  • Sort incoming XML message

    Hi Is there a standard way in PI to sort the incoming XML message within the message mapping before doing the mapping itself? The scenario would be an incoming Flat file with header and item data records, and we will be mapping it in PI to create IDO

  • ITunes 11.4 crashes immediately when started on Mac OS 10.6.

    We have an old Macbook running Snow Leopard 10.6.8 and started iTunes to move our Library to a new Macbook Air. iTunes suggested to upgrade, which we did. When starting iTunes it crashes immediately. Any suggestions?