Skip to Content
avatar image
Former Member

Function modul to read PPOMA_CRM structure

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Apr 07, 2010 at 07:38 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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