Professional Documents
Culture Documents
http://oracleapps-atechniciansview.blogspot.co.uk/
Author : Ashish Harbhajanka
Email : ashish1234u@gmail.com
Business Requirement:
Business wants to ensure that whenever an employee tries to overbook leaves the system should not
allow him to do so. In case of exceptional situations the user will contact the Local HR who will then
enter his/her leaves in the system.
In 11i Oracle Absence Management user/employee only gets a warning message stating that after you
apply this leave your balance will be negative , but allows the user to ignore and proceed. The approver
too does not gets any such message so the approver is completely in dark and so he unknowingly
approves it.
In order to achieve this there are two options :
a) Upgrade your Application to R12
b) Write custom logic within user hook.
Now, it is not always possible to move to a higher version just for achieving some functionality although
that would be best considering the added features you get with next upgrade, but as a stop gap solution
we would try to see how we can get this done via user hook.
Now I have written a package which takes p_exceeds_pto_entit_warning as input and displays the error
message. I have also used a custom profile option XXC_LOA_RESTRICT_OVERBOOKING to ensure I have
the option of switching on/off the functionality.
Name : XXC_LOA_RESTRICT_OVERBOOKING
User Profile Name : XXC: LOA Restrict Overbooking
Hierarchy Type Access Level : Responsibility and user ( visible and updatable)
User Access : Visible
SQL Validation: SQL="select meaning \"Yes or No\", lookup_code into :visible_option_value,
:profile_option_value from fnd_lookups where lookup_type = 'YES_NO'" COLUMN="\"Yes or No\"(*)"
N.B: We have define this profile option value to ensure that the error will be thrown only when
employees try to overbook using Self Service Responsibility but when the changes are to be
incorporated from Absence Details screen it would allow HR to add details ( with seeded warning
message).
In case you want to switch on this functionality just set the value of profile at Responsibility level to Yes
to switch off set the same to No.
This gives the flexibility that from Employee Self Service error will be displayed but not from core
Absence Details form
select hah.api_hook_id,ham.api_module_id
from apps.hr_api_hooks hah,
apps.hr_api_modules ham
where hah.api_module_id = ham.api_module_id
DECLARE
P_VALIDATE BOOLEAN;
P_EFFECTIVE_DATE DATE;
P_API_HOOK_ID NUMBER;
P_API_HOOK_CALL_TYPE VARCHAR2(200);
P_SEQUENCE NUMBER;
P_ENABLED_FLAG VARCHAR2(200);
P_CALL_PACKAGE VARCHAR2(200);
P_CALL_PROCEDURE VARCHAR2(200);
P_API_HOOK_CALL_ID NUMBER;
P_OBJECT_VERSION_NUMBER NUMBER;
BEGIN
P_VALIDATE := TRUE;
P_EFFECTIVE_DATE := 01-JAN-1951;
P_API_HOOK_ID := 3840;-- derived from SQL1
P_API_HOOK_CALL_TYPE := 'PP';
P_SEQUENCE := 3000; -- any value greater than 2000, 1-2000 reserved for Oracle Use
P_ENABLED_FLAG := 'Y';
P_CALL_PACKAGE := 'XXC_HR_USER_HOOK_PKG'; -- custom package
After completing the desired steps and setting the profile value of your Responsibility to Yes / No the
application will work as per business requirement.