cancel
Showing results for 
Search instead for 
Did you mean: 

Drop Down lists within alv not updating correct;y

Former Member
0 Kudos

Hi,

I currently have drop down lists in my alv tables but the values within the drop down lists can change depend on the options selected however they dont update and the inital values are always displayed.

This code is called from the modifyview method within the view that stores the alv tables when a user selects an activity number on the screen.

The table lt_edit_sections contains the correct section numbers that should be displayed and these change correctly depending on the activity chosen.

The problem is that the dropdown on the screen always contains the first values thats are entered in the value set.

I have debugged and the node always contains the updated values but they are not displayed on the screen.

Any idea how i would update the tables to display the correct values depending on the activity chosen.

Any help or ideas would be greatly appreciated.

Best Regards

Brian

Edited by: Brian Ramsell on Feb 23, 2010 4:35 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

The code i am using is

DATA: lr_node_info_sect TYPE REF TO if_wd_context_node_info,
       lr_node_sect      TYPE REF TO if_wd_context_node,
        wa_value_set_sect TYPE wdr_context_attr_value,
        lt_value_set_sect TYPE TABLE OF wdr_context_attr_value,
        lv_sect TYPE zbaps_section,
        lt_sect TYPE TABLE OF zbaps_section.

  lr_node_sect = wd_context->get_child_node( name = 'VIEW_ICO_THIRD' ).
  lr_node_info_sect = lr_node_sect->get_node_info( ).

LOOP AT lt_edit_sections INTO ls_edit_sections.
    IF ls_edit_sections-svp_org_id = ls_zbaps_activity_curr-svp_org_id
    AND ls_edit_sections-obsolete NE 'X'.
      wa_value_set_sect-value = ls_edit_sections-section_name.
      wa_value_set_sect-text  = ls_edit_sections-section_name.
      INSERT wa_value_set_sect INTO TABLE lt_value_set_sect.
    ENDIF.

  ENDLOOP.

  IF lt_value_set_sect IS INITIAL.
    wa_value_set_sect-value = 'No Section'.
    wa_value_set_sect-text  = 'No section'.
    INSERT wa_value_set_sect INTO TABLE lt_value_set_sect.
  ENDIF.

*----- Set attribute info
  lr_node_info_sect->set_attribute_value_set( name      = 'SECTION_NO'
                                          value_set = lt_value_set_sect ).

lr_column_ico = lr_column_settings_ico->get_column( 'SECTION_NO' ).
  lr_column_ico->delete_header( ).
  lr_column_header_ico = lr_column_ico->create_header( ).
  lr_column_header_ico->set_text( ls_ico_3rd_pd-section_name  ).
  CREATE OBJECT lr_dropdown_key_sect
    EXPORTING
      selected_key_fieldname = 'SECTION_NO'.
  lr_column_ico->set_cell_editor( lr_dropdown_key_sect ).