Creation of WEB UI Component and navigation with standard component

...Previous

Double click on PARTNER view and in right hand side, right click on inbound plug and choose create. Give inbound plug name (e.g. FROMLINK).

Double click on implementation class of PARTNER view and implement the method DO_PREPARE_OUTPUT.

method DO_PREPARE_OUTPUT.
  
DATA:   lr_qs           TYPE REF TO cl_crm_bol_query_service,
              result          
TYPE REF TO if_bol_entity_col,
             lr_col           
TYPE REF TO if_bol_bo_col,
             lr_result        
TYPE REF TO if_bol_bo_col,
             lr_prop_bp    
TYPE REF TO if_bol_bo_property_access,
              lr_param_ent  
TYPE REF TO if_bol_bo_property_access,
       
lr_entity           type ref to cl_crm_bol_entity.
  
data: lv_bp type STRING,
        bp    
type bu_partner.
  
data: lt_param type CRMT_NAME_VALUE_PAIR_TAB,
        lwa_param 
type CRMT_NAME_VALUE_PAIR,
        lt_attr 
type standard table of char120,
        lwa_attr 
type char120..
  typed_context->PARTNER->build_table( ).
  
CALL FUNCTION 'CRM_ERMS_FIND_BP_FOR_USER'
    
EXPORTING
      IV_USER_ID = sy-uname
    
IMPORTING
      EV_BUPA_NO = bp.
  lv_bp = bp.
  lv_bp = 
'404849'.  "used constant business partner as no bp no. is assigned for                      this user
  lr_qs = cl_crm_bol_query_service=>get_instance( 'BuilHeaderSearch' ).
  lr_qs->set_property( iv_attr_name = 
'PARTNER' iv_value = LV_bp ).
  result = lr_qs->get_query_result( ).
  lr_entity = result->get_first( ).
  
if lr_entity is bound.
    result = lr_entity->get_related_entities( iv_relation_name = 
'BuilContactPersonRel' ).
  
endif.
  
free lr_qs.
  lr_qs = cl_crm_bol_query_service=>get_instance( 
'BuilHeaderSearch' ).
  
clear: lv_bp, bp.
  
refresh: lt_param.
  lr_param_ent = result->get_first( ).
  
WHILE lr_param_ent IS BOUND.
    lv_bp = lr_param_ent->get_property_as_string( iv_attr_name = 
'BP_NUMBER' ). 
    
IF lv_bp NE ''.
      lr_qs->set_property( iv_attr_name = 
'PARTNER' iv_value = LV_bp ).
      lr_result = lr_qs->get_query_result( ).
      
if lr_result is bound.
        typed_context->partner->collection_wrapper->add_collection( lr_result ).
      
endif.
    
ENDIF.
    lr_param_ent = result->get_next( ).
    
clear: lv_bp, bp.
  
ENDWHILE.
endmethod.

Save and activate.

Double click on LINK window and in right hand side, right click on outbound plug and choose create. Give outbound plug name (e.g. TOLIST)

Double click on OP_TOLIST method to implement.

method OP_TOLIST.
fire_outbound_plug( iv_outbound_plug = 
'TOLIST' ).
endmethod.

Double click on MainWindow and in right hand side, right click on inbound plug and choose create. Give inbound plug name (e.g. FROMLINK).

Step 6. Handling the event.

Double click on PARTNERLINK view and in right hand side, right click on event handler and choose create. Give event handler name (e.g. ONCLICK)

Double click on EH_ONONCLICK method to implement.

method EH_ONONCLICK.
    OP_TOLIST( ).
endmethod.

Step 7. Select fields to display from available fields.

Double click on PARTNER view. In right hand side select configuration tab. Click on EDIT. Provide the customizing request in the popup.

Select the fields which you want to display in output from available fields into displayed fields. Refer from given below screen. Click on Save.

Step 9. Adding custom component into standard component.

I am adding custom component (ZBP) in standard component (WCC_SLS_HOME). Go to transaction BSP_WD_CMPWB

In the field component enter a name for a standard component (e.g. WCC_SLS_HOME) and in field enhancement set enter a name enhancement set name (e.g. ZEH_SET).

You can also create a new enhancement set by providing enhancement set name and click on create

Enter the description and click on continue. Now click on display.

Note: If you created a new enhancement set, then maintain enhancement set in cluster view (transaction SM34) BSPWDVC_CMP_EXT and in maintenance view (transaction SM30) BSPWDV_EHSET_ASG for respective client.

Expand the view set WCC_SLS_HOME\SalesHome and navigate to the View Area, right-click on View Area and choose Add View.

In the field View choose the view which you created (e.g. ZBP.ZBP/LINK). Click on continue.

Expand the window and navigate to the main window, right-click on main window and choose Add View.

In the field View choose the view which you created (e.g. ZBP.ZBP/MainWindow). Click on continue. Click on save.

Click here to continue...

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image