cancel
Showing results for 
Search instead for 
Did you mean: 

reference valueset of dropdownbyindex of alv cell to stand alone attribute

0 Kudos

I have an editable ALV.For a cell use set_cell_editor = dropdown and for the valueset use set_valueset_fieldname = col2.

Initially the alv is empty so the dropdown on cell is empty because valueset is an attribute of context of alv. Is it possible to use the method SET_VALUESET_FIELDNAME with reference to another attribute external to context node of alv ?

Thank you so much.

Accepted Solutions (0)

Answers (1)

Answers (1)

gill367
Active Contributor
0 Kudos

your requirement is not clear.

could you elaborate a bit.

First of all dropdownbykey will use the valueset to fill the dropdown.

dropdownbyindex will not use valueset.

thanks

0 Kudos

node1

-- col1 type char20,

-- col2 type char30,

-- col3 type char3,

--VALUESET_COL3 type WDR_CONTEXT_ATTR_VALUE_LIST.

................

......

data: lr_dropdown TYPE REF TO cl_salv_wd_uie_dropdown_by_idx,

lr_field_settings ?= l_value .

lt_columns = l_value->if_salv_wd_column_settings~get_columns( ).

LOOP AT lt_columns INTO ls_column.

lr_column = ls_column-r_column.

CASE ls_column-id.

WHEN 'COL3'.'

CREATE OBJECT lr_dropdown EXPORTING selected_key_fieldname = 'COL3''.

CALL METHOD lr_dropdown->set_read_only EXPORTING value = abap_false.

CALL METHOD lr_dropdown->set_valueset_fieldname EXPORTING value = 'VALUESET_COL3''.

CALL METHOD lr_dropdown->set_type EXPORTING value = if_salv_wd_c_uie_drdn_by_index=>type_key_value.

CALL METHOD lr_column->set_cell_editor EXPORTING value = lr_dropdown.

endcase.

So if i write records in table and bind node1, in the dropdownlist I'll find the value; but the alv is editable so first time I have no records to bind to node1 and the dropdown is empty; VALUESET_COL3 and COL3 are in the same context.

Is it possible to set valueset to an attribute VALUESET_NEW from an attribute of context so that the dropdown is full?

CONTEXT

-


VALUESET_NEW type WDR_CONTEXT_ATTR_VALUE_LIST

node1

-- col1 type char20,

-- col2 type char30,

-- col3 type char3,

--VALUESET_COL3 type WDR_CONTEXT_ATTR_VALUE_LIST.

I hope to been clear as possible, thank you