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: 

HR Functions - To find Managers in a Organisation

Former Member
0 Kudos

Hello,

I'm trying to locate the best functions to use , to find managers in an Organisation.

Not sure if there is just one function or I need to use a few of them togather.

I could get the data using select statements - not sure if this is the best way of doing things.

Many Thanks

6 REPLIES 6

Former Member
0 Kudos

Hello

There are two way to retrieve the manager based on what you want to retrieve,

1) If you want to retrieve based on the personnel number, you can use the FM SWX_GET_MANAGER

2) Say if you want to retrieve it based on the organizational unit, then use the FM "RH_STRUC_GET by passing the below parameters,

ACT_OTYPE = 'O'

ACT_OBJID = <Organization unit ID>

ACT_WEGID = 'BOSSONLY'

The return internal table RESULT_TAB will have the manager's employee number.

Hope this helps.

Regards

Ranganath

PS : Reward points for all useful answers.

0 Kudos

what parameters do I need for these functions ? Where can I find them?

Many Thanks

0 Kudos

Hello Sims,

Check this FM HRCM_ORGUNIT_MANAGER_GET it may help you.

Regards,

Kiran I

0 Kudos

Hello

To find the parameters to be passed open the transaction SE37 and give the Functions name referred in the last post. On pressing the display button in the next screen you can view the parameters details. I have given the parameters to be passed for the second FM, let me know if you need the same details for SWX_GET_MANAGER.

Regards

Ranganath

0 Kudos

Hi,

the parameters as an example would be good.

Thanks

0 Kudos

Hello

Here you go,

-


data : i_result type standard table of objec,

wa_result type objec.

Call function 'RH_STRUC_GET'

EXPORTING

ACT_OTYPE = 'O'

ACT_OBJID = PA0001-ORGEH

ACT_WEGID = 'BOSSONLY'

ACT_PLVAR = '01'

ACT_BEGDA = '18000101'

ACT_ENDDA = '99991231'

IMPORTING

RESULT_OBJEC = I_RESULT.

Read table I_RESULT into WA_RESULT with key OTYPE = 'P'.

if sy-subrc = 0.

v_manager_name = WA_RESULT-STEXT.

endif.

-


The above logic will provide you with the name of the manager for the given organization coming for an employee from infotype 0001 i.e. the table PA0001 and fields ORGEH.

Hope this helps !

Kind Regards

Ranganath