‎2010 Sep 10 5:56 AM
Hi,
Could anyone please let me know if there is a function module to determine whether a given employee is a manager in HR.
Regards,
Milan Thaker
‎2010 Sep 10 6:53 AM
you might have to create one on your own, which satisfies this requirement...
Fetch the employee details and check for your condition...
‎2010 Sep 10 6:54 AM
‎2010 Sep 10 7:09 AM
Hi Milan,
well, I don't know if there's such a module function.
Nevertheless, you could search thru the organization in table HRP1001
- selecting OTYPE = 'S', RSIGN = 'A' and RELAT = '012' will give you the managed positions (OBJID)
- then, for every record in the former query, search for OTYPE = 'P' and VARYF = 'S ' concatenated with the OBJID retrieved in the previous step.
For example, if the organization is:
Department 1 --- ID 'S 50001122'
..Managed by --- ID 'P 00001999'
...then the records in table HRP1001 would look like:
OTYPE = 'S', OBJID = '50001122', RSIGN = 'A', RELAT = '012' //<-- meaning the department 1
OTYPE = 'P', OBJID = '00001999', VARID = 'S 50001122' // <-- meaning the personnel number who manages department 1
I hope this helps. Kind regards,
Alvaro
‎2010 Sep 10 10:25 AM
Milan,
I think if you execute fm RH_GET_OBJECTS_OF_MANAGER by giving the username if it returns obj_tab then user is a manager
Thanks
Bala Duvvuri
‎2010 Sep 10 10:47 AM
To determine whether EE is manager, you should check relation of his position to position of other Employees. If he/she has any direct reports then he/she is manager for someone. So this goes like
"first determine EE's position
"then check position relation to other positions
call function 'RH_READ_INFTY_1001'
exporting
plvar = '01'
otype = 'S'
objid = ee_position
begda = sy-datum
endda = sy-datum
istat = '1'
subty = 'B002' "position which Reports to EE position
tables
i1001 = it_1001
exceptions
nothing_found = 1
wrong_condition = 2
wrong_parameters = 3
others = 4.
if it_1001[] is not initial.
"is manager
else.
"is not manager
endif.
Regards
Marcin