本例和行列例程转换不同,内表结构是固定的,仅仅是通过ALV的fieldcat和Filter来隐藏/显示ALV的行和列
列:
FORM changefield .
LOOP AT gt_fieldcat INTO gs_fieldcat .
gs_fieldcat-no_out = ''.
IF gs_fieldcat-fieldname = 'KOSTL' .
gs_fieldcat-no_out = 'X'.
ENDIF.
MODIFY gt_fieldcat FROM gs_fieldcat .
ENDLOOP.
CALL METHOD go_grid->set_frontend_fieldcatalog
EXPORTING
it_fieldcatalog = gt_fieldcat.
CALL METHOD go_grid->refresh_table_display .
ENDFORM. " changefield
这样处理后,可以在ChangeLayout里面更改列是否显示,如果不想在Changelayout里面看到隐藏的列,可以设置gs_fieldcat-tech = 'X'.
行:
阅读(889) | 评论(0) | 转发(0) |