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 .