In fields with fixed value domains the description can be output instead of the code. Use the constant if_salv_gui_types_ida=>cs_presentation_mode -description
Interface
Method
IF_SALV_GUI_FIELD_DISPLAY_OPT
set_formatting
You can retrieve interface IF_SALV_GUI_FIELD_DISPLAY_OPT using:
Interface
Method
IF_SALV_GUI_FIELD_CATALOG_IDA
display_options
Example
DATA lo_alv_display TYPE REF TO if_salv_gui_table_ida .
* create ALV interface
lo_alv_display = cl_salv_gui_table_ida => create(
iv_table_name = 'SBOOK'
) .
* Show description for field SMOKER
lo_alv_display->field_catalog ( )->display_options ( )->set_formatting(
iv_field_name = 'SMOKER'iv_presentation_mode = if_salv_gui_types_ida =>cs_presentation_mode -description
) .
Report example: SALV_IDA_FIELD_DISPLAY_OPT_FS
Note
If the sort order of the internal codes is different to the descriptions, you should consider deactivating sorting for the field. There may be unexpected results with the sorting and with range entries in the filter dialog.
If sorting for the field has been deactivated with interface IF_SALV_GUI_FIELD_CATALOG_IDA , method DISABLE_SORT , then input of ranges is suppressed in the filter dialog.