on 07-13-2009 11:04 PM
Hi,
I am displaying dropdown in ALV grid by Dropdownkey.It shows up when I press arrow but I want to default it to one value everytime.
Like 'DAY' should be defaulted.How do we do that?
DATA lo_nd_dd TYPE REF TO if_wd_context_node.
DATA lo_el_dd TYPE REF TO if_wd_context_element.
DATA lo_node_info_dd TYPE REF TO if_wd_context_node_info.
* data: wa type wdr_context_attr_value,
* itAB type table of wdr_context_attr_value.
TYPES: BEGIN OF tt,
name TYPE string,
value TYPE string,
END OF tt.
DATA: itab TYPE TABLE OF tt,
wa TYPE tt.
wa-name = 'DAY'.
wa-value = 'DAY'.
APPEND wa TO itab.
wa-name = 'WEEK'.
wa-value = 'WEEK'.
APPEND wa TO itab.
DATA: lr_dropdown TYPE REF TO cl_salv_wd_uie_dropdown_by_key.
CREATE OBJECT lr_dropdown
EXPORTING
selected_key_fieldname = 'DUOMEA'.
ls_columns-r_column->set_cell_editor( lr_dropdown ).
lo_node_info_dd->set_attribute_value_set( " BIND NODE INFO WITH ITAB VALUES
name = 'DUOMEA'
value_set = itab ).
Rgds
vara
Hi,
You can set default value directly at sttribute level, Goto Content->Node->select the attribute and scroll at the bottom and set the Default value as 'DAY'.
Regards,
Radhika.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Raja sekhar,
I have tried
lo_nd_alv_data->set_attribute(
value = 'DAYS'
name = 'DUOMEA').
but I get a dump as
Node COMPONENTCONTROLLER.1.ALV_DATA does not contain any elements
Radhika,
DEFAULT option is only working on Input fields but it doesn't work for ALV grid -Dropdown Cell.
Do we have any other option?
Here is how I mainted attributes.
Attribute Name DUOMEA
Type assignment Type
Type ZSCH-DUOMEA -- this is of char 10
Read-only 0
Default Value 'DAYS'
Null Value 0
Input Help Mode Automatic
Determined Input Help
Type of Input Help
Formatting
Compression Default Value
Rgds
vara
>
> Hi Vara
>
> defaulting a value for a dropdown by key is not possible , it is only possible through dropdown by index.
> or if it is a input field it can be defaulted as radhika said.
> try with the dropdown by index
That is not correct. Of course you can set a default value for a DDLBbyKey. You just need to set the default value into the attribute of the element that the DLLB is bound to.
Hi,
To achieve this, you will have to set the context attribute value to 'DAY' and this value will be shown as defalut in the dropdown.
lo_node_info_dd->set_attribute( name = 'DUOMEA' value = 'DAY' ).
Regards,
Manne.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
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.