cancel
Showing results for 
Search instead for 
Did you mean: 

CRM_ERMS_MAIL_COMPOSE - Getting data from previous service request

former_member223320
Participant
0 Kudos

Hi,

I am using the FM CRM_ERMS_MAIL_COMPOSE to send the personalized email. This FM internally calls another FM CRM_ERMS_MAIL_COMPOSE_NEW where it fills the mailform attributes with the actual data to compose the complete email.

The problem is, CRM_ERMS_MAIL_COMPOSE_NEW will check if there is any service request available in //currentservicerequest/btorderheader. This context has the previously opened service request number and it will compose the email for that service request number.

I am not sure how we can get the context //currentservicerequest/btorderheader to have the newly opened service request which is active now.

Request you to help me with this. Thanks a lot!

-Ricky.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member223320
Participant
0 Kudos

Hi Sigrid,

Thank you for the response!

I know it will be filled automatically in IC WebClient scenario. I will explain my issue in detail.

In Solution Manager, I have implemented EXEC_METHODCALL_PPF to send out the email notifications. In the implementation, I am using

the FM: CRM_ERMS_MAIL_COMPOSE, which will internally call the FM: CRM_ERMS_MAIL_COMPOSE_NEW. In this FM, this is the code from Line# 575.

SELECT SINGLE scenario scenario_type FROM  crmc_im_scen CLIENT SPECIFIED INTO ls_cust_scenario  
        WHERE    scenario = cust_scenario.          "#EC *

    IF ls_cust_scenario-scenario_type EQ 'SQM'.
*   Get current Service Request tracking text
      TRY.
          lr_bdc = cl_crm_ui_data_context_srv=>get_instance( ).
          lr_order_props = lr_bdc->get_entity_by_path( '//CURRENTSERVICEREQUEST/BTOrderHeader' ). "#EC NOTEXT
          IF lr_order_props IS BOUND.
           CALL METHOD LR_ORDER_PROPS->GET_PROPERTY_AS_VALUE
           EXPORTING
             IV_ATTR_NAME = 'OBJECT_ID' "#EC NOTEXT
           IMPORTING
             EV_RESULT    = lv_srqid .
          ENDIF.
          CATCH cx_root.
      ENDTRY.<br>

Here, it is trying to fetch the active incident number (which is currently open now) from the context //CURRENTSERVICEREQUEST/BTOrderHeader. The problem is, the context node does not have the current incident number. It has the previously opened incident number. And, I observed that this context node will be updated with the active incident number after I save the incident.

Just wanted to understand, how I can get the //CURRENTSERVICEREQUEST/BTOrderHeader to have the current incident (before saving).

Thanks!

-Ricky.

Sigrid
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

The context //currentservicerequest/btorderheader refers to the global data context. In business roles of profile type B IC Web Client, the global data context is filled automatically and is closely related to the activity clipboard (function profile ID CRMUI_CLIPBOARD).

For example, you can read the currentcustomer from the global data context

lr_gdc ?= cl_crm_ui_data_context_srv=>get_instance( iv_controller = me ).
lr_entity ?= lr_gdc->get_entity( name = if_iccmp_global_data_cont_con=>gdc_currentcustomer ).