Symptom
Error message in time off and time sheet: "Only EmployeeTime of type ABSENCE allowed but category=ATTENDANCE".
Image/data in this KBA is from SAP internal systems, sample data, or demo systems. Any resemblance to real data is purely coincidental.
Environment
SAP SuccessFactors Employee Central - Time Off
SAP SuccessFactors Employee Central - Time Sheet
Reproducing the Issue
- Navigate to Time Sheet UI of an employee.
- Submit Time Sheet
- Error occurs: "Rule "XYZ" execution failed with error "Error happen when invoke rule function: absenceInDaysForPeriodBasedOnCalendarDays, root cause: Only EmployeeTime of type ABSENCE allowed but category=ATTENDANCE"
Note: Error also occurs in the Time off UI while requesting leave.
Cause
- This is an expected error message as a validation is introduced in 1H 2021 release.
-
Time Off rule functions only accepts Time Types classified as 'absence' as parameters & Time Off rule functions must only be used with Employee Times whose Time Types is classified as 'absence'.
Possible scenarios for the error.
- There are rules assigned to 'Employee Time' object having time off rule functions where in the input parameter 'Time Types'(or Time type external code), a time type of classfication 'attendance' is used.
- There are alert rules assigned to 'Employee Time' object having time off rule functions and no addition IF condition to check if the time type is of type 'classification'.
Handbook: Implementing Employee Central Time Management: Notes on Rule Functions in Time Off
Resolution
- There are rules assigned to 'Employee Time' object having time off rule functions where in the input parameter 'Time Types', a time type of classfication 'attendance' is used.
- In input parameter of the rule function, use only time type of classification 'absence' (As time off rule functions should be used only for time off related time types). Example Rule:
2. There are Alert rules assigned to 'Employee Time' object having time off rule functions.
- Add an additional IF condition in the rule as shown in the screenshot below:
See Also
Keywords
Only EmployeeTime of type ABSENCE allowed but category=ATTENDANCE, attendance, absence, time off, rule function, absenceInDaysForPeriodBasedOnCalendarDays, Get Absence, alert, employee time, employeetime , KBA , LOD-SF-EC-TMS-UI , UI - Errors, Trace, RBP, Permissions, Status , Problem