Application Development 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: 

Dropdown in ALV Grid (OO)

Former Member
0 Kudos

Hi All,

I am populating a dropdown in the ALV grid, Now I have a requirement to fill this dropdown when I press enter button after selecting a value in the grid for a previous column ,I have written the code for this but the values are not getting filled into the dropdown , I tried debug the program and found out that the internal table I am using to fill the dropdown is getting filled with correct values but when I am calling the function

CALL METHOD g_grid->set_drop_down_table

EXPORTING

it_drop_down_alias = lt_dropdown.

the values are not getting passed to that field in the grid.

Please help.

I am posting the code also.

DATA : lt_ct1_mat TYPE STANDARD TABLE OF eina .

DATA: ls_dropdown TYPE lvc_s_dral.

DATA : wa like line of lt_ct1_mat.

SELECT * FROM eina INTO TABLE lt_ct1_mat

WHERE matnr = l_partno.

IF NOT lt_ct1_mat[] IS INITIAL.

clear lt_dropdown[].

LOOP AT lt_ct1_mat into wa.

ls_dropdown-handle = '1'.

ls_dropdown-value = wa-lifnr.

APPEND ls_dropdown TO lt_dropdown.

CLEAR ls_dropdown.

ENDLOOP.

ENDIF.

CALL METHOD g_grid->set_drop_down_table

EXPORTING

it_drop_down_alias = lt_dropdown.

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Just check whether the you refreshing the ALV after you popuate the internal table.Refresh it with g_grid->refresh_table_display.

Hope this helps.

Regards,

Prasanth

*Reward all the helpful answers

4 REPLIES 4

Former Member
0 Kudos

Hi,

Just check whether the you refreshing the ALV after you popuate the internal table.Refresh it with g_grid->refresh_table_display.

Hope this helps.

Regards,

Prasanth

*Reward all the helpful answers

0 Kudos

Hi Prashant,

I have inserted the code as u said but now when ever I am pressing enter the selected value of the column where the dropdown is there is getting cleared out , please suggest what can be the solution for this

Former Member
0 Kudos

Hi,

Please check links,

Regards,

Hema.

    • Reward points if it is useful.

former_member208856
Active Contributor
0 Kudos

Hi,

You can take the help for ALV Dropdown programs from :

SE80>package>SLIS>Programs>BCALV_EDIT_06

& BCALV_EDIT_07

Sandeep