简体   繁体   English

CL_SALV_TABLE 列中没有域值。 为什么?

[英]No domain values in CL_SALV_TABLE column. Why?

I have 2 rows shown in the ALV list, one of this column has domain values.我在 ALV 列表中显示了 2 行,此列之一具有域值。

在此处输入图片说明

If I click on the search help right it doesn't show any values at all.如果我右击搜索帮助,它根本不显示任何值。

Do I have to activate something in the class to see the values of any domain?我是否必须激活类中的某些内容才能查看任何域的值?

Automatic search help (aka domain values) will be showed only when creating ALV via Dictionary structure, and that's why it is impossible with cl_salv_table , because it accepts only internal table.只有在通过字典结构创建 ALV 时才会显示自动搜索帮助(又名域值),这就是为什么cl_salv_table不可能的原因,因为它只接受内部表。 However, it have special method set_ddic_reference for assigning F4 values.但是,它具有用于分配 F4 值的特殊方法set_ddic_reference

DATA: lr_column   TYPE REF TO cl_salv_column_table,
       lr_columns TYPE REF TO cl_salv_columns_table.
DATA: ls_ddic type salv_s_ddic_reference.
lr_columns = o_alv->get_columns( ).
lr_column ?= lr_columns->get_column( columnname = 'MANDT' ).
ls_ddic-table = 'T001'.
ls_ddic-field = 'MANDT'.
lr_column->set_ddic_reference( ls_ddic ).
lr_column->set_f4( abap_true ).

This code should be called after the factory constructor and before the display() method.此代码应在工厂构造函数之后和display()方法之前调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM