Skip to Content
0
Former Member
Apr 16, 2010 at 11:24 AM

Filter Key problem in table without ALV

43 Views

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.

  • in any case clear the table's filter strings

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

l_node->invalidate( ).

  • if the filter is off: show the whole shebang

wd_this->table_method_hndl->apply_filter( ).

ELSEIF table_2.

  • in any case clear the table's filter strings

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

l_node->invalidate( ).

  • if the filter is off: show the whole shebang

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'.

  • Get reference of the table view element

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

  • Get reference to the Filter & Sorting API

wd_this->table_method_hndl ?= l_table->_method_handler.

  • Set or cancel the table's filter action

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'.

  • Get reference of the table view element

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

  • Get reference to the Filter & Sorting API

wd_this->table_method_hndl ?= l_table->_method_handler.

  • Set or cancel the table's filter action

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.

Regards,

Delphi.