cancel
Showing results for 
Search instead for 
Did you mean: 

How do I implement Filter for Table

Former Member
0 Kudos

Hi Experts,

I need to filter for a table as follows:

- A button which enable / disable filter, when I clicked enable a new row which is filter is displayed and when I clicked it again the filter is off.

- What is the lead selection of context for the filter feature? If I set the lead selection to -1 the filter feature is not working and I got dump?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

This is what needs to be done:

1. An action has to be assigned to the property onFilter of the Table UI element.

2. a node of cardinality (1:1) containing an attribute for each filter

column has to be defined in the context of the corresponding view.

3. To be able to enter filter values for a certain attribute, the property filterValue

of the related TableColumn UI element has to be bound to a context attribute

having the correct type.

4.the property isFiltered of a TableColumn UI element can be

used to display / hide a filter icon in the column heading

5. To set this property dynamically, isFiltered has to be bound to a context

attribute of type WDY_BOOLEAN for each filter column.

6. Thus, another node of cardinality (1:1) has to be defined in the context

of the corresponding view. For each filter column, an attribute of type

WDY_BOOLEAN has to be added keeping the information if a filter icon is

to be displayed in the column heading.

DATA LT_FLIGHTS LIKE WD_COMP_CONTROLLER->GT_FLIGHTS.

DATA LO_ND_FILTER_VALUE TYPE REF TO IF_WD_CONTEXT_NODE.

DATA LO_EL_FILTER_VALUES TYPE REF TO IF_WD_CONTEXT_ELEMENT.

DATA LS_FILTER_VALUES TYPE WD_THIS->ELEMENT_FILTER_VALUES.

DATA LO_ND_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.

lo_el_filter_values->get_static_attributes(

importing

static_attributes = ls_filter_values ).

lt_flights = wd_comp_controller->get_flights.

if not ls_filter_values-carrid is initial.

delete lt_flights where carrid np ls_filter_values-carrid.

endif.

lo_nd_flights->bind_table( lt_flights ).

Thanks,

Abhishek

Answers (2)

Answers (2)

Former Member
0 Kudos

Thank you all for your help!

Former Member
0 Kudos

Refer to test component DEMO_TABLE view SORT_AND_FILTER_VIEW which has the same kind of example.

Regards,

Ravikiran

[My Articles|http://divulgesap.com/profile.php?u=Mg==]