在dialog程序开发中,有时候根据业务需求,需要隐藏某些列,下面是隐藏列的方法:
CONTROLS: tb12 TYPE TABLEVIEW USING SCREEN 2000. "Table Control名称
DATA: lv_col LIKE LINE OF tb12-cols. "定义Table Control 列
*在dialog的PBO中
PROCESS BEFORE OUTPUT.
MODULE modify_screen. "隐藏列
*定义MODULE
MODULE modify_screen OUTPUT.
LOOP AT tb12-cols INTO lv_col.
IF lv_col-screen-name = 'SP1-MAKTX'. " SP1-MAKTX是需要隐藏的列名
lv_col-invisible = '1' .
MODIFY tb12-cols FROM lv_col.
ENDIF.
ENDLOOP.
ENDMODULE.