I'm facing a problem that hope you might help me resolve.
The requirement is to enhance the standard leave processing of ESS so that IT0007 is validated when requesting a leave. IT0007 was customized to have an additional field that indicates how to process leaves, like this:
a) If Additional Id is "1", leaves are processed from Monday to Friday.
b) If Additional Id is "2", leaves are processed from Monday to Saturday (no matter saturday is a free day, it would be counted as holiday, except when it is a public holiday).
c) If Additional Id is "3", leaves are processed according to work schedule.
Employe number xxxxxxxx has additional ID set to "2" in IT0007, and I'm requesting a leave from Monday 3rd May to Sunday 9th May.
The standard SAP ESS leave processing shows: 7 calendar days, 5 working days, 5 days leave.
The customized SAP ESS leave processing should show: 7 calendar days, 5 working days, 6 days leave.
What i did so far
I added this code within classes ZCL_IM_HR_PT_TMWP_01 and ZCL_IM_HR_PT_TMWP_02 for BADI PT_BLP_USER within method PROCESS_IT2001:
w_it2001 ?= i_record->data. w_2001 = w_it2001->p2001. * IM 20100420 DATA: p_innnn TYPE prelp. DATA: p_psave TYPE prelp. MOVE-CORRESPONDING w_2001 TO p_innnn. MOVE-CORRESPONDING psave TO p_psave. CALL FUNCTION 'ZHRPA_LIQVAC_2001_ESS' EXPORTING molga = w001p-molga awart = w_2001-subty pfkey = sy-pfkey pbo = 'X' CHANGING innnn = p_innnn psave = p_psave w_2001 = w_2001. w_it2001->set_data( w_2001 ). *IM 2010042
The FM ZHRPA_LIQVAC_2001_ESS is the one that handles each of the leave processing types according to the additional ID field in IT0007.
After w_2001 is returned from this FM, it is updated with the new values in fields KALTG (calendar days) and ABWTG (Absence days).
The following sentence applies the changes in w_2001 to the current regitry (reflect the changes in the object's attribute):
w_it2001->set_data( w_2001 )
Up to that moment the values are exactly as I want them to be: 7 calendar days, 5 working days, 6 days leave.
Right after i click F8 in debugging, I get the ESS review leave screen showing this values.
7 calendar days, 5 working day
To confirm if it is just the field in ESS showing 5 days i approve the leave as the manager and check the quota balance in backend: it reduced 5 days and not 6 as would have been expected.
It seems to me some standard code is overwriting the changes done by me in the mentioned classes.
1) Can anyone confirm to me if the Working Days field shown in ESS is the same as the Absence Days shown in PA30 IT2001 SUBTY 1000? If not possible, do you know the technical name of the field called by the standard WD application?
2) Did anyone implement something like this before? Is this the right BADI to enhance? What might I be doing wrong? Suggestions?
Edited by: Ivan Milkovic on Apr 20, 2010 1:00 PM