1、report zibmwj_test06 no standard page heading.type-pools: slis.*- Fieldcatalogdata: it_fieldcat type lvc_t_fcat.data: x_fieldcat type lvc_s_fcat.data: x_layout type lvc_s_layo."第1步:用操作具体单元的是否可编辑的内表和工作区data: ls_edit type lvc_s_styl, lt_edit type lvc_t_s
2、tyl, gr_alvgrid type ref to cl_gui_alv_grid ."第2步:在内表定义添加字段,用于控制具体行的具体单元是否可编辑data: begin of it_vbap occurs 0, vbeln type ebeln, posnr like vbap-posnr, style type lvc_t_styl, "FOR DISABLEend of it_vbap.data: ls_outtab like line of it_vbap.select vbeln
3、posnr up to 100 rows into corresponding fields of table it_vbapfrom vbap.data:l_pos type i value 1.clear: l_pos.l_pos = l_pos + 1.x_fieldcat-seltext = 'VBELN'.x_fieldcat-fieldname = 'VBELN'.x_fieldcat-tabname = 'ITAB'.x_fieldcat-col_pos = l_pos.x_fieldcat-
7、4 = space.ls_edit-maxlen = 6.insert ls_edit into table lt_edit.insert lines of lt_edit into table ls_outtab-style."第4步:将控制数据写到内表modify it_vbap index sy-tabix from ls_outtab transporting style ."设置第10行只有项目不能输入clear ls_outtab.refresh lt_edit.ls_edit-fieldname
8、= 'POSNR'.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 = 6.insert ls_edit into table lt_edit.insert line