07-23-2010 9:08 AM
Hi Expert,
I have an ALV which has been developed using Object Oriented Programming. Now i need to enable the push button, that will enable the users to select any row they want. i have investigated and found the i need to update the field SEL_MODE with the value 'A' in order to have this functionality working.
i have tried with my obect to call the method set_table_for_first_display, but i'm getting an errror message saying that it is protected or unknown..
Can anyone let me know on how to enable this functionality?
Thank you very much.
Nitin
07-23-2010 9:11 AM
Hi ,
To enable Push button,
Handle this event BUTTON_CLICK of Cl_gui_alv_grid .
or u can use GET_SELECTED_ROWS method of CL_GUI_ALV_GRID for getting selected rows .
from that method u will get selected row indexes & Row ID's .
07-23-2010 9:32 AM
Hi,
refresh your objects when you use set_table_for_first_display.
IF gr_custom_container IS NOT INITIAL.
CALL METHOD gr_custom_container->free.
CLEAR gr_custom_container.
ENDIF.
CREATE OBJECT gr_custom_container
EXPORTING container_name = gv_container.
CREATE OBJECT gr_grid
EXPORTING i_parent = gr_custom_container.
CALL METHOD gr_grid->set_table_for_first_display
EXPORTING
is_layout = gs_layout
CHANGING
it_outtab = gt_zalcrdata
it_fieldcatalog = gt_catalog.
To get the selected rows you can use:
CALL METHOD gr_grid->get_selected_rows
IMPORTING
et_row_no = gt_roid.
* Data variables used
DATA: gr_custom_container TYPE REF TO cl_gui_custom_container,
gr_grid TYPE REF TO cl_gui_alv_grid,
gt_catalog TYPE lvc_t_fcat,
gt_roid TYPE lvc_t_roid,
gs_layout TYPE lvc_s_layo.
Best regards,
John