on 11-20-2006 1:19 PM
Hi,
I'm trying to put an dropdown by key (or index) into an ALV but I'm unable to get data in the dropdown. Can someone please help me with this?
The setup for the dropdown is like this (see below) but how can I bind a node DD_fieldname which has attributes 'key' and 'descr' to the dropdown.
Drop down box
DATA: lr_drdn_by_key TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
CREATE OBJECT lr_drdn_by_key EXPORTING selected_key_fieldname = l_fieldname.
lr_column->set_cell_editor( lr_drdn_by_key ).
Thanks,
Kris
Hi,
Try the below code;
l
o_value = lo_interfacecontroller->get_model(
).
lo_table_settings ?= lo_value.
lo_column_settings ?= lo_value.
lo_table_settings->set_read_only( abap_false ).
ls_column = lo_column_settings->get_column( 'ACTIVE' ).
CREATE OBJECT lo_ddk
EXPORTING
selected_key_fieldname = 'ACTIVE'.
ls_column->set_cell_editor( lo_ddk ).
ls_valueset-value = 'AAAAA'.
ls_valueset-text = 'TEST CHAR1'.
APPEND ls_valueset TO lt_valueset.
ls_valueset-value = 'BBBBB'.
ls_valueset-text = 'TEST CHAR2'.
APPEND ls_valueset TO lt_valueset.
ls_valueset-value = 'CCCCC'.
ls_valueset-text = 'TEST CHAR 3'.
APPEND ls_valueset TO lt_valueset.
ls_valueset-value = 'DDDDD'.
ls_valueset-text = 'TEST CHAR 4'.
APPEND ls_valueset TO lt_valueset.
lo_nd_alv_data_info->set_attribute_value_set(
EXPORTING
name = 'ACTIVE'
value_set = lt_valueset ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Apart for all of the above
you need table settings to be set as abap_false.
data: lr_table_settings type ref to if_salv_wd_table_settings.
lr_table_settings ?= lr_model.
lr_table_settings->set_read_only( abap_false ).
If you need the dropdown as not editable then please set
lr_dropdown->set_read_only( abap_true )
I did all this inside the component controllers init method
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi
good
go through this link, i hope this ll help you to solve your probelm
/people/sap.user72/blog/2006/01/09/wda--user-defined-functions-in-alv
http://www.sap-press.de/download/dateien/933/sap_press_bsp_programming.pdf
thanks
mrutyun^
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is my code...
Drop down box
DATA: lr_drdn_by_key TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
CREATE OBJECT lr_drdn_by_key EXPORTING selected_key_fieldname = l_fieldname.
lr_drdn_by_key->set_state( cl_wd_input_field=>e_state-normal ).
lr_drdn_by_key->set_enabled( abap_true ).
lr_column->set_cell_editor( lr_drdn_by_key ).
DATA lr_node TYPE REF TO if_wd_context_node.
DATA lr_node_info TYPE REF TO if_wd_context_node_info.
DATA ls_value TYPE wdy_key_value.
DATA lt_value_set TYPE wdy_key_value_table.
*----- get the pointer to meta data
lr_node = wd_context->get_child_node( 'QUOTATION_TO_CREATE' ).
lr_node_info = lr_node->get_node_info( ).
*----- build set of keys to slect from.
ls_value-key = 'KCF'.
ls_value-value = 'USer friendly text'.
APPEND ls_value TO lt_value_set.
ls_value-key = 'KEYVAL'.
ls_value-value = 'USer friendly text'.
APPEND ls_value TO lt_value_set.
*.... repeat append for as many entries required in dorp down
*----- Set attribute meta data
lr_node_info->set_attribute_value_set( name = `ATWRT005` value_set = lt_value_set ).
I can see that the value_set is correctly put in QUOTATION_TO_CREATE node but no values appear.
Suggestions anyone?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hans ..
Even i want to display a dropdown list in ALv toolbar..
Im udoing it using user defined functions...
In this part:------
Creating a DropDown List in ALV Toolbar.
DATA lr_drdwnui TYPE REF TO cl_salv_wd_fe_dropdown_by_key.
CREATE OBJECT lr_drdwnui EXPORTING selected_key_elementname = lr_column->id .
lr_drdwnui->set_label_text( 'Colors' ).
I want to know what value should selected_key_elementname have..
If i put a column anme ( ie attribute name ) ...it sayus could not find..\
plz help..
To use drop down by key, use must change meta data. IE upate context_node_info.
To use drop down by index, you node must have an element collection.
Using DDBK as the example:
DATA lr_node_info TYPE REF TO if_wd_context_node_info.
DATA ls_value TYPE wdy_key_value.
DATA lt_value_set TYPE wdy_key_value_table.
*-----get the pointer to meta data
lr_node_info = wd_context->get_node_info( ).
lr_node_info = lr_node_info->get_child_node( `MY_NODE` ).
*----- build set of keys to slect from.
ls_value-key = 'KEYVAL'.
ls_value-value = 'USer friendly text'.
APPEND ls_value TO lt_value_set.
*.... repeat append for as many entries required in dorp down
*----- Set attribute meta data
lr_node_info->set_attribute_value_set( name = `MY ATTR`
value_set = lt_value_set ).
The values should now appear in list. The context will have the key value when selected.
regards
Phil.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.