cancel
Showing results for 
Search instead for 
Did you mean: 

Component Usage - Make Data Visible

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

kavindra_joshi
Active Contributor
0 Kudos

Check this piece of code


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'

it should be something like this


call method iv_usage->bind_context_node
    exporting
     iv_controller_type = cl_bsp_wd_controller=>co_type_custom
     iv_name                 = 'Name of the component' "BT_126H_APPT/BTDatesCuco
     iv_target_node_name =  "Context Node Target
     iv_node_2_bind           =  "Context Node to bind

Just a bit of explanation about the parameters

iv_name is the name of the controller of the present component

iv_target_node_name is the name of the context node in that controller

iv_node_2_bind is the name of the context node of the used component

Regards

Kavindra

Former Member
0 Kudos

Hi,

Part of my issue has been resolved. The data binding was done correctly, the dates and duration data is being displayed correctly. I need to enter an item in the transaction and based on the item category, the service profile and response profile is being determined.

Now the problem I am facing is: although the dates and durations data is being determined based on the service profile and response profile, the service profile and response profile is not being displayed.

Can anyone suggest, how do I display this data? Even clicking the edit button is not helping.

Regards,

Abdullah Ismail.

kavindra_joshi
Active Contributor
0 Kudos

Accessing the entity by type casting focus-bo to Lr-entity seems to be an issue.

Try reading the entity of the appropriate context node from the appropriare context of the appropriate controller.This would fetch you the entity you want to access. If you access the right entity you would get the right relation data.

regards

kavindra