‎2014 Feb 19 9:53 AM
Hello Experts,
I am using OOPS to display an ALV. It has 1 column (POSTP) - CHAR(1) editable.
The problem is when the ALV is displayed, and the user clicks on POSTP to change it, he cannot change it without pressing Backspace/Delete button. (i.e. The field is not selected, The cursor is at the beginning of the field)
Important : After moving to the next field, the next field is highlighted, and the user can directly change it without pressing any other button.
I have tried changing the field-cat/layout values, but it didn't work.
Is there a way to explicitly highlight the field after ALV is displayed
Any help is appreciated.
Kind Regards,
Rajat Bothra
‎2014 Feb 19 10:07 AM
there is a method cl_gui_alv_grid->SELECT_TEXT_IN_CURR_CELL( ). Go ahead a try it.
‎2014 Feb 19 9:58 AM
Hi,
change the user parameter OVR instead of INS and your user will not have to delete the field before entering a new value.
your users are little lazy ..
regards
Fred
‎2014 Feb 24 12:19 PM
Hello Frederic,
Can you please explain how to do that.
Also, does that need to be done for every user or it is a global setting ?
Thanks,
Rajat.
‎2014 Feb 19 10:01 AM
Hi Rajat,
Its general behavior of any input field. When you place mouse and click on the field the cursor stands where exactly clicked and it could be Beginning / Ending / Middle of the text in the field.
Important : After moving to the next field, the next field is highlighted, and the user can directly change it without pressing any other button.
And as you mentioned, how user moving to next field either using TAB key or again with mouse click??
If he is moving with TAB key obviously the whole text will be selected.
Regards,
Vijay
‎2014 Feb 19 10:07 AM
there is a method cl_gui_alv_grid->SELECT_TEXT_IN_CURR_CELL( ). Go ahead a try it.
‎2014 Feb 24 12:16 PM
Hello Jozef,
I am trying to implement this method, but for this, first i need to set the cursor to the intended cell.
And for this purpose, i tried to use the below method :
CALL METHOD go_grid->set_current_cell_id
EXPORTING
row_id = 1
col_id = 2
* EXCEPTIONS
* error = 1
* others = 2.
But the program gives an error message that this method id set as protected and can't be used.
Any idea on how to proceed ?
Thanks.
Rajat.
‎2014 Feb 24 12:45 PM
I'm on ECC 6.0 and in this system the method is public. Last change from SAP on the definition was on 17.6.2013 in this system.
One workaround would be inheriting CL_GUI_ALV_GRID into another customer class and redefining the method definition (or more likely creating another z-method, which would call the protected method from CL_GUI_ALV_GRID_BASE->SELECT_TEXT_IN_CURRENT_CELL. That would mean changing the definition of your global alv variable in the code. I'm not sure, if this would not be just too much effort comparing the addition value.
Are you sure you did not use this method from *GRID_BASE? That one is really protected.
‎2014 Feb 26 12:01 PM
Thanks Jozef.
I used methods :
cl_gui_control=>set_focus,
set_current_cell_via_id and select_text_in_curr_cell( ).
And it worked.
Thanks & Regards,
Rajat Bothra