cancel
Showing results for 
Search instead for 
Did you mean: 

Drop Down by Key within ALV Toolbar

Former Member
0 Kudos

Hi at all,

I am trying to create a drop down within the toolbar of an alv component.

My context contains a node "DROPDOWN_DATA_TYPE" with two attributes:

- key type char2

- value type string

I fill this context node in the wddoinit of my Component controller.

Now I am trying to add the drop down into the alv component:

* Drop Down
  DATA: lr_drop TYPE REF TO CL_SALV_WD_FE_DROPDOWN_BY_KEY,
        lref_drop TYPE REF TO cl_salv_wd_fe_a_drdn_by_key.

  lr_function = lr_config->if_salv_wd_function_settings~create_function( id = 'DROP_DATA_TYPE' ).
  CREATE OBJECT lr_drop
    EXPORTING
      selected_key_elementname = 'DROPDOWN_DATA_TYPE-VALUE'
      .

  
  lref_drop ?= lr_drop.
  lv_text = wd_assist->if_wd_component_assistance~get_text( '041' ).
  lr_drop->set_label_text( lv_text ).
  lr_function->set_editor( value = lr_drop ).

*  CALL METHOD lref_drop->set_selected_key_elementname
*    EXPORTING
*      value  =
*      .

When I start the application I get the message:

"External Mapping of Node SALV_WD_TABLE#COMPONENTCONTROLLER.CONTEXT.FUNCTION_ELEMENTS Is Not Completed Yet

Translated:"

What am I doing wrong?

The additional detail Button created before works perfectly:

* Eigenen Button einfügen
  lr_function = lr_config->if_salv_wd_function_settings~create_function( id = 'DETAIL_UEBER' ).

  CREATE OBJECT lr_toggle_button.
  lref_toggle_button ?= lr_toggle_button.

  lv_text = wd_assist->if_wd_component_assistance~get_text( '041' ).
  lr_toggle_button->set_text( lv_text ).
  lr_function->set_editor( value = lr_toggle_button  ).

Thanks for any help...

Dirk

Accepted Solutions (1)

Accepted Solutions (1)

gill367
Active Contributor
0 Kudos

hI

Your node DROPDOWN_DATA_TYPE should be mapped to the node Function_Elements interface controller of the used

component SALV_WD_TABLE. For this open the component usage and then select the interface controller of the used comp.

then MAP the node DROPDOWN_DATA_TYPE to Function_Elements .

and obviously for this the node should be present in the comp controller. so if the node is not present there create it there

and map to the view controller.

and then in the code change the line

selected_key_elementname = 'DROPDOWN_DATA_TYPE-VALUE'

to

selected_key_elementname = 'VALUE'

This will solve your problem.

thanks

sarbjeet singh

Former Member
0 Kudos

Hi Sarbjeet,

the error message won't appear with your solution ... thanks for your solution.

But the Drop Down is empty. I have filled the context node within the method "wddoinit" in the component controller.

Dirk

Answers (3)

Answers (3)

Former Member
0 Kudos

HI ,

i have followed the same process but getting only one value in drop down , could you please help me.

Thanks

Ashish

Former Member
0 Kudos

Make sure you are filling all value in value-set which is bind with Dropdown.

Former Member
0 Kudos

i have filled the node in component controller init method , could you please give me code if your way of filling is different

Former Member
0 Kudos

DATA: lt_valueset TYPE wdr_context_attr_value_list,

        ls_valueset TYPE wdr_context_attr_value.

  DATA: lo_node_info TYPE REF TO if_wd_context_node_info,

        lo_node      TYPE REF TO if_wd_context_node,

        ls_attr_info          TYPE wdr_context_attribute_info.

  DATA lo_nd_visible_row_node TYPE REF TO if_wd_context_node.

  DATA lo_el_visible_row_node TYPE REF TO if_wd_context_element.

  DATA ls_visible_row_node TYPE wd_this->element_<node_name>.

  DATA lv_visible_row TYPE wd_this->element_<node_name>-<attribute_name>.

  lo_node = wd_context->get_child_node( name = wd_this->wdctx_<node_name> ).

  lo_node_info = lo_node->get_node_info( ).

  ls_valueset-text = '10'.

  ls_valueset-value = 10.

  APPEND ls_valueset TO lt_valueset.

  ls_valueset-text = '25'.

  ls_valueset-value = 25.

  APPEND ls_valueset TO lt_valueset.

  ls_valueset-text = '50'.

  ls_valueset-value = 50.

  APPEND ls_valueset TO lt_valueset.

  ls_valueset-text = '100'.

  ls_valueset-value = 100.

  APPEND ls_valueset TO lt_valueset.

  lo_node_info->set_attribute_value_set(

  EXPORTING

    name      = `<attribute_name>`

    value_set =  lt_valueset   ).

  CLEAR ls_valueset.

  REFRESH lt_valueset.

Former Member
0 Kudos

Thanks , for help could you please tell how to read selected text in drop down

Former Member
0 Kudos

HI I got values in drop down but getting when selecting values from drop down getting below message

"the entered value is not  on the list of valid values".

Thanks

Ashish

Former Member
0 Kudos

This is because your attribute type will be 'NUMC' and you are giving some wrong value into that, make your attribute type string and then try to work. 

Former Member
0 Kudos

hi Dirk Schilling ,

problem with mapping the node function_elements

refer the below standard component

SALV_WD_TEST_TABLE_TOOLBR

regards

chinnaiya P

Former Member
0 Kudos

Hi chinnaiya,

thanks for your answer, but the written standard component is using a normal table, not a reused ALV component.

So it won't help, sorry.

Dirk

gill367
Active Contributor
0 Kudos

Now for filling the node, you need to fill the the valueset of the attribute.

as you are using dropdown by key, one element in the node will be enough.

Then you need to fill the valueset of the attribute value.

let me know if you need coding help on that also.

thanks

sarbjeet singh

Edited by: sarbjeet singh on Jan 31, 2011 4:12 PM

Former Member
0 Kudos

Hi sarbjeet,

context node is still bound to the node FUNCTION_ELEMENTS in the INTERFACECONTROLLER_USAGE.

Dirk

Former Member
0 Kudos

Solved. I have to use drop down by index and now it works perfectly.

THANKS for help

former_member184635
Participant
0 Kudos

Hi,

The issue , It hink with the Assistance Class acessing the text id.

Pls. check the Assistace class exist with the id no. 041.

Regards,

Dadarao.

Former Member
0 Kudos

Assistance Text exists and was filled as dummy value like the same way at the alv button.

Error Message

"External Mapping of Node SALV_WD_TABLE#COMPONENTCONTROLLER.CONTEXT.FUNCTION_ELEMENTS Is Not Completed Yet"

still appears on starting the application

Edited by: Dirk Schilling on Jan 31, 2011 11:18 AM