on 02-03-2014 3:51 PM
We are working in CRM 7.0. I'm trying to find all Business Partners, that are assigned as an lead creation/update email recipients in our system for certain job roles - ic_agent, etc. Opening each org unit would take way too long. Thanks for any guidance you can provide.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joel,
You have to develop a function module like this:
Hi Joel,
You have to develop a function module like this:
FUNCTION ZSEARCH_EMAIL_RECIP.
*"----------------------------------------------------------------------
*"*"Interfase local
*" IMPORTING
*" REFERENCE(P_SHORT_D) TYPE SHORT_D
*" TABLES
*" T_EMPLOYEES STRUCTURE SWHACTOR
*"----------------------------------------------------------------------
* Global data declarations
DATA: lt_struc_total TYPE TABLE OF struc,
ls_struc_total TYPE struc,
ls_struc_aux TYPE struc,
lt_leading_pos TYPE TABLE OF hrobject,
ls_leading_pos TYPE hrobject,
lt_struc_employees TYPE TABLE OF swhactor,
ls_struc_employees TYPE swhactor,
ls_sel_object TYPE objec.
* With this function we get the main organizational unit
CALL FUNCTION 'RH_MACO'
EXPORTING
seark = p_sigla_org
plvar = '01'
otype = 'O'
IMPORTING
sel_object = ls_sel_object.
* With this function we get all the structure from main org. unit.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = ls_sel_object-otype
act_objid = ls_sel_object-objid
act_wegid = 'OO-S-BP'
TABLES
result_struc = lt_struc_total
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
* Loop over all the Organizational units behind main Org. unit.
LOOP AT lt_struc_total INTO ls_struc_total
WHERE otype = 'O'.
REFRESH: lt_leading_pos,
lt_struc_employees.
* find out all the leadin position (red man!!)
CALL FUNCTION 'RH_GET_LEADING_POSITION'
EXPORTING
plvar = '01'
otype = ls_struc_aux-otype
sobid = ls_struc_aux-objid
TABLES
leading_pos = lt_leading_pos
EXCEPTIONS
no_lead_pos_found = 1
OTHERS = 2.
* Loop over leading positions and get the employees.
LOOP AT lt_leading_pos INTO ls_leading_pos.
CALL FUNCTION 'RH_STRUC_GET'
EXPORTING
act_otype = ls_leading_pos-otype
act_objid = ls_leading_pos-objid
act_wegid = 'OO-S-BP'
TABLES
result_tab = lt_struc_employees
EXCEPTIONS
no_plvar_found = 1
no_entry_found = 2
OTHERS = 3.
LOOP AT lt_struc_employees INTO ls_struc_employees
WHERE otype = 'BP'.
MOVE-CORRESPONDING ls_struc_employees TO t_employees.
APPEND t_employees.
ENDLOOP.
ENDLOOP.
ENDLOOP.
SORT t_employees.
DELETE ADJACENT DUPLICATES FROM t_employees.
ENDFUNCTION.
Note: Maybe this FM has some errors, you have to adapt it.
Best regards.
Hello Jorge,
Thank you for your response. I was away from work until today to see your reply. I apolgize, but i don't quite get what you mean still, as i'm still learning this language. I'm not sure how to use the p_short_d to grab the main org unit. That's the value i need to export to SEARK in function RH_MACO right?
Thanks again for you help....Joel
Thank you for you quick response Jorge. I may have not been clear in my question. I'm trying to find out all the users in our CRM system, assigned to the position of email notification recipient. I can manually see each one by searching in SAP GUI t-code PPOMA_CRM or through the web UI, but don't see away to pull the a list of them. Any ideas?
Thanks,
Joel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Joel,
Each business role has a Authorization role (PFCG) assigned this PFCG role has to be assigned to the user assigned to business role. So, yo have only to open this PFCG role in PFCG transaction a find the users assigned in users tab.
Best regards.
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.