Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ALV FieldCatalog

Former Member
0 Kudos

Hi everyone,

I am using an editable ALV grid display where the user can enter his data. Once I update the data, I need to check for one field whether it is zero or not. For whichever row it is zero, i need to display the whole row as editable otherwise in non-editable mode... Hope I am clear in explaining.

-SatyaPriya

1 REPLY 1

Former Member
0 Kudos

Hi ,

Create a perform as below .Assume gt_list is output table

and carrid is field where the value is zero

FORM adjust_editables USING pt_list LIKE gt_list[] .

DATA ls_listrow LIKE LINE OF pt_list .

DATA ls_stylerow TYPE lvc_s_styl .

DATA lt_styletab TYPE lvc_t_styl .

LOOP AT pt_list INTO ls_listrow .

IF ls_listrow-carrid = 0

ls_stylerow-fieldname = 'SEATSMAX' .

ls_stylerow-style = cl_gui_alv_grid=>mc_style_enabled .

APPEND ls_stylerow TO lt_styletab .

else.

.ls_stylerow-fieldname = 'SEATSMAX' .

ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled. .

endif.

INSERT LINES OF lt_styletab INTO ls_listrow-cellstyles .

MODIFY pt_list FROM ls_listrow .

ENDLOOP .

add the following line in the layout workarea.

ps_layout-stylefname = ‘CELLSTYLES’

Please reward if useful.