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

supervisor id & name

Former Member
0 Likes
1,716

Hi friends,

In which table I can find supervisor id & name for an employee(pernr)?

Pls reply.

Thanks in advance.

Hi friends,

In which table I can find supervisor id & name for an employee(pernr)?

Pls reply.

Thanks in advance.

7 REPLIES 7
Read only

Former Member
0 Likes
1,513

Hi,

Check Table HRP1001 where u can find ur supervisor PERNR,

with that u can fetch Name of ur super visor from PA0002.

Ram.

Read only

Former Member
0 Likes
1,513

Hi,

Its difficult to gte in one table. Use the logic below


SELECT PERNR
  FROM PA0105
  INTO TABLE G_T_PA0105
  WHERE  SUBTY = C_SUBTY AND 			
         BEGDA >= S_BEGEND-LOW AND
         ENDDA <= S_BEGEND-HIGH AND
   	   USRID = S_USRID-LOW.

  SELECT ORGEH
  FROM PA0001
  INTO TABLE G_T_ORG_UNIT FOR ALL ENTRIES IN G_T_PA0105
  WHERE PERNR = G_T_PA0105-PERNR AND
        BEGDA >= S_BEGEND-LOW AND
        ENDDA <= S_BEGEND-HIGH.

  LOOP AT G_T_ORG_UNIT.

    G_T_ROOT_OBJ-OTYPE = '0'.
    G_T_ROOT_OBJ-OBJID = G_T_ORG_UNIT-ORGEH.
    APPEND G_T_ROOT_OBJ.

    CALL FUNCTION 'HRWPC_GET_DIREPS_OF_LEVEL'
      EXPORTING
        EVAL_DEPTH       = '03'
        PLVAR            = '01'
        BEGDA            = S_BEGEND-LOW
        ENDDA            = S_BEGEND-HIGH
      TABLES
        ROOT_OBJECTS     = G_T_ROOT_OBJ
        RESULT_OBJEC     = G_T_RESULT_OBJ
        RESULT_STRUC     = G_T_RESULT_STRUC
      EXCEPTIONS
        NO_OBJECTS_FOUND = 1
        OTHERS           = 2.
    IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

Regards,

Mansi.

Read only

GauthamV
Active Contributor
0 Likes
1,513

Plz SEARCH in SCN before posting.

[table for supervisor id & name for an employee|https://forums.sdn.sap.com/click.jspa?searchID=25281668&messageID=6401275]

Read only

Former Member
0 Likes
1,513

hi,

u will get it from pa0001-mstbr

SELECT SINGLE ename pernr FROM pa0001

INTO (wa_final-empnm , lv_pernr )

WHERE mstbr = wa_final-employee.

hope this helps u.

Read only

0 Likes
1,513

Hi,

I require to have f4 help for supervisor id input field on screen.How can I achieve this..

Pls reply.

Thanks in advance.

Read only

0 Likes
1,513

HI,

Use this Fm F4IF_INT_TABLE_VALUE_REQUEST to get F4 help in AT SELECTION-SCREEN On VALUE-REQUEST.

Read only

Former Member
0 Likes
1,513

Hi Hosmath,

Check the below simple code.


DATA:
        l_actor_tab    TYPE swhactor OCCURS 0 WITH HEADER LINE,
        l_ac_container TYPE swcont   OCCURS 0 WITH HEADER LINE.


  l_ac_container-element    = 'ORG_OBJECT'.
  l_ac_container-elemlength = '025'.
  l_ac_container-type       = 'C'.
  CONCATENATE 'US' sy-uname INTO l_ac_container-value.
  APPEND l_ac_container.

  CALL FUNCTION 'SWX_GET_MANAGER'
    TABLES
      actor_tab    = l_actor_tab
      ac_container = l_ac_container
    EXCEPTIONS
      OTHERS       = 2.
  IF sy-subrc EQ 0.
    READ TABLE l_actor_tab WITH KEY otype = 'US'.
    IF sy-subrc EQ 0.
      g_apuname = l_actor_tab-objid.
    ENDIF.
  ENDIF.

Regards

Kumar M