2009 Jun 24 11:08 AM
Hi ,
I am using cl_gui_alv_grid .
please let me know how to make a particular cell is editable
eg: cell corresponding to first row second column should be editabel but remaining all are non editable
2009 Jun 24 11:10 AM
Hi,
Refer the field catalog. There is an attribute as EDIT, pass the value of this attribute while creating field catalog to X.
Regards,
Tarun
2009 Jun 24 11:13 AM
That makes whole column editable ....but i want one cell in the column as editable remaining shouuld be
non editabel
2009 Jun 24 11:29 AM
Hi,
Loop at your internal table.
Eg: i have total 5 fields in my internal table itab_zqmeinz. in that 3 fields are editable as below.
declare DATA: lt_celltab TYPE lvc_t_styl.
internal table with celltab as one of the column
DATA: BEGIN OF itab_zqmeinz OCCURS 0. "TYPE STANDARD TABLE OF zqmseqkopf
INCLUDE STRUCTURE zqmseqeinz.
DATA: celltab TYPE lvc_t_styl.
DATA: END OF itab_zqmeinz.
LOOP AT itab_zqmeinz INTO wa_zqmeinz.
l_index = sy-tabix.
REFRESH lt_celltab.
CLEAR wa_zqmeinz-celltab.
PERFORM fill_celltab1 USING 'RW'
CHANGING lt_celltab.
INSERT LINES OF lt_celltab INTO TABLE wa_zqmeinz-celltab.
MODIFY itab_zqmeinz FROM wa_zqmeinz INDEX l_index.
ENDLOOP.
FORM fill_celltab1 USING value(p_mode)
CHANGING pt_celltab TYPE lvc_t_styl.
Refresh pt_celltab.
clear ls_celltab.
IF p_mode EQ 'RW'.
l_mode = cl_gui_alv_grid=>mc_style_enabled. "to enable the required fields
ELSE. "p_mode eq 'RO'
l_mode = cl_gui_alv_grid=>mc_style_disabled.
ENDIF.
ls_celltab-fieldname = 'NEBENSEQUEN'. " field1
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'BEZEICHNUNG'. "field2
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = 'SORTIERUNG'. "field3
ls_celltab-style = l_mode.
INSERT ls_celltab INTO TABLE pt_celltab.
Endform.
It works. I have done it in my program.
Thanks,
2009 Jun 24 11:13 AM
2009 Jun 24 12:37 PM