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

Multiple(dependent)Dropdown Listboxes in the ALV grid

Former Member
0 Likes
1,508

Hi All,

I have a query regarding the muliple Listboxes in the grid...

My reqmnt is..I have 3 List boxes..in the Grid...

For The first list box i will be having some values..after selecting one of the values for the first listbox..depending on that value,i need to read the different values for the second and depending on listbox1 and listbox2 i need to populate the values into listbox3.

The problem im facing is...populating the second & third listboxes..depending on the first one...

i have used Method:

CALL METHOD g_grid->set_drop_down_table in PBO

to have the dropdown table.(I'm Putting conditions to know whether the first listbox value is selected r not...n populating according to that value to the listbox table.)

and

CALL METHOD g_grid->check_changed_data

IMPORTING

e_valid = l_valid.

CALL METHOD g_grid->get_current_cell

IMPORTING

e_row = e_row

e_value = e_value

e_col = e_col

es_row_id = es_row_id

es_col_id = es_col_id

es_row_no = es_row_no.

TO know the changed data..n which row is changed...

But the values which are populated for the second list box are not coming...if i create new screen n grid then those values r coming...Can anyone please suggest a way...

Regards....

Hi All,

I have a query regarding the muliple Listboxes in the grid...

My reqmnt is..I have 3 List boxes..in the Grid...

For The first list box i will be having some values..after selecting one of the values for the first listbox..depending on that value,i need to read the different values for the second and depending on listbox1 and listbox2 i need to populate the values into listbox3.

The problem im facing is...populating the second & third listboxes..depending on the first one...

i have used Method:

CALL METHOD g_grid->set_drop_down_table in PBO

to have the dropdown table.(I'm Putting conditions to know whether the first listbox value is selected r not...n populating according to that value to the listbox table.)

and

CALL METHOD g_grid->check_changed_data

IMPORTING

e_valid = l_valid.

CALL METHOD g_grid->get_current_cell

IMPORTING

e_row = e_row

e_value = e_value

e_col = e_col

es_row_id = es_row_id

es_col_id = es_col_id

es_row_no = es_row_no.

TO know the changed data..n which row is changed...

But the values which are populated for the second list box are not coming...if i create new screen n grid then those values r coming...Can anyone please suggest a way...

Regards....

8 REPLIES 8
Read only

former_member194669
Active Contributor
0 Likes
1,254

> But the values which are populated for the second list box are not coming...if i create new screen n grid then those values r coming...Can anyone please suggest a way...

>

I am not sure this is right way. But i have done is by forcing the PBO

using


  call method cl_gui_cfw=>set_new_ok_code
    exporting
      new_code = 'DUMMY'.

Read only

0 Likes
1,254

Hi a®s,

U mean..after selecting the First listbox..we need some user interaction(PAI)..which inturn triggers the PBO..But even if u trigger PBO Automatically..

I dont think so..whether it solves my problem..r not..

Read only

0 Likes
1,254

After selecting the first list box you need to trigger the PBO and fill up the listbox values second & third in the PBO.

I think this will get work.

Read only

0 Likes
1,254

I have used that method..its not triggering PBO..of the custom container..more over its taking me out of screen...

I mean PBO is not trigeering..

Read only

0 Likes
1,254

and moreover if i create 3 containers..the changed values r coming ..but if i have single container..those values r not coming on to the contianer.

Read only

0 Likes
1,254

> and moreover if i create 3 containers..the changed values r coming ..but if i have single container..those values r not coming on to the contianer.

That means grid is not refreshed if you are using single container?

For triggering the PBO forcibily try to do this way


DATA: WA_EVENT TYPE CNTL_SIMPLE_EVENTS.

WA_EVENT = CL_GUI_ALV_GRID=>EVT_ENTER.
APPEND WA_EVENT TO T_EVENTS.

CALL METHOD <MY_GRID>->SET_REGISTERED_EVENTS
EXPORTING
EVENTS = T_EVENTS.

Now you should capture this event in DATA_CHANGED event

then go for NEW OK_CODE method that will trigger the PBO forcibly.

Read only

0 Likes
1,254

How u used evt_enter?its a protected method..

If so how to access that???

Read only

0 Likes
1,254

Sorry,

its


CALL METHOD alv_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_enter.

and also please look at program BCALV_TEST_GRID_EVENTS