cancel
Showing results for 
Search instead for 
Did you mean: 

Filter Key problem in table without ALV

Former Member
0 Kudos

HI,

I have two tabs in my view. In Each tab I have a table which are binded to different nodes.

Now i am applying FILTER for these two tables using Toolbar UI Element. I have created a ToolBar Toggle button inside this.

In the action (DO_FILTER)of this button i am using the following code.

IF table_1.

l_node = wd_context->get_child_node( if_v_1=>wdctx_n_node1 ).

l_node->invalidate( ).

wd_this->table_method_hndl->apply_filter( ).

ELSEIF table_2.

l_node = wd_context->get_child_node( if_v_2=>wdctx_n_node2 ).

l_node->invalidate( ).

wd_this->table_method_hndl->apply_filter( ).

ENDIF.

In the modify view i am calling this action 'DO_FILTER' for applying my filter option. Now when i run my program the filter keys are working fine.

I am having the problem for the belowing scenario.

1. In tab1 i have 5 rows in table. I apply filter and getting 2 rows in table.

2. Now i use select tab to go to tab2 and there i have 6 rows.

3. Now again i go back to tab1. My problem comes here.

Now it is only displaying 2 rows in table1. (The first two rows in the total no. of 5 rows). (Two rows because in filter only 2 rows where displayed.)

Note: In the select tab when i debug i am able to notice that the internal table which is binding to table1 is having 5 rows and not 2 rows.

My modify code has the following code.

IF lv_a_sel_tab = 'TAB1'.

l_table ?= view->get_element( 'TABLE1' ).

wd_this->table_method_hndl ?= l_table->_method_handler.

IF lv_a_checked = abap_true.

l_table->set_on_filter( 'DO_FILTER' ).

ELSE.

l_table->set_on_filter( ' ' ).

ENDIF.

ELSEIF lv_a_sel_tab = 'TAB2'.

wd_this->table_method_hndl ?= l_table->_method_handler.

IF lv_a_checked = abap_true.

l_table->set_on_filter( 'DO_FILTER' ).

ELSE.

l_table->set_on_filter( ' ' ).

ENDIF.

ENDIF.

Please tell me how to make these deactivation rows active, so that all rows will be displayed when selecting the tab.

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

Hi Delphi,

why not use two different instances of the table method handler - one for each table?

Then on change of tab call the APPLY_FILTER method? Having previously cleared the context attributes that you have set as the filter values for the table columns.

Cheers,

Chris

Answers (0)