cancel
Showing results for 
Search instead for 
Did you mean: 

How to get reprots to relationship.

Former Member
0 Kudos

Hi,

Could any one just let me know regarding how to get reports to relationship for the particular employee number from infotype 1001.

What exactly are the aprameters involved.

Thanks in Advance ,

Irfan Hussain

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

HI,

for getting the relationships for a perticular personnel number.

just go to se16 and for table hrp1001.

type otype as P

and check for entries

and if at all u want to see the exact relation u need to check rsign and relat fields from the same table(HRP1001)

thanks

aditya

Former Member
0 Kudos

Sorry about that.. Use RHPH_STRUCTURE_READ with the parameters mentioned below ...

Former Member
0 Kudos

Use the FM as follows :

PLVAR 01

OTYPE S (Position)

OBJID Employee Position

WEGID MANAGER (Standard Eval Path)

BEGDA 12/15/2005 (Today)

ENDDA 12/15/2005 (Today)

PUP_INFO X

WITH_STEXT X

TDEPTH 0

This will return an internal table with 2 positions, the positon you have provided & the position of the Manager who the employee reports to. The advantage here is that there is no coding involved & we are using all standard SAP provided objects.

Pls. award points if this helps.. I have tried the above on my system & it works just fine.

Former Member
0 Kudos

Hi Rajesh,

Would you please tell me which FM you are referring to in your post?

Thanks in advance..

suresh_datti
Active Contributor
0 Kudos

Hi,

If the reqt is to get the reports to relationship, there is no need for Evaluation Paths.If the input is PERNR, there is no way you can do it without coding. The code I posted earlier works perfect. If you do not want to use SELECT statements. pl use the folliwng report. If you input the Pers No of the employee, you will get the Pers No of the

supervisor.


*&---------------------------------------------------------------------*
*& Report  ZPGETREPORTSTO                                              *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

report  zpgetreportsto                          .


parameters: p_pernr type pernr_d matchcode object premn.


data: w_ok type boole_d,
      w_objid type objid,
      w_subty type subty,
      t_obj_set type hrobject_t,
      rec_obj like line of t_obj_set,
      t_1001 type p1001tab,
      rec_1001 like line of t_1001,
      msg_handler type ref to cl_hrpa_dummy_message_handler.


w_objid = p_pernr.
w_subty = 'B008'.
rec_obj-plvar = '01'.
rec_obj-otype = 'P'.
rec_obj-objid = w_objid.
append rec_obj to t_obj_set.

perform read_1001 using w_subty t_obj_set
                  changing t_1001.
clear:w_objid,w_subty,t_obj_set[],rec_obj.

read table t_1001 index 1 into rec_1001.
w_objid = rec_1001-sobid.
w_subty = 'B002'.
rec_obj-plvar = '01'.
rec_obj-otype = 'S'.
rec_obj-objid = w_objid.
append rec_obj to t_obj_set.
perform read_1001 using w_subty t_obj_set
                  changing t_1001.
clear:w_objid,w_subty,t_obj_set[],rec_obj.

read table t_1001 index 1 into rec_1001.
w_objid = rec_1001-sobid.
w_subty = 'A008'.
rec_obj-plvar = '01'.
rec_obj-otype = 'S'.
rec_obj-objid = w_objid.
append rec_obj to t_obj_set.
perform read_1001 using w_subty t_obj_set
                  changing t_1001.
clear:w_objid,w_subty,t_obj_set[],rec_obj.

read table t_1001 index 1 into rec_1001.
if sy-subrc eq 0.
  write:/ rec_1001-sobid.
endif.
*&---------------------------------------------------------------------*
*&      Form  read_1001
*&---------------------------------------------------------------------*
form read_1001  using    p_w_subty
                         p_t_obj_set
                changing p_t_1001.


  call function 'HR_ECM_READ_INFOTYPE_1001'
    exporting
      subty           = p_w_subty
      begda           = sy-datum
      endda           = sy-datum
      object_set_tab  = p_t_obj_set
      message_handler = msg_handler
    importing
      i1001_tab       = p_t_1001
      is_ok           = w_ok.

endform.                                                    " read_1001

Regards,

Suresh Datti

suresh_datti
Active Contributor
0 Kudos

Hi Irfan,

PL use the following piece of code..


*&---------------------------------------------------------------------*
*& Report  ZICN1                                                       *
*&                                                                     *
*&---------------------------------------------------------------------*
*&                                                                     *
*&                                                                     *
*&---------------------------------------------------------------------*

report  zicn1                                   .

data:
       w_pernr type sobid value '00006391',"test pernr   
       w_plans type objid,
       w_sup type sobid,
       w_sup_pernr type sobid.

select objid into w_plans from hrp1001
             up to 1 rows
             where otype = 'S'
               and plvar = '01'
               and istat = 1
               and rsign = 'A'
               and relat = '008'
               and begda le sy-datum
               and endda ge sy-datum
               and sobid = w_pernr.
endselect.
if sy-subrc eq 0.
  select sobid into w_sup from hrp1001
               up to 1 rows
               where otype = 'S'
                 and objid = w_plans
                 and plvar = '01'
                 and istat = 1
                 and rsign = 'B'
                 and relat = '002'
                 and begda le sy-datum
                 and endda ge sy-datum.
  endselect.
  if sy-subrc eq 0.
    select sobid into w_sup_pernr from hrp1001
                 up to 1 rows
                 where otype = 'S'
                   and objid = w_sup
                   and plvar = '01'
                   and istat = 1
                   and rsign = 'A'
                   and relat = '008'
                   and begda le sy-datum
                   and endda ge sy-datum.
    endselect.
    if sy-subrc eq 0.
      write:/ w_pernr, w_sup_pernr.
    endif.
  endif.
endif.

Regards,

Suresh Datti

( PL close this thread and your other threads as well if the answer help you)