Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

OOPS ALV : Cannot change initial cell which is editable

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

there is a method cl_gui_alv_grid->SELECT_TEXT_IN_CURR_CELL( ). Go ahead a try it.

7 REPLIES 7

FredericGirod
Active Contributor
0 Kudos

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

0 Kudos

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.

VijayaKrishnaG
Active Contributor
0 Kudos

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

Former Member
0 Kudos

there is a method cl_gui_alv_grid->SELECT_TEXT_IN_CURR_CELL( ). Go ahead a try it.

0 Kudos

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.

0 Kudos

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.

0 Kudos

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