cancel
Showing results for 
Search instead for 
Did you mean: 

dropdown in select options

Former Member
0 Kudos

Hi experts,

Can a dropdown be displayed in a select option.

eg:

att type: awart- low awart-high

Can this awart-low and awart-high have a dropdown to select data instead of a search help.

Because when I tried to create a select option and added

wd_this->m_select_options->add_selection_field( i_id = 'FIELD'

it_result = lr_range_table

i_as_dropdown = abap_true

it_value_set = lt_value_set ).

It displays like a parameter eg: aat type dropdown box

Can you please help

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

Yes - drop-down always renders as a single field not a range.

you can see the code concerning this in method RENDER_SELECTION_SCREEN_ITEM of class CL_WDR_SELECT_OPTIONS.


     elseif i_field-m_as_dropdown = abap_true.
*       do the dropdown case
*       => add something to skip the sign option icon space
        prefix_id mc_invisible_element_id i_field-m_id id.
        lr_invisible_element = cl_wd_invisible_element=>new_invisible_element(
                                 id = id view = lr_cur_container->view ).
        lr_matrix_data = cl_wd_matrix_data=>new_matrix_data( element = lr_invisible_element ).
        lr_invisible_element->set_layout_data( lr_matrix_data ).
        lr_cur_container->add_child( lr_invisible_element ).

*       => add the dropdown as dropdownbykey
        prefix_id mc_dropdown_id i_field-m_id id.
        concatenate i_field-m_id '.LOW' into path.
        lr_dropdown = cl_wd_dropdown_by_key=>new_dropdown_by_key(
                        id                = id
                        bind_selected_key = path
                        read_only         = i_field-m_read_only
                        state             = state
                        explanation       = i_field-m_explanation
                        tooltip         = i_field-m_tooltip
                        view              = lr_cur_container->view ).
        lr_label_low->set_label_for( id ).
        lr_matrix_data = cl_wd_matrix_data=>new_matrix_data( element = lr_dropdown ).
        lr_dropdown->set_layout_data( lr_matrix_data ).
        lr_cur_container->add_child( lr_dropdown ).
      else.

Just one field and no option for any second 'HIGH' field.

Cheers,

Chris

Answers (0)