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: 

remove yellow highlight in the 1st cell of ALV grid

Former Member
0 Kudos

Dear SAP friends,

I have a report program. The program displays the selected data in ALV grid.

I also added a custom button in the ALV grid toolbar. The purpose of the button is to "Show/hide legend'.

The legend info is displayed in the form of another ALV grid on the top of the screen.

ALV grid always has 1st cell yellow highlighted.

How I could remove the hightlight? I tried to set the focus off the grid. But the yellow highlight is not a focus.

Please help.

Thank you

Tatyana.

4 REPLIES 4

former_member194669
Active Contributor
0 Kudos

Hi,

Try to call the following method with blank internal table



Refresh : i_selected_rows.

CALL METHOD g_grid_3000->get_selected_rows
IMPORTING
et_row_no = i__selected_rows.

aRs

0 Kudos

aRs,

You probably mean SET_selected_rows.

So I tried the method SET_SELECTED_ROWS and other methods of changing the selection.

Like this:

DATA:  i_selected_cells_ln TYPE LVC_s_CENO.
  DATA:  i_selected_cells_tb LIKE TABLE of i_selected_cells_ln.

  REFRESH i_selected_cells_tb.

  CALL METHOD o_grid_lgnd->get_selected_cells_id
    importing
      et_cells = i_selected_cells_tb.

  READ TABLE i_selected_cells_tb INTO i_selected_cells_ln INDEX 1.
      i_selected_cells_ln-row_Id = '0'.
      i_selected_cells_ln-col_id = '0'.

 MODIFY    i_selected_cells_tb FROM   i_selected_cells_ln INDEX 1.


  CALL METHOD o_grid_lgnd->set_selected_cells_id
    exporting
      it_cells = i_selected_cells_tb.

The default selection after a table is loaded into a grid is:

i_selected_cells_ln-row_Id = '1'.

i_selected_cells_ln-col_id = '1'.

This is what gives you the yellow highlight.

So I tried to change:

i_selected_cells_ln-row_Id = '0'.

i_selected_cells_ln-col_id = '0'

But the default selection is not getting changed.

So the question is:

How the default selection in ALV grid could be removed?

Thanks,

Tatyana

Former Member
0 Kudos

Hello,

--> ALV grid always has 1st cell yellow highlighted.

Yes and you can't change it. (had the same problem before and got and official answer from the GUI colleagues)...

Regards,

Walter

Former Member
0 Kudos

Walter,

Thank you.

Your answer will save my time trying to achieve not achievable.

Tatyana