07-11-2008 12:18 PM
Hi there,
following situation:
I've placed two SALV grids ("A" and "B") among themselves inside two different custom containers on a classical dynpro.
The goal is to transfer datasets between these two salv's (sometimes this is called "flip flop").
To transfer the datasets between these two salv's , I've placed two buttons between the SALV's on the dynpro (OUTSIDE the salv's toobar).
By clicking one of these buttons the selected rows (datasets) should transfer from grid "A" to grid "B" and by clicking the
other button vice versa.
The problem is, that the backend is not updated and don't recognize the selected rows, so following
example code that's executed in PAI after clicking the dynpro button returns nothing:
" returns alv instance
method create_alv.
...
" set the selection mode to 'multiple'
r_selections->set_selection_mode( if_salv_c_selection_mode=>multiple ).
...
endmethod.
...
" PAI
" get selected rows for salv instance 'A'
r_alv_selections_A = r_alv_A->get_selections( ).
it_sel_rows = r_alv_selections_A->get_selected_rows( ).
So, is there any event or method that's update the backend ?
Thanks for help in advance !
Regards
Olaf
Edited by: Olaf Krüger on Jul 11, 2008 1:22 PM
Edited by: Olaf Krüger on Jul 14, 2008 7:48 AM
07-24-2008 3:04 PM
now I've found something that works for me:
call get_metadata( ) before you call get_selected_rows( ).
-
data:
gr_grid type ref to cl_salv_table,
lt_rows type salv_t_row,
ls_row like line of lt_rows.
....
gr_grid->get_metadata( ). "fetches metadata from frontent in PAI
lt_rows = gr_selections->get_selected_rows( ).
-
I call the whole stuff from a PAI- MODULE
07-14-2008 3:53 PM
07-24-2008 2:24 PM
07-24-2008 3:04 PM
now I've found something that works for me:
call get_metadata( ) before you call get_selected_rows( ).
-
data:
gr_grid type ref to cl_salv_table,
lt_rows type salv_t_row,
ls_row like line of lt_rows.
....
gr_grid->get_metadata( ). "fetches metadata from frontent in PAI
lt_rows = gr_selections->get_selected_rows( ).
-
I call the whole stuff from a PAI- MODULE
08-04-2008 1:30 PM
That's it, many thanks !!!
Olaf
Edited by: Olaf Krüger on Aug 4, 2008 2:30 PM
Edited by: Olaf Krüger on Aug 4, 2008 2:30 PM