ABAP WEB_DYNPRO 中调用什么方法可以修字段属性?
我想根据在WEBDYNPRO报表中字段的值来决定这个字段是否可以编辑,求教调用什么方法以及怎么调用这个方法,最好能有个例子,谢谢了...
我想根据在WEBDYNPRO报表中字段的值来决定这个字段是否可以编辑,求教调用什么方法以及怎么调用这个方法,最好能有个例子,谢谢了
展开
1个回答
展开全部
可以看一下下面的代码, 其中 GDS_VERIFY 的结构中要有CELLSTYLES TYPE LVC_T_STYL,"设置可编辑
*&---------------------------------------------------------------------*
*& Form FRM_SET_EDIT_FLAG
*&---------------------------------------------------------------------*
* flag 0 可修改 1 不可修改
*----------------------------------------------------------------------*
FORM FRM_SET_EDIT_FLAG .
DATA FIELD_STYLE TYPE LVC_S_STYL.
CLEAR:GDS_VERIFY,FIELD_STYLE.
READ TABLE GDT_VERIFY INTO GDS_VERIFY WITH KEY FLAG = 1.
IF SY-SUBRC = 0.
FIELD_STYLE-FIELDNAME = 'ZPZLX'.
FIELD_STYLE-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
INSERT FIELD_STYLE INTO TABLE GDS_ZSD012VERIFY-CELLSTYLES.
MODIFY GDT_VERIFY FROM GDS_VERIFY TRANSPORTING CELLSTYLES WHERE FLAG = 1.
ELSE.
CLEAR:GDS_VERIFY,FIELD_STYLE.
READ TABLE GDT_VERIFY INTO GDS_VERIFY WITH KEY FLAG = 0.
IF SY-SUBRC = 0.
FIELD_STYLE-FIELDNAME = 'ZPZLX'.
FIELD_STYLE-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.
INSERT FIELD_STYLE INTO TABLE GDS_VERIFY-CELLSTYLES.
MODIFY GDT_VERIFY FROM GDS_VERIFY TRANSPORTING CELLSTYLES WHERE FLAG = 0.
ENDIF.
ENDIF.
ENDFORM. " FRM_SET_EDIT_FLAG
*&---------------------------------------------------------------------*
*& Form FRM_SET_EDIT_FLAG
*&---------------------------------------------------------------------*
* flag 0 可修改 1 不可修改
*----------------------------------------------------------------------*
FORM FRM_SET_EDIT_FLAG .
DATA FIELD_STYLE TYPE LVC_S_STYL.
CLEAR:GDS_VERIFY,FIELD_STYLE.
READ TABLE GDT_VERIFY INTO GDS_VERIFY WITH KEY FLAG = 1.
IF SY-SUBRC = 0.
FIELD_STYLE-FIELDNAME = 'ZPZLX'.
FIELD_STYLE-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
INSERT FIELD_STYLE INTO TABLE GDS_ZSD012VERIFY-CELLSTYLES.
MODIFY GDT_VERIFY FROM GDS_VERIFY TRANSPORTING CELLSTYLES WHERE FLAG = 1.
ELSE.
CLEAR:GDS_VERIFY,FIELD_STYLE.
READ TABLE GDT_VERIFY INTO GDS_VERIFY WITH KEY FLAG = 0.
IF SY-SUBRC = 0.
FIELD_STYLE-FIELDNAME = 'ZPZLX'.
FIELD_STYLE-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.
INSERT FIELD_STYLE INTO TABLE GDS_VERIFY-CELLSTYLES.
MODIFY GDT_VERIFY FROM GDS_VERIFY TRANSPORTING CELLSTYLES WHERE FLAG = 0.
ENDIF.
ENDIF.
ENDFORM. " FRM_SET_EDIT_FLAG
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询