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: 
Read only

manager name

Former Member
0 Likes
418

how to find the name of manager of an employee in SAP HR???

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
385

Manager will have a personnel number with a field pernr .Based on that and use table PA001.PA002.

Please reward if useful.

3 REPLIES 3
Read only

Former Member
0 Likes
386

Manager will have a personnel number with a field pernr .Based on that and use table PA001.PA002.

Please reward if useful.

Read only

0 Likes
385

Refer this Fm of mine - either create a FM or u can use this piece of cdeo to find 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.

Read only

Former Member
0 Likes
385

chk this