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: 

cl_salv_table , how update the backend (like HANDLE_DATA_CHANGE in alv)

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member

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

4 REPLIES 4

Former Member
0 Kudos

nobody any ideas ... ?

Former Member
0 Kudos

I have the same problem, and no solution so far!

regards

Andreas

Former Member

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

0 Kudos

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