2010 Oct 28 7:31 AM
Hi All,
I tried in SDN but i am not able to find suitable thread. Anybody can tell me which function module i should use to get employee's manager name.
Thanks,
Maheedhar
2010 Oct 28 7:55 AM
2010 Oct 28 7:55 AM
2010 Oct 28 7:55 AM
2010 Oct 28 7:59 AM
Hi,
check this link...
<removed by moderator>
hope this would give you some hints...
kalidass.
Moderator message: please do not post just links to threads without any further explanations.
Edited by: Thomas Zloch on Oct 28, 2010 11:26 AM
2010 Oct 28 8:06 AM
Maybe this could be achieved by RH_STRUC_GET but you need to provide proper ACT_WEGID . The custom way however would be like this
DATA lt_p1001 TYPE TABLE OF p1001.
DATA lt_manager TYPE TABLE OF p1001.
DATA l_pernr TYPE persno.
DATA l_objid TYPE HROBJID.
FIELD-SYMBOLS: <wa_p1001> LIKE LINE OF lt_p1001,
<wa_manager> LIKE LINE OF lt_manager.
"get manager of EE's org unit
CALL FUNCTION 'RH_READ_INFTY_1001'
EXPORTING
plvar = '01'
otype = 'O'
objid = "EE org unit here
begda = sy-datum
endda = sy-datum
subty = 'B012' "is managed by
TABLES
i1001 = lt_p1001
EXCEPTIONS
nothing_found = 1
wrong_condition = 2
wrong_parameters = 3
OTHERS = 4.
LOOP AT lt_p1001 ASSIGNING <wa_p1001>
WHERE sclas = 'S'. "position
l_objid = <wa_p1001>-sobid.
"get person for this position
CALL FUNCTION 'RH_READ_INFTY_1001'
EXPORTING
plvar = '01'
otype = 'S'
objid = l_objid
begda = sy-datum
endda = sy-datum
subty = 'A008' "holds
TABLES
i1001 = lt_manager
EXCEPTIONS
nothing_found = 1
wrong_condition = 2
wrong_parameters = 3
OTHERS = 4.
LOOP AT lt_manager ASSIGNING <wa_manager> WHERE sclas = 'P'.
l_pernr = <wa_manager>-sobid.
EXIT.
ENDLOOP.
ENDLOOP.
Manager -> l_pernr
Manager name -> get from IT0002 for l_pernr
Regards
Marcin
-
Juest checked FM HRCM_ORGUNIT_MANAGER_GET which is working too. On input you can either provide EE's position or org unit.
Edited by: Marcin Pciak on Oct 28, 2010 9:12 AM
2010 Oct 28 8:23 AM
Use the FM RH_GET_LEADING_POSITION (Input Plan Version, Object Type = P, Employee Number). Internal table LEADING_POS will give the Positon number of manager. Pass the details in table LEADING_POS into function module RH_GET_PERSONS_FROM_POSITION to get the employee number related to the Poistion Number.