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 on table control column

Former Member
0 Likes
957

Hello All,

I need to give dropdown list on one column of table control. The value of this dropdown list varies on values of different column, which means values in list is not constant for all the rows.

Thanks & Regards

Prashant Gupta

8 REPLIES 8
Read only

Former Member
0 Likes
906

Hi,

I dont think this can be done in table control as the field in all rows share common properties such as F4 help. So if u assign a list of values to one row field it will reflect in all rows.

Regards

Karthik D

Read only

0 Likes
906

Hi,

With F4 help you can give different values to different rows using process on value request event, but i need with dropdown list...

Thanks

Prashant

Read only

0 Likes
906

In Dialog programming select the i/o field and in the Attributes check on the Dropdown checkbox (F2 key for attributes).

use f.m vrm_set_value to fill the list box

Read only

Former Member
0 Likes
906

Yes, I tried this one also, but i need to display different values for different rows...

Read only

0 Likes
906

Hi,

If you can populate different F4 help for different rows i think its no more difficult to do it as dropdown. Just check the Dropdown checkbox in the I/O field attributes and then on POV populate the F4 help according to the row number. Now it will display it in dropdown list. Remember that only F4 values are being displayed in dropdown lists.

Regards

Karthik D

Read only

0 Likes
906

in flow logic

PROCESS ON VALUE-REQUEST.

here it is for one field ..

but u can create n number.

FIELD sdyn_conn-carrid MODULE create_dropdown_box.

field -


in se38..

MODULE create_dropdown_box INPUT.

fill the field here

ENDMODULE.

Read only

Former Member
0 Likes
906

Hi Prashant,

It is possible using separate Dropdown handle for separate cells. If you are using cl_gui_alv_grid for your table control then you can try this method

set_drop_down_table



  DATA: lt_dropdown TYPE lvc_t_drop,
        ls_dropdown TYPE lvc_s_drop,
       go_grid_ctrl TYPE REF TO cl_gui_alv_grid,
       ls_alv_fc    TYPE lvc_s_fcat.

* First listbox (handle '1').
  ls_dropdown-handle = '1'.
  ls_dropdown-value = 'A'.
  APPEND ls_dropdown TO lt_dropdown.

  ls_dropdown-handle = '1'.
  ls_dropdown-value = 'B'.
  APPEND ls_dropdown TO lt_dropdown.

  ls_dropdown-handle = '1'.
  ls_dropdown-value = 'C'.
  APPEND ls_dropdown TO lt_dropdown.

  CALL METHOD go_grid_ctrl->set_drop_down_table
    EXPORTING
      it_drop_down = lt_dropdown.
 
 refresh lt_dropdown.
* Second listbox (handle '2').
  ls_dropdown-handle = '2'.
  ls_dropdown-value = 'D'.
  APPEND ls_dropdown TO lt_dropdown.

  ls_dropdown-handle = '2'.
  ls_dropdown-value = 'E'.
  APPEND ls_dropdown TO lt_dropdown.

  ls_dropdown-handle = '2'.
  ls_dropdown-value = 'F'.
  APPEND ls_dropdown TO lt_dropdown.

  CALL METHOD go_grid_ctrl->set_drop_down_table
    EXPORTING
      it_drop_down = lt_dropdown.

ls_alv_fc-drdn_field = '1'.  " For handle 1 ( so it will have A,B,C)

"for another cell give handle '2'.

By the above way you can set the handle to the cell accordingly

Cheers,

Kothand

Read only

Former Member
0 Likes
906

Hello

Actually when using F4 on POV, event is triggered but there is no event triggered when we use dropdown list

Prashant