cancel
Showing results for 
Search instead for 
Did you mean: 

Drop-down in dynamic alv

Former Member
0 Kudos

Hi all

I'm doing a dynamic alv and I have a column that is a drop-down done by code. I need that when I run the drop-down show me the code and the description, but only show the description.

Thanks in advance.

Regards,

Manu.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Manu,

You can do this: field to be displayed as dropdown must be ref to cl_salv_wd_uie_dropdown_by_idx

In your initialize*alv* method must be set de valueset to the corresponding column

 

         

          create object lr_drdn_by_idx
          EXPORTING
            selected_key_fieldname = ls_column-id.

        lr_drdn_by_idx->set_valueset_fieldname( 'TABLE_VALUESET' ).
        lr_drdn_by_idx->set_type( if_salv_wd_c_uie_drdn_by_index=>type_key_value ).
        ls_column-r_column->set_cell_editor( lr_drdn_by_idx ).

  

TABLE_VALUSET is type  WDR_CONTEXT_ATTR_VALUE_LIST

when you populate the valueset you can concatenate valueset-value column and valueset-text column into valuset-text column. so we'll have value and text in the "description" column

Regards,

Catalin