Skip to Content
avatar image
Former Member

cl_gui_alv_grid Change attribute of field in runtime


I have an alv with several fields, two fields are checkboxes, one is for the ability to change only weight and quantity for this line and one is for selection the full row, if I'm selecting the second checkbox, the first one should be disabled (clear the edit mode), I've tried to make this code :

loop at gt_stmp_fieldcat ASSIGNING <fs_fieldcat> where fieldname = 'CHK'.
clear <fs_fieldcat>-edit.

is_stable-row = 'X'.
is_stable-col = 'X'.
lo_grid->refresh_table_display( EXPORTING is_stable = is_stable ).

But nothing happens.

Field CHK and CHK_FULL_LINE are configured the same like that :

ls_fieldcat-fieldname = 'CHK'.
ls_fieldcat-col_pos = 0.
ls_fieldcat-checkbox = 'X'.
ls_fieldcat-outputlen = 3.
ls_fieldcat-edit = 'X'.
ls_fieldcat-seltext = 'CHK'.
ls_fieldcat-scrtext_s = 'Check Line'(033).
APPEND ls_fieldcat TO gt_stmp_fieldcat.
CLEAR ls_fieldcat.

Can anyone help me and show how to disable this field on runtime ?


Amit Berku

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Nov 23, 2017 at 02:40 PM

    If you only want to set one cell of one row to not editable, you must not use the field catalog (it's only for a whole column), but you must use styles: search the web for mc_style_disabled, column of type LVC_T_STYL and LVC_S_LAYO-STYLEFNAME, event DATA_CHANGED, and method ER_DATA_CHANGED->MODIFY_STYLE.

    Add comment
    10|10000 characters needed characters exceeded