cancel
Showing results for 
Search instead for 
Did you mean: 

Removing filter in the result table

Former Member
0 Kudos

Hello Experts!

In a custom search-result screen, after a search, if I use filter on the screen and filter out result values and again perform search, the filter is not getting removed. The subsequent search results are all having the filter. I have to manually go and remove the filter to remove it. Is there a way to clear the filter values at a new search? I tried using the delete_filter method in the result view do_prepare_output method. But the filter is still not getting removed. Please give some suggestions.

Regards,

Heera

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Ramanunny,

delete_filter method usually removes all the filter. Have you checked wthr this method is getting called from do_prepare_output or not?

Also note ,while selecting on filter  CL_BSP_WD_CONTEXT_NODE_TV->EH_ON_FILTER( ) method is getting triggered.

Regards

Rajarama U

Former Member
0 Kudos

Hi Rajarama,

In the do_prepare_output method, i am explicitly writing code to call the method.

  typed_context->result->delete_filter( abap_false ).

  CALL METHOD super->do_prepare_output.

the method is getting called. But filters are not getting cleared.

former_member188098
Active Contributor
0 Kudos

Hi Heera,

if there is more than one filter on the collection you are using to find the result then you have to use

CALL METHOD lr_col->delete_filter
         EXPORTING
           iv_all = abap_true
.

to delete all the filter.

Regards,

Harish

Former Member
0 Kudos

Hello Heera,

The clear button functionality is used for this reason.After completing a search,try "clear" before you enter

the next criteria.

Clear will reset the filters and sorts

Regards,

Reshma Rao

Former Member
0 Kudos

Hi Reshma,

I tried clearing the result collection before setting the collection ( as it is done on clear in normal search screens). But the filters are not getting cleared still.

vinodkumar_kommineni
Active Contributor
0 Kudos

Hi Heera,

I remember we had a problem that the "filter is not getting retained in 7.0 for a fresh search" - which is the functionality you desire.

So as you are saying it is a custom search there is a probability that the filter criteria is being stored and being applied on result every time. Just debug by putting a break point in do_handle_event .

Regards

Vinod

Former Member
0 Kudos

Hi Vinod,

My issue is that filter is not getting cleared. This is a custom search screen. We dont have the actual ' Search' button. We are searching when user clicks 'Enter'.