[英]Pass internal table into REUSE_ALV_FIELDCATALOG_MERGE
I've got lt_result
table as result of function module, just a usual internal table with 50+ columns.我有
lt_result
表作为功能模块的结果,只是一个包含 50 多列的普通内部表。
So, I have to send that to ALV display, how to properly use that table as a source for REUSE_ALV_FIELDCATALOG_MERGE
?所以,我必须将它发送到 ALV 显示器,如何正确使用该表作为
REUSE_ALV_FIELDCATALOG_MERGE
的源?
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_PROGRAM_NAME = sy-repid
I_INTERNAL_TABNAME = 'LT_RESULT'
This way it compiles, but won't get any fieldnames from that table.这样它会编译,但不会从该表中获取任何字段名。 The same, when I try to use structure.
同样,当我尝试使用结构时。
How do i get field names from given table to lt_fieldcat[]
with shortest way possible?如何以最短的方式从给定的表中获取字段名称到
lt_fieldcat[]
?
The shortest way possible is using SALV classes :最短的方法是使用SALV 类:
data: gr_table type ref to cl_salv_table.
call method cl_salv_table=>factory
IMPORTING
R_SALV_TABLE = gr_table
CHANGING
t_table = lt_result.
gr_table->display( ).
This way you don't need fieldcatalog at all.这样你就不需要 fieldcatalog 了。
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
i_program_name = sy-repid
i_internal_tabname = 'LT_RESULT'
i_inclname = sy-repid "< if you use top-include
changing
ct_fieldcat = lt_fldcat[]
When declaring lt_result using TYPE and not using LIKE使用TYPE而不是使用LIKE声明 lt_result 时
x+(28%of342+71.78÷17.91)-102.98×4=298.09
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.