Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Dropdown and Checkbox in Module Pool

Former Member
0 Likes
1,169

Hi Experts ,

I have a scenario where I need to fetch more than one record from a drop down list for a column in ALV Module Pool.

I am not able to find checkbox (or any other alternative)  along with the drop down values .

This is how the dropdown code looks like :

FORM set_dropdown .

   DATA : itab TYPE string OCCURS 0 WITH HEADER LINE .
   DATA: lt_dropdown TYPE lvc_t_drop,
         ls_dropdown TYPE lvc_s_drop.

SPLIT wa_delivery-bin AT ',' INTO TABLE itab.

   LOOP AT itab.
     ls_dropdown-handle = '1'.
     ls_dropdown-value = itab.
     APPEND ls_dropdown TO lt_dropdown.
   ENDLOOP.

   CALL METHOD o_grid->set_drop_down_table
     EXPORTING
       it_drop_down = lt_dropdown.


ENDFORM.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
795

Hi All,

Thanks for your suggestions. Happy to inform that I have been able to do this .However, there is a sloght modification. Instead of List Box drop down , I have use a Pop up with ALV  FM REUSE_ALV_POPUP_TO_SELECT.

It really suits the purpose.

3 REPLIES 3
Read only

Former Member
0 Likes
795

I do not have a way of doing what you want, but I do know that a list box is designed to select only 1 value.  You may have to write a customized dialog box with a table control to select multiple values from a list.

Read only

alex_campbell
Contributor
0 Likes
795

If you're using CL_GUI_ALV_GRID you can "fake" a checkbox by doing the following things:

  1. Set the field catalog parameter 'CHECKBOX' to 'X' for a CHAR1 column in your table. This will make the column display as a checkbox.
  2. Set the field catalog parameter 'STYLE' to cl_gui_alv_grid=>mc_style_enabled for the same column. This will make the column look like it's editable (it won't be greyed out)
  3. Set the field catalog parameter 'HOTSPOT' to 'X' for the same column. This will make the ALV raise the event HOTSPOT_CLICK when the checkbox is clicked
  4. Handle the event HOTSPOT_CLICK of the ALV object, and in the handler, toggle the value of the clicked row/column between 'X' and space.
Read only

Former Member
0 Likes
796

Hi All,

Thanks for your suggestions. Happy to inform that I have been able to do this .However, there is a sloght modification. Instead of List Box drop down , I have use a Pop up with ALV  FM REUSE_ALV_POPUP_TO_SELECT.

It really suits the purpose.