Hello, I have this slight problem. The BG_ABSENCE_DURATION formula calculates correctly for me for the current year. But lets say my leave request spans more than one year, say from 29-DEC-2012 to 02-JAN-2013, my formula removes 5 days from the accrual for the current year (2012). How do I make it remove 3 days from 2012 accrual and 2 days from 2013 accrual? I have already calculated th duration for the current and next year in my formula, problem is how to make oracle recognize it.
So I would have an annual leave element from 29-DEC-2012 to 31-DEC-2012. And then another annual leave element from 01-JAN-2013 to 02-JAN-2013?
Yes this is a common problem. You have a number of solutions, ranging in complexity from nothing to technical extension:
1) Do nothing (easiest!). Yes, 3 extra days are taken out of this year, which might take the employee into a negative balance. But that will be carried forward when you run carryover, so it nets out once you get to next year. This is what I normally do: zero customization.
2) If you hold work schedules in Oracle and the absence duration is auto-calculated and employees can't override it, you could build and run a custom program that splits up the absence into two, using the work schedules to calculate each side of the year.
3) You can prevent employees from entering this in the first place with a user hook, instead asking them to enter two separate absences.
4) As a matter of business procedure you can ask employees not to do this and have a regular manual business process to report on exceptions and deal with them (eg, liaise with employee to split out)
5) You could build an AME rule that routes absences spanning the calendar year to an additional approver who returns the absence for correction, asking them to split it out.