Skip to Content
0
Former Member
Oct 04, 2010 at 09:16 AM

Query on CRM Inbox Search

25 Views

Hi All,

This is with respect to Inbox Search for CRM 2005.

We have customized "Assigned To" field so as to show all the employees under Call Center.

Following is the code to do this

DATA: lt_org_unit_list TYPE TABLE OF objec,

ls_org_unit_list TYPE objec,

lv_org_objid TYPE hrobjid,

ls_org_units TYPE crmst_aui_org_unit,

lv_org_unit TYPE objektid,

lv_key TYPE valpos,

ls_empl_ass TYPE crmst_aui_domvalues_dd,

lt_p1000 TYPE TABLE OF p1000,

lv_p1000 TYPE p1000,

lv_partner_guid TYPE bu_partner_guid,

lv_plan_version TYPE plvar,

lv_bp TYPE bu_partner,

lv_lines TYPE i,

lv_org_otype TYPE otype,

lv_call_center_id TYPE objec-stext.

  • Append Groups of the Agent

  • 1. Step: Get all assigned OrgUnits

CALL FUNCTION 'RH_STRUC_GET'

EXPORTING

act_otype = 'O'

act_objid = '50000607'

act_wegid = 'O-S-CP'

TABLES

result_objec = lt_org_unit_list

EXCEPTIONS

OTHERS = 3.

CHECK sy-subrc = 0.

DELETE lt_org_unit_list WHERE stext <> 'Call Center'.

LOOP AT lt_org_unit_list INTO ls_org_unit_list.

lv_call_center_id = ls_org_unit_list-objid.

ENDLOOP.

CLEAR: lt_org_unit_list,ls_org_unit_list.

  • Append Groups of the Agent

  • 1. Step: Get all assigned OrgUnits

CALL FUNCTION 'RH_STRUC_GET'

EXPORTING

act_otype = 'O'

act_objid = lv_call_center_id

act_wegid = 'OO-S-BP'

TABLES

result_objec = lt_org_unit_list

EXCEPTIONS

OTHERS = 3.

CHECK sy-subrc = 0.

DELETE lt_org_unit_list WHERE otype <> 'BP'.

lv_key = '0004'.

LOOP AT lt_org_unit_list INTO ls_org_unit_list.

lw_value-valpos = lv_key. "unique sequential number

lw_value-ddtext = ls_org_unit_list-stext.

APPEND lw_value TO c_responsibles.

lw_orgunit-key = lv_key. "reference to group created in c_responsibles

lw_orgunit-otype = ls_org_unit_list-otype.

lw_orgunit-objid = ls_org_unit_list-objid.

lw_orgunit-stext = ls_org_unit_list-stext.

APPEND lw_orgunit TO c_org_units.

lv_key = lv_key + 1.

ENDLOOP.

The problem is when I am selecting an employee from the drop-down, it does not show the correct results i.e. it does not show the records for that employee, instead it populates all the records for that Call Center.

Can someone please let me know what am I missing.

Thanks,

Nikhil