简体   繁体   中英

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.

在此处输入图片说明

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. However, it have special method set_ddic_reference for assigning F4 values.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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