版权声明:署名,允许他人基于本文进行创作,且必须基于与原先许可协议相同的许可协议分发本文 (Creative Commons)
you can use the function module RH_STRUC_GET to read information from the org model:
* read all org units a specific user is assigned to
call function 'RH_STRUC_GET'
exporting
act_otype = 'US'
act_objid = lv_username "e.g. sy-uname
act_wegid = 'US_CP_O'
tables
result_tab = lt_result "all org units the user is assigned to
exceptions
others = 3.
delete lt_result where otype <> 'O'.
* get all employees who are assigned to an org unit
call function 'RH_STRUC_GET'
exporting
act_otype = 'O'
act_objid = lv_org
act_wegid = 'OO-S-BP'
act_plvar = lv_plvar
tables
result_tab = lt_result " all employees that are assigned to an org unit
exceptions
others = 0.
delete lt_result where otype ne 'BP' .
There are a lot of other combinations possible. But please keep in mind this FM is not really fast.