2

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?

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Ivan Diaz Salas
  • 309
  • 1
  • 9
  • 25

1 Answers1

1

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.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90
  • Search help called H_T000. Transaction code SE11: T001, Field: MANDT, Tab: Input Help, Srch Help: H_T000. – itsergiu Mar 30 '20 at 16:51
  • Read the API, it accepts not the search help name, but field name. And try the code before posting comments – Suncatcher Mar 30 '20 at 20:39