05-24-2010 11:56 AM
Dear Friends,
I need your valuable expertise on OOPS ALV.
I am using OOPS ALV. The output is displayed as required.
The user then sorts the output by a particular column or multiple columns using the standard sort button on ALV GRID.
Then he is selecting a particular row on the new output. This is how he wants to proceed.
Then I am using get_selected_rows when the user presses a custom button which returns the index according to the new view, which is fine.
However, I only have my internal table which is not sorted.
Using the index in the Get_Selected_Rows doesnot help.
Is there a way to get the complete record or any other method to find the record which the user selects.
Kindly help.
Thank you,
Ishaq.
05-24-2010 12:14 PM
For OOPs ALV , For the screen where you have defined the container for ALV,
IN PAI call this method
CALL METHOD e_grid->check_changed_data .
Then you call the method
CALL METHOD e_grid->get_selected_rows
IMPORTING
et_index_rows = t_selected_rows.
the internal table t_selected_rows contains indexes of the rows selected.
05-24-2010 12:09 PM
Hi,
u can insert a new field in to the internal table like SEL. when the row is selected u can mark that filed as X for that row.
this way u can know which rows have been selected. that u can handle with the event in data change.
is that what u r asking for?
regards,
pavan.
05-24-2010 12:14 PM
For OOPs ALV , For the screen where you have defined the container for ALV,
IN PAI call this method
CALL METHOD e_grid->check_changed_data .
Then you call the method
CALL METHOD e_grid->get_selected_rows
IMPORTING
et_index_rows = t_selected_rows.
the internal table t_selected_rows contains indexes of the rows selected.
03-19-2015 11:09 AM
Its really the perfect answer.
So get the editable value after alv display by oops alv is after
call method grid->set_table_for_first_display (data : grid type ref to cl_gui_alv_grid)
Then in PAI only call the method
CALL METHOD e_grid->check_changed_data . (data : e_grid type ref to cl_gui_alv_grid )
only this much of code thn u ll get your value...I did and i got the answer...
Thanks
05-24-2010 12:41 PM
05-27-2010 6:30 AM
Hi,
I wil send u the sample code u just try managing ur code this way
gr_salv_table type ref to cl_salv_table
gr_selections type ref to cl_salv_selections
gt_rows type salv_t_row
gr_selections = gr_salv_table->get_selections( ).
gt_rows = gr_selections->get_selected_rows( ).
gt_rows will contain the selected rows.
05-27-2010 6:48 AM
Hi,
Use this code for Registering the values in alv to internal table
* Registering edit
CALL METHOD g_alvgd->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
the purpose of the register edit is to capture your grid and store the values in your internal table itself.
after that use the below code for the Selected Rows,
CALL METHOD g_alvgd->get_selected_rows
IMPORTING
et_index_rows = it_selected_rows.
IF it_selected_rows IS INITIAL.
MESSAGE text-m01 TYPE 'I'.
ELSE.
after this loop the it_selected_rows and do your code to achieve the output............ hope you are looking for this !!!