Skip to Content
author's profile photo Former Member
Former Member

FM to find an employee's manager

Is there a FM that takes in a pernr as input along with date ranges and finds the employee's respective managers during those date ranges ?

- Mark

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Jun 29, 2007 at 06:56 AM

    This FM finds the manager HRCM_ORGUNIT_MANAGER_GET.

    But it uses ORGEH instead of PERNR.

    Regards,

    Amit

    Reward all helpful replies.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Mark,

      Check if you would like to have a look at :

      1) RH_GET_LEADER

      2) RH_STRUC_GET

      Pick up the position of employee from pa0001.

      After that call function

      RH_STRUC_GET

      Pass plan version 01,

      Object ID as position

      Object Type 'S'

      Evaluation Path - A002 (Reports line to)

      Begda & endda

      & you should get his manager.

      Hope this helps.

      Kindly reward if useful.

      Regards & Thanks,

      Darshan Mulmule

  • author's profile photo Former Member
    Former Member
    Posted on Jun 29, 2007 at 05:28 AM

    try FM: RH_GET_MANAGER_ASSIGNMENT

    reward points if helpful

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      u can use belo code of mine to find the current manager name of a pernr..

      if u want list of all managers for a given period then enhance this code based upon the input date range.

      logic wl remain the same.

      
      FUNCTION ZGILL_APPROVER.
      *"----------------------------------------------------------------------
      *"*"Local interface:
      *"  IMPORTING
      *"     REFERENCE(PERNR) TYPE  PERSNO
      *"  EXPORTING
      *"     REFERENCE(NAME) TYPE  PAD_CNAME
      *"  EXCEPTIONS
      *"      NO_DATA
      *"----------------------------------------------------------------------
      
      DATA: ls_sobid1 TYPE sobid,
            ls_sobid2 TYPE sobid,
            ls_sobid3 TYPE sobid,
            vorna type PAD_VORNA,
            nachn type PAD_NACHN.
      
        SELECT SINGLE sobid FROM hrp1001 INTO ls_sobid1
         WHERE otype = 'P'
         and   plvar = '01'
         AND   objid = pernr
         AND   endda >= sy-datum
         AND   begda <= sy-datum
         AND   rsign = 'B'
         AND   relat = '008'.
      
       IF sy-subrc EQ 0.
      
       SELECT SINGLE sobid FROM hrp1001 INTO ls_sobid2
         WHERE otype = 'S'
         and   plvar = '01'
         AND   objid = ls_sobid1
         AND   endda >= sy-datum
         AND   begda <= sy-datum
         AND   rsign = 'A'
         AND   relat = '002'.
      
       IF sy-subrc EQ 0.
      
       SELECT SINGLE sobid FROM hrp1001 INTO ls_sobid3
         WHERE otype = 'S'
         and   plvar = '01'
         AND   objid = ls_sobid2
         AND   endda >= sy-datum
         AND   begda <= sy-datum
         AND   rsign = 'A'
         AND   relat = '008'.
      
       IF sy-subrc EQ 0.
      
       SELECT SINGLE vorna nachn from pa0002 INTO (vorna , nachn)
         WHERE pernr = ls_sobid3
         AND   endda >= sy-datum
         AND   begda <= sy-datum.
      
       IF sy-subrc EQ 0.
      
       Concatenate vorna nachn into name separated by SPACE.
       condense name.
      
      else.
      Raise NO_DATA.
      endif.
      
      else.
      Raise NO_DATA.
      endif.
      
      else.
      Raise NO_DATA.
      endif.
      
      
      else.
       RAISE no_data.
      endif.
      
      
      ENDFUNCTION.
      

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.