01-06-2011 3:09 PM
Folks: My ALV gird has 6 fields...1 field is edtiable. When a user adds a row to the grid i would like all fields to be editable...How do I do that? Thanks. Mat.
01-06-2011 3:38 PM
Check demo program BCALV_EDIT_04 in your sap ssystem
Use LVC_T_STYLE.
"- IT for the grid
data: begin of gt_outtab occurs 0. "with header line
include structure sflight.
data: celltab type lvc_t_styl.
data: end of gt_outtab.
THEN...
form fill_celltab using value(p_mode)
changing pt_celltab type lvc_t_styl.
data: ls_celltab type lvc_s_styl,
l_mode type raw4.
* This forms sets the style of columns 'PRICE', FLDATE and PLANETYPE
* editable
if p_mode eq 'RW'.
l_mode = cl_gui_alv_grid=>mc_style_enabled.
else. "p_mode eq 'RO'
l_mode = cl_gui_alv_grid=>mc_style_disabled.
endif.
ls_celltab-fieldname = 'FLDATE'.
ls_celltab-style = l_mode.
insert ls_celltab into table pt_celltab.
ls_celltab-fieldname = 'PRICE'.
ls_celltab-style = l_mode.
insert ls_celltab into table pt_celltab.
ls_celltab-fieldname = 'PLANETYPE'.
ls_celltab-style = l_mode.
insert ls_celltab into table pt_celltab.
endform.
hope it helps you