on 12-08-2010 2:14 PM
Hello All,
my requirement is, i have Employee responsible information with me like parnternumber and user name, now i want to determine who is his manager at Organisation Unit level.i need manager's partner number from Org unit.
I did following to achieve the same, but i could reach upto knowing the manager position but not the BP assigned to that position.
report 1.
*1. get Employee's position
data: objektid type objektid.
call function 'BBPU_GET_ORGSTRUCTURE_OF_USER'
exporting
username = sy-uname
importing
position_id = objektid
exceptions
no_org_data_found = 1
others = 2
.
*2.find leading position (pass Employee position)
*RH_GET_LEADING_POSITION (get leading position)
data: hrobject type table of hrobject,
wa_hrobject type hrobject,
sobid type hrsobid-sobid.
move objektid to sobid.
call function 'RH_GET_LEADING_POSITION'
exporting
plvar = '01'
otype = 'S'
sobid = sobid
tables
leading_pos = hrobject
exceptions
no_lead_pos_found = 1
others = 2
.
*3. get the manager number (pass leading position)
*RH_READ_INFTY_1001 (get manager number)
*data: lt_itab1001 type table of p1001.
*call function 'RH_READ_INFTY_1001'
exporting
authority = ' '
with_stru_auth = ' '
subty = 'A008'
begda = sy-datum
endda = sy-datum
tables
i1001 = lt_itab1001
objects = hrobject
exceptions
nothing_found = 1
wrong_condition = 2
wrong_parameters = 3
others = 4.
*if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
*endif.
read table hrobject into wa_hrobject index 1.
DATA lt_result_tab TYPE TABLE OF swhactor.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = wa_hrobject-otype
act_objid = wa_hrobject-objid
act_wegid = 'SAP_TAGT'
TABLES
result_tab = lt_result_tab[]
EXCEPTIONS
no_plvar_found = 01
no_entry_found = 02
OTHERS = 99.
write 'hi'.
======================
I tried using FMs 'RH_READ_INFTY_1001 and 'RH_STRUC_GET'
both are retrieving some unrelated data which i dont understand like
1 CP 00305880
I dont understand what is 00305880,manager's partner number is 50145725
please help me how do i get manager partner number using his position, is there any FM or table to get this?
Thanks
seema
problem resolved
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
I got the solution
report 1.
data: objektid type objektid.
call function 'BBPU_GET_ORGSTRUCTURE_OF_USER'
exporting
username = sy-uname
importing
position_id = objektid
exceptions
no_org_data_found = 1
others = 2
.
if sy-subrc <> 0.
endif.
data: hrobject type table of hrobject,
wa_hrobject type hrobject,
sobid type hrsobid-sobid.
move objektid to sobid.
call function 'RH_GET_LEADING_POSITION'
exporting
plvar = '01'
otype = 'S'
sobid = sobid
tables
leading_pos = hrobject
exceptions
no_lead_pos_found = 1
others = 2
.
if sy-subrc <> 0.
endif.
data: lt_itab1001 type table of p1001,
wa_p1001 type p1001.
CALL FUNCTION 'RH_READ_INFTY_1001'
EXPORTING
authority = 'DISP'
with_stru_auth = 'X'
plvar = '01'
OTYPE = wa_hrobject-otype
OBJID = wa_hrobject-objid
istat = ' '
extend = 'X'
subty = 'A008'
begda = sy-datum
endda = sy-datum
condition = '00000'
sort = 'X'
with_ev = ' '
adata = 'X'
auth_sobid = ' '
TABLES
i1001 = lt_itab1001
EXCEPTIONS
nothing_found = 1
wrong_condition = 2
wrong_parameters = 3
OTHERS = 4.
read table lt_itab1001 into wa_p1001 index 1.
clear: wa_p1001-otype, wa_p1001-objid.
move wa_p1001-SCLAS to wa_p1001-otype.
condense wa_p1001-SOBID.
move wa_p1001-SOBID to wa_p1001-objid.
clear lt_itab1001[].
CALL FUNCTION 'RH_READ_INFTY_1001'
EXPORTING
authority = 'DISP'
with_stru_auth = 'X'
plvar = '01'
OTYPE = wa_p1001-otype
OBJID = wa_p1001-objid
istat = ' '
extend = 'X'
subty = 'B207'
begda = sy-datum
endda = sy-datum
condition = '00000'
sort = 'X'
with_ev = ' '
adata = 'X'
auth_sobid = ' '
TABLES
i1001 = lt_itab1001
objects = hrobject
EXCEPTIONS
nothing_found = 1
wrong_condition = 2
wrong_parameters = 3
OTHERS = 4.
write 'hi'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
8 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.