‎2008 May 21 9:14 PM
hi ,
i want details about How to find out manager position in om reporting?
Thanks,
Gopi
‎2008 May 21 10:37 PM
You can use this FM to find the manager of a orgunit -HRCM_ORGUNIT_MANAGER_GET
and this one to get all the orgunits a manger is assigned to - HRCM_GET_ORGUNITS_FOR_MANAGER
Regards,
Amit
‎2008 May 21 10:06 PM
You can do it this way.
But there is obviously better way to do it.
Pass position of the Employee
FUNCTION z_get_manager.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(FI_PLANS) TYPE PLANS OPTIONAL
*" EXPORTING
*" VALUE(FE_NACHN) TYPE NACHN
*" VALUE(FE_VORNA) TYPE VORNA
*" VALUE(FE_PERNR) TYPE PERSNO
*" EXCEPTIONS
*" NO_REPORT_TO
*" NO_POSITION_HOLDER
*" NO_NAME_FOUND
*"----------------------------------------------------------------------
DATA : lv_sobid LIKE hrp1001-sobid,
lv_pernr LIKE hrp1001-sobid.
* 1) Get report-to position.
SELECT SINGLE sobid FROM hrp1001 INTO lv_sobid WHERE
otype EQ 'S' AND
objid EQ fi_plans AND
plvar EQ '01' AND
relat EQ '002' AND
rsign EQ 'A' AND
sclas EQ 'S' AND
begda LE sy-datum AND
endda GE sy-datum.
IF sy-subrc NE 0.
RAISE no_report_to.
ENDIF.
* 2) Get position holder (Manager ID)
SELECT SINGLE sobid FROM hrp1001 INTO lv_pernr WHERE
otype EQ 'S' AND
objid EQ lv_sobid AND
plvar EQ '01' AND
relat EQ '008' AND
rsign EQ 'A' AND
sclas EQ 'P' AND
begda LE sy-datum AND
endda GE sy-datum.
IF sy-subrc NE 0.
RAISE no_position_holder.
ENDIF.
fe_pernr = lv_pernr.
* 3) Get Manager First Name and Last Name.
SELECT SINGLE vorna nachn FROM pa0002 INTO (fe_vorna, fe_nachn) WHERE
pernr EQ fe_pernr AND
begda LE sy-datum AND
endda GE sy-datum.
IF sy-subrc NE 0.
RAISE no_name_found.
ENDIF.
ENDFUNCTION.Recommended way would be use SAP standard function
RH_GET_STRUCTURE.
Many other ways too.
-A
‎2008 May 21 10:37 PM
You can use this FM to find the manager of a orgunit -HRCM_ORGUNIT_MANAGER_GET
and this one to get all the orgunits a manger is assigned to - HRCM_GET_ORGUNITS_FOR_MANAGER
Regards,
Amit