12-04-2006 9:09 AM
Hello,
I create a Custom Control from an intern table. When i do a double click on a row, i call another dynpro. The data of the marked line should be written into an internal table.
How i implement this?
I tried things like:
Call method alv_list->GET_SELECTED_ROWS_BASE
or
Call method alv_list->GET_SELECTED_ROWS
12-04-2006 10:03 AM
Hi Sebastian,
For a double click event we need to register the double click event which goes the following way.
data: lref_alv type ref to cl_gui_alv_grid.
* after initializing ALV
SET HANDLER gref_application->handle_alv_dblclik FOR lref_alv.
Now this double click event needs to be handled in the local class.
eg:
CLASS lcl_application DEFINITION.
PUBLIC SECTION.
METHODS:
* Method to handle double click on ALV grid.............................
handle_alv_dblclik
FOR EVENT double_click
OF cl_gui_alv_grid
IMPORTING e_row
e_column
es_row_no.
endclass.
CLASS lcl_application IMPLEMENTATION.
*&---------------------------------------------------------------------*
* Method: HANDLE_ALV_DBLCLICK *
*&---------------------------------------------------------------------*
* Text: Event triggers when ALV grid is double clicked *
*&---------------------------------------------------------------------*
* -->e_row *
* -->e_column *
* -->es_row_no, *
*&---------------------------------------------------------------------*
METHOD handle_alv_dblclik.
data: lv_value(40) TYPE c.
* Get the value of the current cell double clicked......................
CALL METHOD gref_alv->get_current_cell
IMPORTING
e_value = lv_value
.
* here you can insert the values in the internal table
endmethod.
endclass.
hope this helps.
Regards,
Kinshuk
12-04-2006 9:23 AM
If you see the IMPORT parameters of the event double click It gives you the following information
E_ROW
E_COLUMN
ES_ROW_NO
That means you have the row no, and the column name on which the user has clicked. So, just read the internal table with the index of the row number and you should have the data.
Regards,
Ravi
Note - Please mark all the helpful answers
12-04-2006 9:53 AM
12-04-2006 10:22 AM
Please close the thread, by clicking on the answer which helped you the most.
Regards,
Ravi
Note - Please mark all the helpful answers
12-04-2006 10:03 AM
Hi Sebastian,
For a double click event we need to register the double click event which goes the following way.
data: lref_alv type ref to cl_gui_alv_grid.
* after initializing ALV
SET HANDLER gref_application->handle_alv_dblclik FOR lref_alv.
Now this double click event needs to be handled in the local class.
eg:
CLASS lcl_application DEFINITION.
PUBLIC SECTION.
METHODS:
* Method to handle double click on ALV grid.............................
handle_alv_dblclik
FOR EVENT double_click
OF cl_gui_alv_grid
IMPORTING e_row
e_column
es_row_no.
endclass.
CLASS lcl_application IMPLEMENTATION.
*&---------------------------------------------------------------------*
* Method: HANDLE_ALV_DBLCLICK *
*&---------------------------------------------------------------------*
* Text: Event triggers when ALV grid is double clicked *
*&---------------------------------------------------------------------*
* -->e_row *
* -->e_column *
* -->es_row_no, *
*&---------------------------------------------------------------------*
METHOD handle_alv_dblclik.
data: lv_value(40) TYPE c.
* Get the value of the current cell double clicked......................
CALL METHOD gref_alv->get_current_cell
IMPORTING
e_value = lv_value
.
* here you can insert the values in the internal table
endmethod.
endclass.
hope this helps.
Regards,
Kinshuk