on 05-22-2006 8:33 PM
I have a very simple ALV table in a view in my application. The view also contains a button. On clicking the button, I need to add code to the method to determine the row number selected in the ALV table. Someone suggested using:
DATA lt_selected_rows TYPE lvc_t_roid .
DATA ls_selected_row TYPE lvc_s_roid .
CALL METHOD gr_alvgrid->get_selected_rows
IMPORTING
et_row_no = lt_selected_rows .
READ TABLE lt_selected_rows INTO ls_selected_row INDEX 1 .
IF sy-subrc ne 0 .
ENDIF
but the code is missing the declaration and the initialization of the variable gr_alvgrid.
Any help would be truly appreciated.
OK, I added the data declaration. My module now looks like:
METHOD onactiondelete_row .
DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid.
DATA lt_selected_rows TYPE lvc_t_roid .
DATA ls_selected_row TYPE lvc_s_roid .
CALL METHOD gr_alvgrid->get_selected_rows
IMPORTING
et_row_no = lt_selected_rows.
READ TABLE lt_selected_rows INTO ls_selected_row INDEX 1 .
IF sy-subrc NE 0 .
ENDIF.
ENDMETHOD.
I get a dump on the call method:
OBJECTS_OBJREF_NOT_ASSIGNED
Please help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi DeNuto,
Try using:
DATA gr_alvgrid TYPE REF TO CL_GUI_ALV_GRID.
Regards,
Srini.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.