05-13-2010 8:52 AM
Hello,
I my alv grid display ( using CL_GUI_ALV_GRID) , i should be able to select only particular rows where one field is having a particular value.
Upon selection of these rows which match the criteria, i should update a Ztable.
please let me know how this could be done?
05-13-2010 9:01 AM
x_layout-box_fieldname = 'BOX'. " This will allow for Row Selection in ALV
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
i_callback_pf_status_set = 'STATUS'(008)
i_callback_user_command = 'USER_COMMAND'(009)
i_grid_title = 'Delivery Split'(010)
is_layout = x_layout
it_fieldcat = t_fieldcat
TABLES
t_outtab = t_final_alv
EXCEPTIONS
program_error = 1
OTHERS = 2.
*To select the Row Data
Loop at t_final_alv where BOX = 'X'.
Endloop.
05-13-2010 9:19 AM
hi,
use method get_selected_rows to get the selected of the ALV .
then read the final ITAB get the data update the ztable.
CALL METHOD C_ALV->GET_SELECTED_ROWS
IMPORTING
ET_ROW_NO = IT_SELECTED_ROWS.