cancel
Showing results for 
Search instead for 
Did you mean: 

Function modul to read PPOMA_CRM structure

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Thanks a lot - very helpfull answer.

Is there also a Function module to get the user of the employee master?

Thank you

Best regards

Manfred

Former Member
0 Kudos

You can use FM CRM_CENTRALPERSON_GET to get Business partner related to user or to get user related to business partner.

Regards,

Priyanka

Edited by: priyanka ganapa on Apr 7, 2010 6:25 PM

Answers (0)