Skip to Content
Author's profile photo Aravindan Aravi

Filter in table – Webdynpro abap.

Step 1 :

Create a Webdynpro component.


Step 2   :

Create   a context node as shown below.


Since we are going to use connid as filter value, we have
added it in the node filter_vale.


Step 3 :


Create a table and create binding for that.


Step 4 :

Now go to the connid column of the table and in the property
filter value , bind the attribute which we have created earlier.


Step  5 :

After binding, Go to attributes Tab and create a attribute
as shown below.

Table_hndl         type ref to         if_Wd_table_method_hndl.


Step 6 :

Create a action on table on filter as shown below


Paste the code inside the method  filter.


Step 7 :

Now go to init method and write code to fill data for the


  DATA lo_nd_sflight TYPE REF TO if_wd_context_node.


  DATA lt_sflight TYPE wd_this->Elements_sflight.


* navigate from <CONTEXT> to <SFLIGHT> via lead selection


  lo_nd_sflight = wd_context->get_child_node( name = wd_this->wdctx_sflight ).

Select * from sflight into corresponding fields of  table lt_Sflight up to 10 rows.


  lo_nd_sflight->bind_table( new_items = lt_sflight set_initial_elements = abap_true ).

Step 8:

Now go to modifyview and write the following code to enable the filter Option for the table.

DATA: l_table TYPE REF TO cl_wd_table.

   * Get reference of the table view element


l_table ?= view->get_element( ‘TABLE’ ).    ” HERE WE HAVE TO GIVE THE TABLE NAME.


* Get reference to the Filter & Sorting API


wd_this->TABLE_HNDL ?= l_table->_method_handler.


* Set  the table’s filter action


l_table->set_on_filter( ‘FILTER’ ).


Step 9:

Create a Webdynpro application and test the application.


Step 10:

Now put some value in the filter area and click on filter button.

Say for example lets put 0017 to search and the result is



Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Aravindan,

      I have a question once the table is filtered ,i tried removing the filter value and bring back all the entries back to the table but the table now is empty.

      Author's profile photo Chandra Shekhar Agarwal
      Chandra Shekhar Agarwal

      Bhanu Malik   No need write to following code in modify view method.

      * Set  the table’s filter action

      l_table->set_on_filter( 'FILTER' ).

      and after removing value try to put * then all value will be visible.

      Author's profile photo Former Member
      Former Member

      Hi Chandra,

      Can we achieve search criteria  similar to this in table, for Eg if we enter Ind*, can we retrieve all the names starting with Ind.

      Author's profile photo Chandra Shekhar Agarwal
      Chandra Shekhar Agarwal

      Yes, it will work.

      Try to implement table filter, populate values in table and filter it.

      Author's profile photo Mohit Kumar
      Mohit Kumar

      Hey, Thanks for this, I tried, but it did not work.

      Later I found that "isFiltered" property of the table column must also be checked, I did that and it worked. Did I miss anything?

      Author's profile photo Former Member
      Former Member

      Hi Aravindan,


      I have followed all the steps mentioned above.  But I am getting Filter option in a different way. When I apply filter its working. Here I am not getting the Filter Icon with new Row. Please suggest me if i am doing something wrong. 

      Thanks in advance.




      Author's profile photo Uladzislau Pralat
      Uladzislau Pralat


      Hi Srinivas,

      SAP made some changes to filtering service see OSS # 2215867

      There is not longer filter line in 7.40 onwards. Filtering is accessible view column header context menu. If filter is set then it is indicated by filter icon in column header

      Regards, Uladzislau

      Author's profile photo Marcin Czarny
      Marcin Czarny

      Hi, my filtering works only for one columns. When I added context binding "filter value" for one more columns filtering works still for one column, for other returns empty table. My filter node has 1:N cardinality. Can you help me?

      Author's profile photo N Cuky
      N Cuky


      This post is very helpful. Thank you! I managed to add the filter using wd_this->table_hndl->apply_filter( ) and it works.

      Unfortunately, my organization uses the old version of ABAP WD, so we don't yet have the new Filter functionality in the popup screen. I have a problem: if I want to find values that contain my entered string, I have to put asterisks (*) around it, exactly like when I search in SAP GUI. The problem is, our users don't know this trick, as most of them don't use SAP GUI at all. When one wants to display only the records with "Specific Value" in them, most of the lazy users will just type an abbreviation like "spec" or "val" and expect it to work. They won't understand they need to put the exact string "specific value", and it definitely isn't intuitive to them to wrap their search string with asterisks like " *val* ".

      So, I would like to intervene before the call to apply_filter( ) method, and add some code that puts (*) before and after the entered string, and then calls the apply_filter( ) using the edited string.

      Is it possible? Do you know how to do it?


      Thanks in advanced!