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

Function module to get Manager

Former Member
0 Likes
3,242

Hi Friends,

Is there any function module which can return name of Manager based on employee's userid i.e. pass employee User id as import parameter and get Manager details as export parameter.

Thanks and Warm Regards.

Pras

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,694

Hello,

You can use FM SWX_GET_MANAGER for that. When you want to use this in a workflow step then use rule 168.

This FM makes use of the FM RH_ACT_LEADING_POSITION.

Hopefully it helps you a bit further

Kind regards,

Peter

7 REPLIES 7
Read only

Former Member
0 Likes
1,695

Hello,

You can use FM SWX_GET_MANAGER for that. When you want to use this in a workflow step then use rule 168.

This FM makes use of the FM RH_ACT_LEADING_POSITION.

Hopefully it helps you a bit further

Kind regards,

Peter

Read only

0 Likes
1,694

RH_GET_LEADING_POSITION is the function module that is used to get the info, provided you maiantained your org structure.

Cheers,

Ramki Maley.

Read only

0 Likes
1,694

Hi Peter / Ramki,

Thanks for the tips. Yes, I am using RH_GET_LEADING_POSITION. When I pass all values required for the above function module, I get a table LEADING_POS having columns PLVAR, OTYPE and OBJID. Thats fine.

My original question is how do I find USERID for OBJID returned in this function module. For example -

PLVAR = 01

OTYPE = S

OBJID = 50000131 ( I want userid associated with it - i.e. MANAGER).

Hope it is clear.

Thanks and Warm Regards.

Pras

Read only

0 Likes
1,694

Use the fm RH_STRUC_GET

with

act_otype = S in your case

act_objid = 50000131 in your case

act_wegid = 'SAP_US_S'

act_int_flag = ' '

table result_tab return found values

Read only

0 Likes
1,694

Thanks Peter,

It worked. You are a star.

I am awarding full points to you buddy.

Warm Regards.

Pras

Read only

0 Likes
1,694

As Peter pointed out Rule 168 does exactly that. If you look at the code in the rule FM SWX_MANAGER, you would see that FM RH_STRUC_GET is called to convert the objid to user id.

Cheers,

Ramki Maley.

Read only

0 Likes
1,694

Thanks Ramki.

As always, I know you are there to help me.

Warm Regards.

Pras