cancel
Showing results for 
Search instead for 
Did you mean: 

Changes focus in ALV

Former Member
0 Kudos

Hi Experts,

I have a problem with the focus of an ALV. The problem is that when the user press ENTER in a MATNR column I have to show the description of this material in the adjacent column, so I use the method set_attribute and this work perfect, but I lose the focus. I´ve try to use the the method set_focus but it does´nt work:

DATA: l_ref_interfacecontroller TYPE REF TO iwci_salv_wd_table .

l_ref_interfacecontroller = wd_this->wd_cpifc_alv( ).

l_ref_interfacecontroller->set_focus(

index = my_column_index

column = 'MATNR'

).

The strange thing is I´ve put this piece of code when the user change other column and it works, the focus changes to MATNR column, but in this case I don´t change the element with set_atribute I think this is the problem, maybe this method trigger some event which causes the lost of the focus.

Can someone help me?

Thanks in advange.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

In which event of the ALV you have written the code....

What is the focus that you are talking about...can you be more clear.

Regards,

Lekha.

Former Member
0 Kudos

Hi,

I´ve have to activated this option beacuase I need to put some code when the user insert a row:

lr_config->if_salv_wd_table_settings~set_data_check( if_salv_wd_c_table_settings=>data_check_on_cell_event )

So, I put my code when the ON_DATA_CHECK event is triggered:

.....

IF NOT r_param->t_modified_cells IS INITIAL.

DATA: ls_mod_cell TYPE salv_wd_s_table_mod_cell.

FIELD-SYMBOLS: get_static_attributes(

IMPORTING

static_attributes = ls_tracur_cab

).

CASE ls_mod_cell-attribute.

WHEN 'MATNR'.

....

lo_el_tracur_cab->set_attribute(

EXPORTING

value = l_maktx

name = 'MAKTX' ).

ENDCASE.

ENDLOOP

ENDIF.

If I comment the code in bold letters ( the set_atribute method) when the user insert some material the focus of the mouse continues in this cell but when I insert this method the focus of the mousse disappear, and the user have to click again in the ALV to continue introducing data.

Thanks a lot.