2006 Aug 09 11:40 AM
Hi,
I have two editable ALV grids in my screen. I have created them thru custom containers. I want to know in which ALV my cursor is positioned. If I have selected a cell in first grid and then selected another cell in second grid, on executing get_current_cell fetching value for both the grids. How can I identify the cursor is in second grid and to execute the above method for the second grid only.
Thanks in advance.
With regards,
Vamsi
Hi,
I have two editable ALV grids in my screen. I have created them thru custom containers. I want to know in which ALV my cursor is positioned. If I have selected a cell in first grid and then selected another cell in second grid, on executing get_current_cell fetching value for both the grids. How can I identify the cursor is in second grid and to execute the above method for the second grid only.
Thanks in advance.
With regards,
Vamsi
2006 Aug 09 1:39 PM
Hi Vamsi,
As you have two alv grids, you also have two alv controls, with this you can get information of the selected rows or cells.
CALL METHOD grid1->get_selected_rows
IMPORTING et_row_no = i_row_no.
CALL METHOD grid2->get_selected_rows
IMPORTING et_row_no = i_row_no.
2006 Aug 09 1:42 PM
Hi Kesav,
But I want to execute the code for 2nd grid only. ie. if my cursor in 2nd grid I want to execute it for 2nd grid. if it is in first grid, execute for first grid only. is there a way to clear selected cell in first grid if my cursor in 2nd grid?
thanks and regards,
Vamsi
2006 Aug 09 1:59 PM
Use the following method to get active alv
data: ACT_ALV type ref to cl_gui_control.
CALL METHOD cl_gui_control=>get_focus
IMPORTING control = ACT_ALV
EXCEPTIONS cntl_error = 1
cntl_system_error = 2.
get cell value using ACT_ALV->GET_CURRENT_CELL
Regards
Sridhar
2006 Aug 09 2:04 PM
Hi,
using the <b>SET_FOCUS</b> method you can see which one is active. and let me know do you want it using code.
Regards
vijay
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |