ALV设置参考表和参考字段,自定义列名称可能失效

来源:互联网 发布:淘宝店铺运动服简介 编辑:程序博客网 时间:2024/05/21 15:20
当我们使用ALV参考表和参考字段时,调用数据字典中的search help给某字段添加F4帮助时,可能会出现自定义的列名称失效了,变成数据字典中定义的字段名称了,这是因为fieldcat-seltext_s/seltext_m/seltext_l使用不正确导致的,如果ALV对应内表中字段定义的长度很大时,而fieldcat使用seltext_s/seltext_m定义字段名称,可能会导致自定义的列名称失效,而参考数据字典。

1、CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
fieldcat-ref_tabname = 'ZSNCM'.
fieldcat-ref_fieldname = 'LFDAT'.

解决方法:添加下面3个参数:

fieldcat-seltext_s     = description.
fieldcat-seltext_m     = description.
fieldcat-seltext_l     = description.


2、CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
fieldcat-ref_table = 'ZSNCM'.
fieldcat-ref_field = 'LFDAT'.

解决方法:添加下面3个参数:

fieldcat-scrtext_s     = description.
fieldcat-scrtext_m     = description.
fieldcat-scrtext_l     = description.


居然是这个原因,scrtext_l    不设置的问题,害我每次去重新自定义F4.

原创粉丝点击