cancel
Showing results for 
Search instead for 
Did you mean: 

Filter in Table UI element

former_member222068
Active Participant
0 Kudos

Hi Experts,

   My requirement is to keep filters options like in ALV table. when i click on Filter button, a row should be append  with filter symbol and based on the given input data should be filtered.

  Now can you let me know how to append a row with filter symbol.

Regards,

Sankar

Accepted Solutions (0)

Answers (2)

Answers (2)

bharath_k6
Active Participant
0 Kudos

Hi,

Make use of the below code: -

   METHOD onactionswitch_filter .
  DATA: l_node          TYPE REF TO if_wd_context_node.

* in any case clear the table's filter strings
  l_node = wd_context->get_child_node( if_sort_and_filter_view=>wdctx_filter ).
  l_node->invalidate( ).

* if the filter is off: show the whole shebang
  wd_this->table_method_hndl->apply_filter( ).

ENDMETHOD.

Go through the sample WD component DEMO_TABLE for complete understanding if you stuck up in between.

Check the View - SORT_AND_FILTER_VIEW

Regards,

Bharath.

former_member222068
Active Participant
0 Kudos

Hi Bharath,

  There is no view called SORT_AND_FILTER_VIEW in the component DEMO_TABLE.

Regards,

Sankar

bharath_k6
Active Participant
0 Kudos

Hi,

Follow the below steps.

You must have used TABLE UI element in your WD Component-> Under that create Table ToolBar UI element->Create a Button Filter(Assign filter ICON if required) ->Create a Action for this Button-> Write the below code within this action method.

   METHOD onactionswitch_filter .
  DATA: l_node          TYPE REF TO if_wd_context_node.

* in any case clear the table's filter strings
  l_node = wd_context->get_child_node( if_sort_and_filter_view=>wdctx_filter ).
  l_node->invalidate( ).

* if the filter is off: show the whole shebang
  wd_this->table_method_hndl->apply_filter( ).

ENDMETHOD.

It should work.

Which SAP version you are working on? This view should be there If it is ECC6 with EHP4.

Let me know if you are still not able to achieve the same.

Regards,

Bharath.

Former Member
0 Kudos

Hi,

Here i am giving a sample to get alv filter in webdynpro.

Hope it helps you.

http://www.sapdev.co.uk/sap-webapps/sap-webdynpro/wdp-alv.htm

Karthik.R

former_member222068
Active Participant
0 Kudos

Hi Karthik,

  I need in normal table not in ALV table.

Regards,

Sankar

Former Member
former_member222068
Active Participant
0 Kudos

Hi Karthik,

  I have created a button in Table UI ToolBar. On click on this button, i need filter option like in ALV table.

Regards,

Sankar