cancel
Showing results for 
Search instead for 
Did you mean: 

multiple select options with searh help

0 Kudos

Dear Experts

We have a requirement to maintain select-options for multiple fileds with searh help in webdynpro abap.

I am  able to create select-options for multiple fileds using wdr_select_options componet usage.

for search help i have created the ovs and it's wokring.

Here may problem is like for ex : i have 3 fields in selction screen.

when i am selecting f4 for all 3 fiedls taking the first f4 help only..

Could anyone please suggest me How can i maintain the different search helps for diffrent inputs.

This is how i have created multiple fiedls in selection screen.

DATA: lt_range_table TYPE REF TO data,
        rt_range_table TYPE REF TO data,
        read_only TYPE abap_bool,
        typename TYPE string.
  DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.

  lo_cmp_usage = wd_this->wd_cpuse_select_options( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.
  wd_this->m_wd_select_options = wd_this->wd_cpifc_select_options( ).
  wd_this->m_handler = wd_this->m_wd_select_options->init_selection_screen( ).
*    * Setting Globle options
  wd_this->m_handler->set_global_options(
                               i_display_btn_cancel = abap_false
                               i_display_btn_check = abap_false
                               i_display_btn_reset = abap_false
                               i_display_btn_execute = abap_false ).
*  create a range table that consists of this new data element

  lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'ORGEH' i_length = 8 ).
  lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'OBJID' i_length = 8 ).
  lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'PERSONID_EXT' i_length = 8 ).

*  *  * * add a new field to the selection
  wd_this->m_handler->add_selection_field(
                    i_id = 'ORGEH'
                    i_description = 'Organizational unit'
                    it_result = lt_range_table
                    i_read_only = read_only
                    i_no_intervals = abap_true  " disable intervals
                    i_value_help_type = if_wd_value_help_handler=>co_prefix_ovs ).

  wd_this->m_handler->add_selection_field(
                   i_id = 'OBJID'
                   i_description = 'Job family'
                   it_result = lt_range_table
                   i_read_only = read_only
                   i_no_intervals = abap_true   " disable intervals
                   i_value_help_type = if_wd_value_help_handler=>co_prefix_ovs ).

*  * * add a new field to the selection
  wd_this->m_handler->add_selection_field(
                    i_id = 'PERSONID_EXT'
                    i_description = 'Holcim Id'
                    it_result = lt_range_table
                    i_read_only = read_only
                    i_no_intervals = abap_true  " disable intervals
                    i_value_help_type =  if_wd_value_help_handler=>co_prefix_ovs ).

And the is how able to generate the search help (example)..

  CASE i_ovs_data-m_ovs_callback_object->phase_indicator.

WHEN if_wd_ovs=>co_phase_0. i_ovs_data-m_ovs_callback_object->set_configuration( col_count = 2 table_multi_select = abap_true ).

WHEN if_wd_ovs=>co_phase_1.

** i_ovs_data-m_ovs_callback_object->set_input_structure( input = P0002 ).

WHEN if_wd_ovs=>co_phase_2. SELECT pernr vorna nachn INTO CORRESPONDING FIELDS OF TABLE lt_pernr FROM pa0002 UP TO 10 ROWS.

i_ovs_data-m_ovs_callback_object->set_output_table( output = lt_pernr ).

WHEN if_wd_ovs=>co_phase_3. ASSIGN i_ovs_data-m_ovs_callback_object->selection->* TO <lt_ovs_result>.

ASSIGN i_ovs_data-mt_selected_values->* TO <lt_sel_opt_result>. LOOP AT <lt_ovs_result> ASSIGNING <p0002> .

INSERT <p0002>-pernr INTO TABLE <lt_sel_opt_result>.

ENDLOOP. ENDCASE.

Thanks in Advance,

Ravi.

Accepted Solutions (1)

Accepted Solutions (1)

amy_king
Active Contributor
0 Kudos

Hi Vallepu,

I haven't tried this myself, but I think what you may be missing is...

  1. When you call wd_this->m_handler->add_selection_field( ) also pass in parameter I_VALUE_HELP_ID with the unique ID of the OVS component usage for that select-options field.
  2. Implement method ON_OVS for each unique OVS component usage.

Cheers,

Amy

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

My suggestion is try to creation individual OVS for individual field and assign appropriate OVS in their filed properties .

here, change the ovs component usage for individual fields.

Regards,

Venkat.

Former Member
0 Kudos

From what I could tell in this code, you are not distinguishing between different fields in the different phases. It seems you handling them all the same and as a result all of them will give you the same search help.