cancel
Showing results for 
Search instead for 
Did you mean: 

ALV: Dropdown by key Dump after Selection

mario_abel
Explorer
0 Kudos

Hi,

in my alv in one column i need to show dropdown in one special row and in the others rows an input field.

Everything works fine, but when I select an entry, it dumps:

The value selectedKey = "1" of the DropDownByKey with Id "_21" doesn't exist in the valuetable and is not initial.

Any Ideas??

Therfore in WDDOINIT I fill the dropdown with possible values

select catsshortt from ztk_cats_dd_text into l_text.

ls_value-key = ls_value-key + 1.

ls_value-value = l_text.

append ls_value to lt_value_set.

endselect.

ls_value-key = ls_value-key + 1.

ls_value-value = ''.

append ls_value to lt_value_set.

lo_nd_info->set_attribute_value_set( name = 'LTXA1'

value_set = lt_value_set ).

create object lo_dropdown

exporting

selected_key_fieldname = ls_column-id.

lo_dropdown->set_read_only( value = abap_false ).

lo_column->set_cell_editor( lo_dropdown ).

create object lo_cv.

lo_cv->set_key( value = 'INPUT_FIELD').

lo_cv->set_editor( value = lo_input_field ).

lo_column->add_cell_variant( r_cell_variant = lo_cv ).

lo_column->set_sel_cell_variant_fieldname( 'LTXA1_DD_EDITOR' ).

In WDDOMODIFY:

lo_nd_zeiten_info = lo_nd_zeiten->get_node_info( ).

if <ls_zeiten>-raufnr <> l_aufnr.

<ls_zeiten>-ltxa1_dd_editor = 'INPUT_FIELD'.

endif.

Regards

Mario

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Have you checked in debugging for teh valutable for this dropdown...

mario_abel
Explorer
0 Kudos

Yes, after the selection the valuetable is filled at the end of WDDOMODIFY.

Answers (0)