"单元格是否可编辑设置
REFRESH: lt_edit.
cl_descr ?= cl_abap_typedescr=>describe_by_data( gs_itab ).
LOOP AT cl_descr->components ASSIGNING <fs_comp>.
* WRITE: / <fs_comp>-name, "字段名称
* <fs_comp>-type_kind, "字段类型
* <fs_comp>-length, "字段长度
* <fs_comp>-decimals. "字段小数位
ls_edit-fieldname = <fs_comp>-name.
ls_edit-style = cl_gui_alv_grid=>mc_style_disabled.
ls_edit-style2 = space.
ls_edit-style3 = space.
ls_edit-style4 = space.
ls_edit-maxlen = <fs_comp>-length / 2.
INSERT ls_edit INTO TABLE lt_edit.
CLEAR: ls_edit.
ENDLOOP.
gt_itab-style[] = lt_edit[].
CLEAR: gt_
标签:常用,cl,MM,space,style,查询,edit,lt,ls From: https://blog.csdn.net/qq_32198063/article/details/136942451