Skip to Content

How to integrate attachments to Interaction Records

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







  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.
type ref to cl_crm_bol_query_service,
type crmt_cmic_rfolder_attr,
type ref to if_bol_entity_col,
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 ).

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








  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.


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

  CASE iv_usage->usage_name.
CALL METHOD iv_usage->bind_context_node
          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
          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
          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
          iv_controller_type  = cl_bsp_wd_controller=>co_type_component
          iv_target_node_name =
‘ATTRIBUTES’                “#EC NOTEXT
          iv_node_2_bind      =
‘ATTRIBUTES’.               “#EC NOTEXT


  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
      iv_usage = iv_usage.

  CASE iv_usage->usage_name.

CALL METHOD iv_usage->bind_context_node
          iv_controller_type  = cl_bsp_wd_controller=>co_type_component
          iv_target_node_name =
‘BTORDER’                   “#EC NOTEXT
          iv_node_2_bind      =
‘BTORDER’.                  “#EC NOTEXT

  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

You must be Logged on to comment or reply to a post.
  • Hi,

    Thanks for this document. I found it very helpfull, and it met exactly my needs. I have a problem, though, and maybe you could kindly help me. I now see the attachment block in the interaction record, but the fields are not editable. Do you have an idea where I went wrong?

    Thank you very much.


  • Hi,

    This document is the exact scenario we want to implement.  However I'm having a problem adding the context nodes as listed in step 5.  I also don't completely understand what is meant in step 4 by " then expose the same for use by other components."

    When I tried to perform step 5 it errors stating "BOL entity CMBO does not exist." I received this same error on the first 2 and resolved it by adding Models -> Model BT in the Runtime Repository Editor but the system doesn't allow for 2 models in this section. 

    Is there another Model which contains all 3 of these context nodes or have I misunderstood something in a previous step?

    Thanks for your help,

    Duane Chapman

    • Hello,

      Perhaps my response is late. Hopefully the below response helps if you have not figured out the solution yet.

      1) step -4, you can expose the window in the runtime repository. Edit runtime repository->right click on the Component interface ->Add mainwindow-> save changes.

      2) Step-5 ) In the runtime repository add model ONEORDER. This should resolve your context node issue.



      • Hello Gopal,

        The ONEORDER model step is the one I was missing, thank you.  Also, once working on step 6 there was an issue with FOCUS_BO not existing.  I used another wiki,, to determine how this parameter should be configured. 

        I have completed all the steps but the system dumps due to "incorrect implementation" of component controller.  I have retraced my steps and can't seem to find the cause. In step 12 the case returns an exception. I added extra lines to catch this exception but attachments view does not appear. In method iv_usage->bind_context_node there is a line which does not return an entity: LV_NODE_2_BIND = ME->IF_BSP_WD_COMPONENT_USAGE~GET_CONTEXT_NODE( IV_NODE_2_BIND ). Upon debugging further, the method IF_BSP_WD_COMPONENT_USAGE~GET_CONTEXT_NODE has lines:



        These lines do not return any controllers for when passed BTORDER as shown in your step 12 above.  Any ideas on what I'm missing?

        Thanks for your help,

        Duane Chapman

  • Hi Gopal,

    I have a requirement to make this Attachment assignment block as Tablink beside the "Notes" Tab link in the "Interaction Record". I have tried to implement it as per your document but I am unable to see the GS_CM buttons like "Add URL" ,"Advanced" etc

    Can you please let me know how to do this