Skip to Content
0
Former Member
Apr 24, 2009 at 10:37 AM

ALV GRID -- METHOD set_selected_cells

124 Views

Dear all.

I have a program with ALV_GRID in which, with event DBL_CLICK in one cell, I show data with function REUSE_ALV_POPUP_TO_SELECT to select the data with the objective fill this cell only with data I suggest in it.

But I don't know, when I use this method set_selected_cells , don't save the value data..., and in ALV don't show the change...

What happen??... Why don't save this method the value???

Before I execute Method SET ..., I execute Method GET... and the value of cell it's null... don't save the data.

Can you help me??

I put my code in resume...

******************************************************************************

FORM f_handle_double_click1 USING p_row TYPE lvc_s_row

p_column TYPE lvc_s_col.

DATA: it_cells TYPE lvc_t_cell,

wa_cells TYPE lvc_s_cell.

*Read the line of the internal table of the ALV

READ TABLE i_datos INDEX p_row-index.

IF sy-subrc = 0.

CASE p_column-fieldname.

WHEN 'COD_MODELO_AFIS'.

*POP UP with data to select .

CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'

EXPORTING

i_selection = 'X'

i_zebra = 'X'

it_fieldcat = lt_fieldcat

i_tabname = 'TB_MODELOS'

i_checkbox_fieldname = 'CHECKBOX'

is_private = ls_private

IMPORTING

e_exit = l_exit

TABLES

t_outtab = tb_modelos.

CHECK l_exit = space.

READ TABLE tb_modelos WITH KEY checkbox = 'X'.

wa_cells-col_id = p_column.

wa_cells-row_id = p_row.

wa_cells-value = tb_modelos-nom_modelo_afis.

APPEND wa_cells TO it_cells.

*Save the data in cell

CALL METHOD g_grid1->set_selected_cells

EXPORTING

it_cells = it_cells.

REFRESH it_cells. .

*Verify if the data have been saved

CALL METHOD g_grid1->get_selected_cells

IMPORTING

et_cell = it_cells.

ENDCASE.

ENDFORM. " F_HANDLE_DOUBLE_CLICK1