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: 

How to get the level1,level2 and level3 manager for the employees refering?

Former Member
0 Kudos

How to get the level1,level2 and level3 manager for the employees refering?

3 REPLIES 3

Former Member
0 Kudos

call function 'RH_READ_INFTY'

exporting

plvar = '01'

otype = 'P'

objid = p_pernr

infty = '1001'

subty = 'B008'

begda = sy-datum

endda = sy-datum

tables

innnn = t1001 .

sort t1001 by begda descending .

read table t1001 with key objid = p_pernr

otype = 'P'

rsign = 'B'

relat = '008'

sclas = 'S'.

if sy-subrc = 0.

v_sobid1 = t1001-sobid.

call function 'RH_READ_INFTY'

exporting

plvar = '01'

otype = 'S'

objid = v_sobid1

infty = '1001'

subty = 'A003'

begda = sy-datum

endda = sy-datum

tables

innnn = t1002 .

endif.

sort t1002 by begda descending .

read table t1002 with key objid = v_sobid1

otype = 'S'

rsign = 'A'

relat = '003'

sclas = 'O'.

if sy-subrc = 0.

v_sobid2 = t1002-sobid.

call function 'RH_READ_INFTY'

exporting

plvar = '01'

otype = 'O'

objid = v_sobid2

infty = '1001'

subty = 'A002'

begda = sy-datum

endda = sy-datum

tables

innnn = t1003 .

endif.

sort t1003 by objid.

read table t1003 with key objid = v_sobid2

otype = 'O'

rsign = 'B'

relat = '012'

sclas = 'O'.

If sy-subrc = 0.

v_sobid2 is the first level ID

  • get sobid from t1003-sobid and again pass

this to the above FM('RH_READ_INFTY') ..

U'll get 2nd level from here ..

similarly get the third using FM('RH_READ_INFTY') ...

passing sobid from above step ..

endif.

Former Member
0 Kudos

get the organization for the manager and get the organization to organization relation A002

Former Member
0 Kudos

Hi,

1. Fetch the manager using the SAP Standard FM RH_STRUC_GET using otype as u2018Ou2019,objid as current Org unit & evaluation path as u2018BOSSONLYu2019 .

2. The export tables does contain the Chief positions as well as Holders.

3. Check for the valid records and exit the process with the holder else process the same FM RH_STRUC_GET for upper org

Unit using otype as u2018Ou2019 & objid as current Org unit & evaluation

path as u2018A002u2019. Recursively 3 times call FM till we get the chief position using upper orgunit.

cheers,

jacks.