Ivan Diaz Salas
Ivan Diaz Salas

Reputation: 319

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.

enter image description here

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?

Upvotes: 2

Views: 7666

Answers (1)

Suncatcher
Suncatcher

Reputation: 10621

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.

Upvotes: 1

Related Questions