Quantcast
Channel: SCN: Message List - SAP CRM: Webclient UI - Framework
Viewing all articles
Browse latest Browse all 7775

Re: CRM WEBUI. fields are getting refreshed on selecting value from search help

$
0
0

i'm using a component usage here. for three fields on the form view i have implemented the search help in the similar manner. when i select a value for one field the other two filed values are becomming blank

 

in the get_v

   CREATE OBJECT rv_valuehelp_descriptor
    TYPE
    cl_bsp_wd_valuehelp_navdescr
    EXPORTING
      iv_outbound_plug = 'OP_CPR_NO'.

 

 

in the op_cpr_no( )

 

   DATA:
        lv_title                       TYPE string.

  DATA:
        lref_context_node_so           TYPEREFTO cl_bsp_wd_context_node,
        lref_search_object             TYPEREFTO cl_crm_bol_dquery_service,
        lref_props                     TYPEREFTO if_bol_bo_property_access,
        lref_collection_wrapper_so     TYPEREFTO cl_bsp_wd_collection_wrapper.

  "Determine if F4 was clicked on low or high value ( In case the operator is between)
  "To know where to return the field.
*  CALL METHOD me->get_search_par_lowhigh( iv_htmlb_event_id = htmlb_event_ex->event_id ).

*  gv_parameter_index = extract_parameter_index( htmlb_event_ex ).
  lv_title = cl_crm_cmg_ui_tools=>get_text( cl_crm_cmg_ui_tools=>gc_text_f4partner ).

  IF me->gref_f4_cpr_popup ISNOTBOUND.
    me->gref_f4_cpr_popup =
               comp_controller->window_manager->create_popup(
                         iv_interface_view_name = 'SearchHelpWindow'
                         iv_usage_name = 'CUPartnerValueHelp'
                         iv_title = lv_title ).
  ENDIF.

  lref_context_node_so = me->gref_f4_cpr_popup->get_context_node( 'SEARCH' ).
  lref_collection_wrapper_so  = lref_context_node_so->collection_wrapper.
  lref_collection_wrapper_so->if_bol_bo_col~clear( ).
  lref_search_object = cl_crm_bol_dquery_service=>get_instance( 'BuilHeaderAdvancedSearch' ).
*Comment begin by z8ytu, father,mother for Baseline activities of SDP project

*  CALL METHOD lref_search_object->add_selection_param
*    EXPORTING
*      iv_attr_name = 'BIRTHDATE'
*      iv_sign      = 'I'
*      iv_option    = 'EQ'
*      iv_low       = ''
**     IV_HIGH      =
*    .
*Comment end by z8ytu, father,mother for Baseline activities of SDP project

  CALLMETHOD lref_search_object->add_selection_param
    EXPORTING
      iv_attr_name = 'MC_NAME1'
      iv_sign      = 'I'
      iv_option    = 'EQ'
      iv_low       = ''
*     IV_HIGH      =
    .

  CALLMETHOD lref_search_object->add_selection_param
    EXPORTING
      iv_attr_name = 'MC_NAME2'
      iv_sign      = 'I'
      iv_option    = 'EQ'
      iv_low       = ''
*     IV_HIGH      =
    .

  CALLMETHOD lref_search_object->add_selection_param
    EXPORTING
      iv_attr_name = 'CITY1'
      iv_sign      = 'I'
      iv_option    = 'EQ'
      iv_low       = ''
*     IV_HIGH      =
    .

  lref_props ?= lref_search_object.
  lref_collection_wrapper_so->if_bol_bo_col~add( lref_props ).

  me->gref_f4_cpr_popup->set_display_mode( if_bsp_wd_popup=>c_display_mode_surrounded ).
  me->gref_f4_cpr_popup->set_on_close_event( iv_view = me iv_event_name = 'F4_HELP_CPR_CLOSE' ).
  me->gref_f4_cpr_popup->open( 'CLEAR_ALL' ).

 

 

   METHOD eh_onf4_help_cpr_close.

 

   DATA:
        lv_outbound_plug  TYPE        seocmpname,
        lv_attr_name      TYPE name_komp.

  DATA:
        ls_bp             TYPE        crmst_header_object_buil.

  DATA:
        lref_col_wrapper  TYPEREFTO cl_bsp_wd_collection_wrapper,
        lref_current      TYPEREFTO if_bol_bo_property_access,
        lref_context_node TYPEREFTO cl_bsp_wd_context_node,
        lref_col          TYPEREFTO if_bol_bo_col,
        lref_qs           TYPEREFTO cl_crm_bol_dquery_service,
*        lref_bo           TYPE REF TO cl_crm_bol_entity, "if_bol_bo_property_access,
        lref_value        TYPEREFTOdata,
        lref_msg_service  TYPEREFTO cl_bsp_wd_message_service,
        ls_ztagr_register_attr    TYPE ztagr_register_attr,
       Lr_TRANSACTION            TYPEREFTO if_bol_transaction_context,
        lr_core            TYPEREFTO cl_crm_bol_core,
        lr_entity         typerefto cl_crm_bol_entity.

  INCLUDE: zi_reuse_customize_con.

  FIELD-SYMBOLS:
        <lv_value>        TYPEany.

* 1st check if PopUp was closed by OK Button
  lv_outbound_plug = gref_f4_cpr_popup->get_fired_outbound_plug( ).
  CHECK lv_outbound_plug = 'TOOVERVIEW'. "Otherwise PopUp/Search has been canceled

* Now get selected employee => current Entry in Collection of corresponding Context Node of Search Help (Component)
  lref_context_node = gref_f4_cpr_popup->get_context_node( iv_cnode_name = 'PARTNER' ).
  lref_col_wrapper = lref_context_node->collection_wrapper.
  lref_current ?= lref_col_wrapper->get_current( ).

  CHECK lref_current ISBOUND.
*   Get Properties of employee returned by Search Help
  lref_current->get_properties( IMPORTING es_attributes = ls_bp ).

*   Set BP into our Field
  lref_bo ?= me->typed_context->ztagr_register->collection_wrapper->get_current( ).
  lref_bo->reread( ).

  DATA: lv_idnumber TYPE bu_id_number.
  IF ls_bp-bp_number ISNOTINITIAL.
    SELECT idnumber
      INTO lv_idnumber
      FROM but0id
      WHERE partner = ls_bp-bp_number
      AND  ( type = lc_identificationcategory_cpr
       OR     type = lc_identificationcategory_apnr ).
    ENDSELECT.
  ENDIF.

   CALL METHOD lr_core->modify.
  ENDIF.
ENDMETHOD.

 

* If the Business Partner that was chosen has no CPR number
* it would be nice to explain this to the user
  IF lv_idnumber ISINITIAL.
    lref_msg_service = cl_bsp_wd_message_service=>get_instance( ).
    lref_msg_service->add_message(  iv_msg_type   = 'I'
                                    iv_msg_id     = 'ZUI'
                                    iv_msg_number = '004'  ).


Viewing all articles
Browse latest Browse all 7775

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>