Application Development 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: 

Function Module for determining whether an employee is manager

Former Member
0 Kudos

Hi,

Could anyone please let me know if there is a function module to determine whether a given employee is a manager in HR.

Regards,

Milan Thaker

5 REPLIES 5

Former Member
0 Kudos

you might have to create one on your own, which satisfies this requirement...

Fetch the employee details and check for your condition...

Former Member
0 Kudos

Hi Milan,

[Check this thread|;

Thanks,

Duy

Former Member
0 Kudos

Hi Milan,

well, I don't know if there's such a module function.

Nevertheless, you could search thru the organization in table HRP1001

- selecting OTYPE = 'S', RSIGN = 'A' and RELAT = '012' will give you the managed positions (OBJID)

- then, for every record in the former query, search for OTYPE = 'P' and VARYF = 'S ' concatenated with the OBJID retrieved in the previous step.

For example, if the organization is:

Department 1 --- ID 'S 50001122'

..Managed by --- ID 'P 00001999'

...then the records in table HRP1001 would look like:

OTYPE = 'S', OBJID = '50001122', RSIGN = 'A', RELAT = '012' //<-- meaning the department 1

OTYPE = 'P', OBJID = '00001999', VARID = 'S 50001122' // <-- meaning the personnel number who manages department 1

I hope this helps. Kind regards,

Alvaro

Former Member

Milan,

I think if you execute fm RH_GET_OBJECTS_OF_MANAGER by giving the username if it returns obj_tab then user is a manager

Thanks

Bala Duvvuri

MarcinPciak
Active Contributor
0 Kudos

To determine whether EE is manager, you should check relation of his position to position of other Employees. If he/she has any direct reports then he/she is manager for someone. So this goes like


"first determine EE's position

"then check position relation to other positions
call function 'RH_READ_INFTY_1001'
      exporting
        plvar            = '01'
        otype            = 'S'
        objid            = ee_position
        begda            = sy-datum
        endda            = sy-datum
        istat            = '1'
        subty            = 'B002'   "position which Reports to EE position
      tables
        i1001            = it_1001
      exceptions
        nothing_found    = 1
        wrong_condition  = 2
        wrong_parameters = 3
        others           = 4.

if it_1001[] is not initial.
   "is manager
else.
   "is not manager
endif.

Regards

Marcin