CRM and CX Blogs by Members
Find insights on SAP customer relationship management and customer experience products in blog posts from community members. Post your own perspective today!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
6,585

Table of Contents

  1. Pre-requisites
  2. Introduction
  3. Technical Implementation

  1. Pre-requisites

  This is a technical document aimed at developers having expertise in CRM ISU developments. The target audience for this document is expected to have good knowledge in SAP CRM Web UI programming.  

  1. Introduction

It is often a requirement for the clients to add the attachments to the Interaction Record in Web IC environment. As a standard solution form SAP for Utility clients, the business roles UTIL_IC/UTIL_SALES/UTIL_IC_REG/UTIL_IC_LEAN, does not provide this option. Here with this document we can learn how to integrate attachment section into Interaction Records with a very minimal development need.

  1. Technical Implementation:

SAP delivers a Generic UI component called “GS_CM” for handling the attachments in Web UI. We are going to leverage this component and integrate the same in Interaction Record. Refer to attachment GS_CM.JPG for the snapshot.

                          

     Following are the list of steps involved for integration:

  1. Create a new UI component ZICCMP_ATTACH.
  2. Add two component usages CUGSCM and CUGSCM_DET both referring to the component “GS_CM” and then add the interface view “Mainwindow”.
  3. Create an overview page ZICCMP_ATTACH/INRAttachOV and then assign View CUGSCM.MainWindow.
  4. Assign the above created overview page to the Mainwindow and then expose the same for use by other components.
  5. Add the following context nodes to the component controller of ZICCMP_ATTACH.
  Context Node

Base Entity

BTADMINH

BTAdminH

BTORDER

BTOrder

CMBO

CMBO

  1. For the context node CMBO we need to implement the ON_NEW_FOCUS method. Here we refresh the attachments whenever the Interaction Record is changed. Copy the following code.

method ON_NEW_FOCUS.
 
data:
    lr_qs                
type ref to cl_crm_bol_query_service,
    ls_cmbo_prop         
type crmt_cmic_rfolder_attr,
    lr_entity_col        
type ref to if_bol_entity_col,
    ls_admin_h           
type crmst_adminh_btil.

 
check focus_bo is bound.

  lr_qs = cl_crm_bol_query_service=>get_instance( cl_crm_cm_genil_comp=>gc_query_bo_link ).

  focus_bo->get_properties(
importing es_attributes = ls_admin_h ).
  ls_cmbo_prop-instid = ls_admin_h-guid.
  ls_cmbo_prop-typeid = ls_admin_h-object_type.
  ls_cmbo_prop-catid =
'BO'.                                "#EC NOTEXT* fill and fire query
  lr_qs->set_properties( ls_cmbo_prop ).
  lr_entity_col = lr_qs->get_query_result( ).
* set context node
  collection_wrapper->clear_collection( ).
  collection_wrapper->set_collection( lr_entity_col ).
endmethod.

  1. Create value node ‘Attributes’ in the component controller with the following attribute structure.

             DISPLAY

TYPE BOOLE_D,
           NEXT_RUN_REREAD

TYPE BOOLE_D,
           SINGLE_DOC_MODE

TYPE BOOLE_D,
           DOC_TEMPLATE_PROFILE

TYPE CRMT_TEMPL_PROFILE,
           FOLDER_TEMPLATE_NAME

TYPE CRMT_TEMPLATE_NAME.

  

  1. Now we have to bind the context nodes with component usage CUGSCM and CUGSCM_DET. Redefine WD_USAGE_INITIALIZE method and copy the following code.

method WD_USAGE_INITIALIZE.

 
DATA: lr_value_node TYPE REF TO cl_bsp_wd_value_node,
        ls_attr      
TYPE crmt_cm_comp_st,
        lr_attr      
TYPE REF TO crmt_cm_comp_st.


 
CASE iv_usage->usage_name.
   
WHEN 'CUGSCM' or 'CUGSCM_DET'.
     
CALL METHOD iv_usage->bind_context_node
       
EXPORTING
          iv_controller_type  = cl_bsp_wd_controller=>co_type_component
          iv_target_node_name =
'BTORDER'                   "#EC NOTEXT
          iv_node_2_bind      =
'PARENTNODE'.               "#EC NOTEXT


     
CALL METHOD iv_usage->bind_context_node
       
EXPORTING
          iv_controller_type  = cl_bsp_wd_controller=>co_type_component
          iv_target_node_name =
'CMBO'                "#EC NOTEXT
          iv_node_2_bind      =
'CMBUSOBJ'.               "#EC NOTEXT


      ls_attr-next_run_reread = abap_true.
     
GET REFERENCE OF ls_attr INTO lr_attr.
     
CREATE OBJECT lr_value_node
       
EXPORTING
          iv_data_ref = lr_attr.
      lr_value_node->if_bol_bo_property_access~set_properties( ls_attr ).
      me->typed_context->attributes->collection_wrapper->clear( ).
      me->typed_context->attributes->collection_wrapper->add( lr_value_node ).

     
CALL METHOD iv_usage->bind_context_node
       
EXPORTING
          iv_controller_type  = cl_bsp_wd_controller=>co_type_component
          iv_target_node_name =
'ATTRIBUTES'                "#EC NOTEXT
          iv_node_2_bind      =
'ATTRIBUTES'.               "#EC NOTEXT

 
endcase.endmethod.

  1. Add the Navigation link as shown in the attachment NavLink.JPG.   

Until the above step a re-usable component for attachment is created and now we need to integrate the same into Interaction record. The following steps will help us in doing the same.

  1. Enhance the standard component ICCMP_BT_INR with the enhancement set.

  1. Create component usage CUATTACH referring to component ZICCMP_ATTACH and then add the interface view ZICCMP_ATTACH/MainWindow.

 

  

  1. Now in the component controller we need to bind the context node. Redefine method WD_USAGE_INITIALIZE and copy paste the below code.

METHOD wd_usage_initialize.
 
CALL METHOD super->wd_usage_initialize
   
EXPORTING
      iv_usage = iv_usage.

 
CASE iv_usage->usage_name.

   
WHEN 'CUATTACH' .
     
CALL METHOD iv_usage->bind_context_node
       
EXPORTING
          iv_controller_type  = cl_bsp_wd_controller=>co_type_component
          iv_target_node_name =
'BTORDER'                   "#EC NOTEXT
          iv_node_2_bind      =
'BTORDER'.                  "#EC NOTEXT
 
ENDCASE.ENDMETHOD.

  1. Enhance ViewSet ICCMP_BT_INR/InrViewSet and add a new view area called Attachment

 

  

  1. Now assign view CUATTACH.ZICCMP_ATTACH/MainWindow to the above created view set.

  1. Save and activate the changes.

Now to test the output we need to login to CRM Web UI with any of the Utility web center role. After log in, confirm the business agreement and click on the Interaction Record work center. The output will be similar as shown in the attchement file InteractionRec.JPG.

The attachment block refreshes its content whenever a different interaction record is selected in the Last Interaction record table view

13 Comments
Labels in this area
Top kudoed authors