REUSE_ALV_GRID_DISPLAY_LVC创建的alv能显示很多,很多列,不止255列,具体最多多少列也不太清楚,写了个小程序,如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
REPORT ztest_alv_max_columns. DATA:lr_ref TYPE REF TO data. DATA:cn(6) TYPE n. DATA:fcat TYPE lvc_t_fcat, ls_f LIKE LINE OF fcat. FIELD-SYMBOLS:<fs_tab> TYPE table. DO 9800 TIMES. cn = sy-index. CONCATENATE 'C' cn INTO ls_f-fieldname. ls_f-datatype = 'CHAR'. ls_f-reptext = cn. ls_f-intlen = ls_f-outputlen = '15'. APPEND ls_f TO fcat. ENDDO. CALL METHOD cl_alv_table_create=>create_dynamic_table EXPORTING it_fieldcatalog = fcat IMPORTING ep_table = lr_ref. ASSIGN lr_ref->* TO <fs_tab>. CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC' EXPORTING i_callback_program = sy-repid it_fieldcat_lvc = fcat TABLES t_outtab = <fs_tab>. |
可以看到上面程序显示了9800列之多,相信大多数alv都能满足了。。。
以上。
发表评论