Skip to Content
-1

Org structure hierarchical function module with input as pernr number

Jan 11, 2017 at 02:28 PM

183

avatar image
Former Member

Hi experts, I have a requirement to find out the organization structure ie hierarchical function module while input an employee no(pernr no) we need to get reporting manager, reporting manager's superior etc... and employees under the input pernr). Is there a function module that would fit the requirement.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

antoine foucault Jan 13, 2017 at 11:43 AM
1

Hi Georwill:

Yes there is a standard FM for this; actually there are plenty but the one I usually refer to us RH_STRUC_GET.

You use it together with an evaluation path (WEGID) that you have to choose. WEGID are available in table T778A (go to SM30), so you choose carefully the one that best fit your need. Some WEGIDs start from a PERNR as input other from an Organizational Unit, other from other type of OM object.

You can also make one, but since you ask for this kind of basic HR programing I would recommend go for the standard option.

For the reporting manager you can use for instance WEGID BOSSONLY Chief of organizational unit starting with the organizational unit of your PERNR, or use first P-S-O Direct organizational assignment of a person starting with PERNR to get the organization unit and then BOSSONLY... or also skip PSO and use P0001-ORGEH field... many options; many threads on this subject out there to help you.

          CALL FUNCTION 'RH_STRUC_GET'
            EXPORTING
              act_otype        = "object type you start with
              act_objid        = "object ID you start with
              act_wegid        = "your chosen evaluation path
              act_int_flag     = abap_false
              act_plvar        = "your active plan variant -> usuario "01"
              act_begda        = "your validity startdate
              act_endda        = "your validity enddate
              text_buffer_fill = abap_true
              buffer_mode      = abap_true
            TABLES
              result_struc     = "your result
            EXCEPTIONS
              no_plvar_found   = 1
              no_entry_found   = 2
              OTHERS           = 3.

Share
10 |10000 characters needed characters left characters exceeded