Skip to Content
0
Jun 20, 2013 at 11:16 AM

Making ALV Grid editable based on field value

93 Views

Hi,

I am using the below code,

field_style of type lvc_t_styl.

Data: ls_stylerow type lvc_s_styl.

loop at lt_output into wa_output.

if wa_output-x = 'PQR'.

v_index = sy-tabix.

ls_stylerow-fieldname = 'XYZ'.

ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.

append as_stylerow to wa_output-field_style.

modify lt_output from wa_output transporting field_style index v_index.

endif.

clear: wa_output, ls_stylerow.

endloop.

ls_layout-styfname = 'FIELD_STYLE'.

Call method o_grid2-> set_table_first_display

Exporting

is_layout = ls_layout

it_toolbar_excluding = lt_ui_functions

importing

it_outtab = lt_output1

it_fieldcatalog = t_fcat1.

Still fields are not getting edited based on condition given.

I know we can modify the fieldcatalogue & make the field editable without any condition, COuld you please help how can I make field editable in specific cases

Thanks

Vinay