Table of Contents |
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.
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.
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:
Context Node | Base Entity |
BTADMINH | BTAdminH |
BTORDER | BTOrder |
CMBO | CMBO |
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.
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.
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.
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.
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.
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 a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.