Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How ti find employee's manager name

Former Member
0 Kudos
2,129

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

1 ACCEPTED SOLUTION

RaymondGiuseppi
Active Contributor
0 Kudos
663

Did you try to call [RH_GET_LEADER|http://www.sdn.sap.com/irj/scn/advancedsearch?query=rh_get_leader] with parameters from infotype 0007, then use [RH_READ_OBJECT|http://www.sdn.sap.com/irj/scn/advancedsearch?query=rh_read_object].

Regards,

Raymond

5 REPLIES 5

Former Member
0 Kudos
663

Hi,

Check this FM : HRWPC_CB_MANAGER_NAME

Regards,

Srini.

RaymondGiuseppi
Active Contributor
0 Kudos
664

Did you try to call [RH_GET_LEADER|http://www.sdn.sap.com/irj/scn/advancedsearch?query=rh_get_leader] with parameters from infotype 0007, then use [RH_READ_OBJECT|http://www.sdn.sap.com/irj/scn/advancedsearch?query=rh_read_object].

Regards,

Raymond

former_member300258
Participant
0 Kudos
663

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

MarcinPciak
Active Contributor
0 Kudos
663

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

Former Member
0 Kudos
663

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.