Skip to Content
0
Former Member
Jan 02, 2012 at 01:15 PM

Component Usage - Make Data Visible

28 Views

Hi Experts,

I have used component SRQM_SLAPRO in complaints component BT120H_CPL. I have added the main window to the assignment block and it is visible. I have also enhanced the component controller of BT120H_CPL and added the following code in the method WD_USAGE_INITIALIZE.


CALL METHOD SUPER->WD_USAGE_INITIALIZE
  EXPORTING
    IV_USAGE = IV_USAGE
      .

case iv_usage->usage_name.
  when 'CUSRQMSLAPro'.
    constants:
      lc_set_cn_cusrqmslapro type string value 'SET_CN_CUSRQMSLAPRO'
    .

    data:
      lv_pattern           type string,
      lv_btadminh          type string
    .

    super->wd_usage_initialize( iv_usage = iv_usage ).

    check iv_usage is bound.
    call method iv_usage->bind_context_node
      exporting
        iv_controller_type  = cl_bsp_wd_controller=>co_type_component
*        iv_name             = iv_name
        iv_target_node_name = 'BTADMINH'
        iv_node_2_bind      = 'BTADMIN'
        .

*    lv_btadminh = if_crm_srqm_uiu_const=>gc_btadminh.
*    me->mr_cnode_binding_mgr->initialize_usage_context_node( iv_usage            = iv_usage
*                                                             iv_method_name      = lc_set_cn_cusrqmslapro
*                                                             iv_target_node_name = lv_btadminh ).


endcase.

I am trying to add the SLA views here. It is being used in an another component SRQM_INCIDENT_H and I have tried to follow similar steps as in the standard component.

I also tried using the method SET_CN_CUSRQMSLAPRO


  data:
    lr_collection type ref to if_bol_bo_col,
    lr_entity     type ref to cl_crm_bol_entity
  .

  lr_entity ?= focus_bo.

  try.
      lr_collection = lr_entity->get_related_entities(
          iv_relation_name = 'BTHeaderItemsExt' ).          "#EC NOTEXT

      lr_entity ?= lr_collection->get_current( ).

      lr_collection = lr_entity->get_related_entities(
          iv_relation_name = 'BTServiceOrderItemsAll' ).            "#EC NOTEXT

    catch cx_crm_genil_model_error.
*       should never happen
      exit.
    catch cx_sy_ref_is_initial.
      clear lr_collection.
  endtry.

  me->mr_cnode_binding_mgr->set_usage_cnode_collection(
    iv_usage_name       = iv_usage_name
    iv_target_node_name = 'BTADMIN'
    ir_collection       = lr_collection
  ).       

But this too does not work.

The following screen shots will display the behavior of [standard|https://picasaweb.google.com/115348274351558599219/SAPCRMUI#5693021182331643490] and my [custom|https://picasaweb.google.com/115348274351558599219/SAPCRMUI#5693021183688888258] component usage. While debugging, I found that the BTHeaderItemsExt does not have any relations.

Can anyone please advise how do I go about it?

Regards,

Abdullah Ismail.