Skip to Content
0
May 30, 2016 at 09:50 AM

Making the cell as editable after an event

41 Views

Hi all,

I try to make a cell editable according on the value selected from dropdown but she stay disabled.

I use event DATA_CHANGED like below :


METHOD handle_data_changed.

*-----------< Déclaration >----------------*
DATA:
* Structures
ls_good_cost TYPE lvc_s_modi
, ls_cellstyle TYPE lvc_s_styl
* Variables
.

* Pointeurs
FIELD-SYMBOLS:
<ls_data_changed> TYPE lvc_s_modi
.

*-----------< Début traitement >-----------*

*--- Lecture de la valeur modifiée
LOOP AT er_data_changed->mt_good_cells ASSIGNING <ls_data_changed>.

IF <ls_data_changed>-fieldname = 'PEC'.

CASE <ls_data_changed>-value.
WHEN 'N' "Non pertinant
OR 'E'. "Exception / Hors périmètre

*--- Ajout du paramètre editable de la cellule
READ TABLE gt_amo_error INDEX <ls_data_changed>-row_id
ASSIGNING <gs_amo_error>.
IF sy-subrc = 0.
ls_cellstyle-fieldname = 'COMMENTAIRE'.
ls_cellstyle-style = cl_gui_alv_grid=>mc_style_enabled.
APPEND ls_cellstyle TO <gs_amo_error>-cellstyles.
FREE ls_cellstyle.
ENDIF.

WHEN OTHERS.
"Ne rien faire

ENDCASE.

ENDIF.

ENDLOOP.

*-----------< Fin traitement >-----------*

ENDMETHOD.


Thanks for your help.