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

HCM - function module to get Manager - pernr

venkateswaran_k
Active Contributor
0 Likes
10,446

Dear All

Is there any function module that gives the Manager of Employee by providing Pernr as input.

We are maintaining the relationship A/B 002 in infotype 1001.

Regards,

Venkat

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,111

Hi ,

Write the below custom code and you should be good.

1. SELECT FROM PA0001 WHERE PERNR = personnelpersnumber PLANS = position of employee

2. SELECT FROM HRP1001 WHERE RSIGN = A RELAT = 002 OTYPE = 'S' OBJID = position_of_employee SCLAS = 'S': SOBID = manager position

3. SELECT FROM HRP1001 WHERE RSIGN = A RELAT = 008 OTYPE = 'S' OBJID = sobid of prev step SCLAS = 'P'.

SOBID of the second SELECT is personnel number of the manager

Not sure if the FM: SWX_GET_MANAGER does the authorization check.


Regards,

Harsh

4 REPLIES 4
Read only

former_member355261
Participant
0 Likes
4,111

Hi,

try using FM SWX_GET_MANAGER

Regards

Read only

Former Member
0 Likes
4,112

Hi ,

Write the below custom code and you should be good.

1. SELECT FROM PA0001 WHERE PERNR = personnelpersnumber PLANS = position of employee

2. SELECT FROM HRP1001 WHERE RSIGN = A RELAT = 002 OTYPE = 'S' OBJID = position_of_employee SCLAS = 'S': SOBID = manager position

3. SELECT FROM HRP1001 WHERE RSIGN = A RELAT = 008 OTYPE = 'S' OBJID = sobid of prev step SCLAS = 'P'.

SOBID of the second SELECT is personnel number of the manager

Not sure if the FM: SWX_GET_MANAGER does the authorization check.


Regards,

Harsh

Read only

venkateshorusu
Active Contributor
0 Likes
4,111

As far as i know we have function module get manger details where it gives you the relationship 002 details i.e 002 is considered as manger Try with RH_GET_Manager(RH*) you will get the list of function modules.

Am not next to the system i could not able to give you the exact one try with RH* you will get them.

Regards

Venkatesh

Read only

venkateswaran_k
Active Contributor
0 Likes
4,111

Thank You all for the solution.

I used Harsh suggestion and implemented it in my local function and using it throughout..

Regards,

Venkat