on 04-07-2010 7:31 AM
Hello,
i have the requirement to read all the employees / users assigned to specific orgunit in my own coding.
Do you know a function module which can be used for this?
Thank you
Best regards
Manfred
Hi Manfred,
You can use FM CRM_ORGMAN_ORGOBJECTS_FIND_2 (this is the same function module that is used in Org determination rule - to determine responsible employee of a org unit), to read all the employees assigned to a org unit. Fill ac_container parameter tables with Org unit values and actor_tab will have all the employees assigned to the org unit. actor_tab will have employees with personal id, pass the peronal id to FM BP_CENTRALPERSON_GET to get business partner guid.
Hope this helps.
Priyanka
Below is the sample code for the same
Fill responsible orgunits into i_container table
st_container-element = 'SA_RESPORG'. "Sales Responsible org unit.
st_container-value = l_value.
APPEND st_container TO i_container.
Get the Central persons of the responsible org unit
CALL FUNCTION 'CRM_ORGMAN_ORGOBJECTS_FIND_2'
TABLES
ac_container = i_container
actor_tab = i_actor_tab.
The central persons for org unit exists
LOOP AT i_actor_tab INTO st_actor_tab.
IF st_actor_tab-otype EQ 'CP'.
l_partner_id = st_actor_tab-objid.
Get GUID of CP
CALL FUNCTION 'BP_CENTRALPERSON_GET'
EXPORTING
iv_person_id = l_partner_id
IMPORTING
ev_bu_partner_guid = l_bp_guid.
Get BP number of CP
CALL FUNCTION 'BUPA_NUMBERS_GET'
EXPORTING
iv_partner_guid = l_bp_guid
IMPORTING
ev_partner = l_partner.
Fill BP number of employee responsible
st_emp = l_partner.
INSERT st_emp INTO TABLE i_emp.
ENDIF.
endloop.
Edited by: priyanka ganapa on Apr 7, 2010 1:09 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
1 | |
1 | |
1 | |
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.