Skip to Content
0
Former Member
Aug 26, 2008 at 01:33 PM

How to integrate a Search Help in a dynamically created Select-Option?

469 Views

I implemented a WebDynpro Component, which has an input field for COUNTRY and a select-option (component WDR_SELECT_OPTIONS) for VENDOR. This vendor is depending on the selected country.

So I implemented a customer value help (based on interface IWD_VALUE_HELP), which only displays the vendors of the selected country. This works pretty fine as long as I use this value help component for statically defined input fields, where I have set the attributes of the according context attributes "Input Help Mode" (="Freely Programmed") and "Input Help Component Usage".

The select-option is created at runtime as follows within the hook method WDDOINIT:

  DATA:
    lr_usage            TYPE REF TO if_wd_component_usage,
    lr_if_controller    TYPE REF TO iwci_wdr_select_options,
    lt_range            TYPE REF TO data.


* initialize select option component
  lr_usage = wd_this->wd_cpuse_vco_selectoption( ).
  IF lr_usage->has_active_component( ) IS INITIAL.
    lr_usage->create_component( ).
  ENDIF. "IF lr_usage->has_active_component( ) IS INITIAL



* initialize selection screen
  lr_if_controller = wd_this->wd_cpifc_vco_selectoption( ).
  wd_this->mr_selopt = lr_if_controller->init_selection_screen( ).

  wd_this->mr_selopt->set_global_options(
                                   i_display_btn_cancel  = abap_false
                                   i_display_btn_check   = abap_false
                                   i_display_btn_reset   = abap_true
                                   i_display_btn_execute = abap_false ).


  lt_range = wd_this->mr_selopt->create_range_table(
                                      i_typename = '/BIC/OIBI_VENDOR' ).
  wd_this->mr_selopt->add_selection_field(
        i_id              = 'VENDOR'
        it_result         = lt_range
        i_description     = 'Vendor'
*{"experimental
        i_value_help_type = if_wd_value_help_handler=>co_prefix_appldev
        i_value_help_id   = 'SH_VENDOR'
*}"experimantal
        ).

The hook method WDDOINIT is processed successfully, but as soon as I click on the button for the input help, the WebDynpro dumps with an UNCAUGHT_EXCEPTION Exception CX_WDR_RR_EXCEPTION. In the browser window the following message is processed:

"Component usage SH_VENDOR does not exist."

Where is my mistake? How can I use the value help in my select-option?

Thanks for any advice!

--MIKE