Hide the columns in table-control

来源:互联网 发布:js遍历对象集合 编辑:程序博客网 时间:2024/05/21 22:47

loop at i_final into wa_final with control table_control
  cursor table_control-current_line.

  module hide_columns_dynamically.
endloop.
* Module to hide the columns of table control
module hide_columns_dynamically.

module hide_columns_dynamically output.
if <condition_required>.
data:cols type cxtab_column.
loop at table_control-cols into cols.
if cols-index = 3 or
  cols-index = 4 .
  cols-screen-input = '0'.
* This will hide the 3th, 4th  columns
  cols-invisible = 'X'.
  modify table_control-cols from cols.
endif.
endloop.
endif.
endmodule. " hide_columns_dynamically OUTPUT

 

 

The below ways may be not suitable in some situations

 

  if wa_tp_header-werks+0(1) <> '3'.
    delete tc0007-cols
    where SCREEN-NAME = 'WA_TP_ITEM-J_3ANOTE'.
  endif.

 

  if wa_tp_header-werks+0(1) <> '3'.
    loop at screen.
      if screen-name = 'COMD3'.
        screen-invisible = 1.
        screen-active = 0.
        modify screen.
      endif.
    endloop.
  endif .

 

 

原创粉丝点击