on 06-02-2015 7:38 AM
Hi
I have a webdynpro ALV, and the filter for each column is enabled.
When the filter is being clicked, for fields with domain values, the filter is displaying external values, whilst the column is showing internal values.
When user select one of the filter values (i.e. external values), the table will return NIL value.
e.g. I have a field with domain value:
0 - new
1 - approved
2 - rejected
When filter drop down, it will show: "new", "approved", "rejected".
But i need to key in "user defined filter", and specify "0", then it will be filtered correctly.
If i select "new", it will return NIL result.
How to make the filter show dropdown of internal values, instead of external values?
Thanks for advice.
Rgds
Rusyinni
Hi,
Have you tried this?
Map FILTER_VALUES node from used Component of ALV to Context of ViewController at Context tab. Code as follows.
DATA lo_nd_filter_values TYPE REF TO if_wd_context_node.
DATA ls_filter_values TYPE REF TO if_wd_context_element.
DATA l_wdy_key_value_table TYPE TABLE OF wdy_key_value.
DATA l_wdy_key_value TYPE wdy_key_value.
lo_nd_filter_values = wd_context->get_child_node( name = wd_this->wdctx_filter_values ).
ls_filter_values = lo_nd_filter_values->create_element( ).
ls_filter_values->set_attribute(
name = `FIELDNAME`
value = `ATTR1` "Attribute name that you want to set filter.
).
*Followings are filter values.
l_wdy_key_value-key = `0`.
l_wdy_key_value-value = `New`.
APPEND l_wdy_key_value TO l_wdy_key_value_table.
l_wdy_key_value-key = `1`.
l_wdy_key_value-value = `Approved`.
APPEND l_wdy_key_value TO l_wdy_key_value_table.
l_wdy_key_value-key = `2`.
l_wdy_key_value-value = `Rejected`.
APPEND l_wdy_key_value TO l_wdy_key_value_table.
ls_filter_values->set_attribute(
name = `T_DROPDOWN_VALUES`
value = l_wdy_key_value_table
).
lo_nd_filter_values->bind_element( new_item = ls_filter_values set_initial_elements = abap_false ).
Hope this helps you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.