cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP CRM - How to get current activity in IC from a different UI component

1,547

Hi experts,

I need to access an activity data from an UI component. I have to implement some code in CRMCMP_EMAIL/MailSearchResultView but first, I need to have access to the current activity data in IC (BT125H_TASK UI Component). So here is the scenario: The operator confirm a BP, then search an activity (Navigation Bar--> Search activity), then goes in edit mode, after that click on Email Outbounding (Navigation Bar-->Email)...and here is where I need to intervene to implement my code and I need to access the current activity data which is in edit mode. I tried to use

lr_gdc ?= cl_crm_ui_data_context_srv=>get_instance( me )

but can't get any data regarding the current activity in IC. But if I repeat the same process with Service Request instead of activity (Navigation Bar--> Search Service Request), it gave perfectly the entity of current service request. what am I missing?

Does anyone know which of the following Global Custom Controller provides me the entity of the activities?

GLOBAL.CRM_IC/CategoryController”

GLOBAL.ICCMP_CM/CuCoCm”

GLOBAL.CRMCMP_BPIDENT/CuCoBuPa”

GLOBAL.ICCMP_BT_GLOBAL/CuCoBT”

GLOBAL.ICCMP_BT_GLOBAL/CuCoDeBT”

GLOBAL.ICCMP_FAXLETTER/CuCoFaxLetter”

GLOBAL.CRMCMP_IC_FRAME/CuCoHiddenView”

GLOBAL.ICCMP_IBASE/cucoibase”

GLOBAL.ICCMP_BT_GLOBAL/CuCoIRec”

GLOBAL.CRMCMP_CCS_EML/MailCuCo”

GLOBAL.ICCMP_BT_GLOBAL/CuCoProcess”

GLOBAL.ICCMP_PROD_GLOB/CucoProduct”

GLOBAL.ICCMP_GLOBAL/CuCoUI”

GLOBAL.ICCMP_EMP_SRCH/CuCoEmp”

GLOBAL.ICCMP_AUTO_VEHI/VEHICuco’

I also tried:

DATA: LV_CC TYPE REF TO CL_BT125H_T_TASKDETAILSCU_IMPL.

LV_CC ?= GET_CUSTOM_CONTROLLER( 'GLOBAL.BT125H_TASK/TaskDetailsCuCo' ).

but the BSP application crashes. Any suggestion?

appreciate your time and attention in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

corrine_guan
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello Amir,

I enhanced the view CRMCMP_EMAIL/MailSearchResultView, implement the EH_ONSELECT method. The codes inside this method will be:

CALL METHOD SUPER->EH_ONSELECT
EXPORTING
htmlb_event = htmlb_event
htmlb_event_ex = htmlb_event_ex
.
DATA: lr_gdc TYPE REF TO if_crm_ui_data_context,
lr_entity TYPE REF TO if_bol_bo_property_access.
TRY.
lr_gdc ?= cl_crm_ui_data_context_srv=>get_instance( iv_controller = me ).
CATCH cx_root.
RETURN.
ENDTRY.

TRY.
lr_entity ?= lr_gdc->get_entity( name = if_iccmp_global_data_cont_con=>GDC_CURRENTCONTEXT ).
CATCH cx_root.
RETURN.
ENDTRY.

---------------------------

What I did is the same as yours:

  1. confirm an account
  2. Search an acitivty, display and then edit it
  3. Go to Email view, click 'search' on 'standard responses' blog.
  4. In the pop up dialog, make a search, then select an entry from result list.
  5. Then in my method EH_ONSELECT, we can debug into statement: lr_entity ?= lr_gdc->get_entity( name = if_iccmp_global_data_cont_con=>GDC_CURRENTCONTEXT ).

I compared the entries in gt_entity, there are 4 entries with names:

CURRENTCUSTOMER, CURRENTIREC, CURRENTBT, CURRENTCONTEXT

I compared the GUID of them, the one for CURRENTCONTEXT is the activity I edited just now.

This CURRENTCONTEXT is set when click 'Edit' button on the activity view. From the callstack in attached picture we can know more. You can compare the callstack to check why the activity is not there.

Best Regards, Corrine