CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = v_repid
i_internal_tabname = 'HEADERTAB'
* I_STRUCTURE_NAME =
* I_CLIENT_NEVER_DISPLAY = 'X'
i_inclname = v_repid
i_bypassing_buffer = 'X'
i_buffer_active = ' '
CHANGING
ct_fieldcat = i_fieldcat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3
.
使用REUSE_ALV_FIELDCATALOG_MERGE会出现以下错误:
Since the caller of the procedure could not have expected this exception
to occur, the running program was terminated.
The reason for the exception is:
You tried to read the program "ZQUY_TEST" from the database. The READ REPORT
statement allows you to copy a program's source code into an internal
table. The lines of source code must not be longer than the width of the
internal table. The internal table is 72 characters wide. The source
code line is 74 wide.
引起以上错误的原因有两种:
1、内表定义HEADERTAB中的字段长度 大于 72字节。
解决办法:尽量避免出现这种情况。
2、程序源码中有的行源码数 大于 72字节。
解决办法:进入SE38—>使用程序—>设置—>在“ABAP EDITOR一栏”,如下图设置所示:
将源码的每行的长度控制在72字节,如果大于这个长度,自动换行。
然后,强制换行,在SE38—>使用程序—>More Utilities中点击 Force Line Length,如图:
OK,问题搞定!
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/11377579/viewspace-605068/,如需转载,请注明出处,否则将追究法律责任。