2016 Feb 24 9:06 AM
Hi All
We had built a custom report where an ALV grid appears in report once the transaction is executed. The user provides input in ALV grid on the screen.
Requirement : When we execute the transaction, the cursor goes to the first field in the screen.
Our requirement is that the cursor should go to the first editable cell in ALV
Please let me know if anyone has any idea how to proceed here
Thanks
Krishna
Hi All
We had built a custom report where an ALV grid appears in report once the transaction is executed. The user provides input in ALV grid on the screen.
Requirement : When we execute the transaction, the cursor goes to the first field in the screen.
Our requirement is that the cursor should go to the first editable cell in ALV
Please let me know if anyone has any idea how to proceed here
Thanks
Krishna
2016 Feb 24 9:23 AM
Class CL_GUI_ALV_GRID has a method SET_CURRENT_CELL_VIA_ID that allows you to place the cursor where you want in the ALV (set_current_cell_via_id - ALV Grid Control (BC-SRV-ALV) - SAP Library)
2016 Feb 24 11:14 AM
Hi Patrick,
We have tried to use that method, in fact we are using this method to move the cursor when user enters any data so that cursor goes to next input cell on ALV(works perfectly). But it does not work for initial display of ALV, when we use it during ALV first display it just highlights the specified cell in yellow color, the cursor is still on the 1st screen field of the screen.
Any other suggestions will be helpful.
Regards
2016 Feb 24 12:44 PM
If that is the case, can it be somehow related to a refresh of the screen? the refresh of the alv?
2016 Feb 24 1:58 PM
Could you try to add a call of set_selected_cells
CALL METHOD alv_grid_p->set_current_cell_via_id
EXPORTING
is_row_no = row_no. " lvc_s_roid
REFRESH cell_p.
CLEAR r_cell.
r_cell-row_id-index = row. " integer
r_cell-col_id-fieldname = 'FIELDNAME'.
APPEND r_cell TO cell_p.
CALL METHOD alv_grid_p->set_selected_cells
EXPORTING
it_cells = cell_p. " lvc_t_cell
Or you could
Regards,
Raymond
2016 Feb 25 10:50 AM
Hi Raymond,
I had already tried this method but I tried again, the result is it highlights the cell with a red border but cursor still is in other screen field.
For the second method you suggested I am not clear, could you explain a bit more.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |