cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP WebDynpro ALV Filter Dropdown

former_member131774
Contributor
0 Kudos

Hi guys,

Is it possbile to do the dropdown list of alv filter?

If so , how to do that?

Thanks in advance.

Best regards,

Vincent

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member515618
Active Participant
0 Kudos

Hi Vincent,

Unfortunately, this is not possible. When you click on Filters it only comes up with an input field as the topmost row where we can set the filtering condition. This comes up as standard UI and hence cannot be changed.

Regards,

Sravan Varagani

former_member131774
Contributor
0 Kudos

Hi Sravan,

Thank you for your reply.

Currently in the table it is possible to add dropdown in the ALV filter.(In SAP NetWeaver 7.0 SP14)

Also if you check the note : 1081907 , does this means it already fixed the problem.

Does that note means it is possbile?

best regards,

Vincent

former_member131774
Contributor
0 Kudos

Done. Problem solved.

0 Kudos

Hello Vincent,

I also want to implement dropdown field in filter row of ALV.

Could you give me code snippet of what you did.

Our server is NW701SP5.

Thanks in advance.

Best regards,

Masaaki YANOKUCHI

0 Kudos

I've done this with "FILTER_VALUES" node of ALV Component.

Masaaki YANOKUCHI

Former Member
0 Kudos

Hi,

Could you please explain how you achieved this filter dropdown in ALV.

Please let us know the steps in detail.

Regards,

Lakshmi.

0 Kudos

Hello Lakshmi,

I did as follows.

1. Go to WDComponent.

2. Add SALV_WD_TABLE as Component use at Used Components tab.

3. Go to ViewController.

4. Add SALV_WD_TABLE as used Component and used Interface at Properties tab.

5. Map FILTER_VALUES node from used Component of ALV to Context of ViewController at Context tab.

6. Code as follows.


  DATA lo_nd_filter_values TYPE REF TO if_wd_context_node.
  DATA ls_filter_values TYPE REF TO if_wd_context_element.
  DATA l_wdy_key_value_table TYPE TABLE OF wdy_key_value.
  DATA l_wdy_key_value TYPE wdy_key_value.

  lo_nd_filter_values = wd_context->get_child_node( name = wd_this->wdctx_filter_values ).

  ls_filter_values = lo_nd_filter_values->create_element( ).
  ls_filter_values->set_attribute(
    name = `FIELDNAME`
    value = `ATTR1`		"Attribute name that you want to set filter.
  ).

*Followings are filter values.
  l_wdy_key_value-key = `0`.
  l_wdy_key_value-value = ``.
  APPEND l_wdy_key_value TO l_wdy_key_value_table.

  l_wdy_key_value-key = `1`.
  l_wdy_key_value-value = `AAAA`.
  APPEND l_wdy_key_value TO l_wdy_key_value_table.

  l_wdy_key_value-key = `2`.
  l_wdy_key_value-value = `BBBB`.
  APPEND l_wdy_key_value TO l_wdy_key_value_table.

  l_wdy_key_value-key = `3`.
  l_wdy_key_value-value = `CCCC`.
  APPEND l_wdy_key_value TO l_wdy_key_value_table.

  ls_filter_values->set_attribute(
    name = `T_DROPDOWN_VALUES`
    value = l_wdy_key_value_table
  ).

  lo_nd_filter_values->bind_element( new_item = ls_filter_values set_initial_elements = abap_false ).

Regards,

Masaaki YANOKUCHI

Edited by: Masaaki Yanokuchi on Jan 26, 2010 10:35 AM

0 Kudos

Hi,

   I want to refresh the lo_nd_filter_values node with different values in the ON_STD_FUNCTION_AFTER event of my custom method. I tried invalidate method and binded the node with new value but still this node lo_nd_filter_values not refreshed only holds the old value .

Kindly give me solution to refresh the dropdown values of node filter_values on select of  particular value in the filter.

Former Member
0 Kudos

Hello ,

Did you find answer , how to reset the filter dropdown ?

Former Member
0 Kudos

Kiruthika,

Did you find a solution for updating the filter dropdown values?

Philipp

Former Member
0 Kudos

My work-around until I find a more elegant solution:

Method ONACTIONSEARCH:

  1. Delete the ALV-component
  2. Create the ALV-component
  3. Update the context-nodes
  4. Navigate to the ALV-component

Code snippet:

  DATA l_view_controller_api TYPE REF TO if_wd_view_controller.
  DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.

  lo_cmp_usage =   wd_this->wd_cpuse_tcc_alv( ).
  lo_cmp_usage->delete_component( ).
  IF lo_cmp_usage->has_active_component( ) IS INITIAL.
    lo_cmp_usage->create_component( ).
  ENDIF.

  wd_this->alv_init( ).

  wd_comp_controller->search( ).
  wd_this->add_filter_values( ).

  l_view_controller_api = wd_this->wd_get_api( ).
  l_view_controller_api->do_dynamic_navigation(
    source_window_name = 'W_MAIN' "the NAME OF the WINDOW
    source_vusage_name = 'V_MAIN_USAGE_1' "the PARAMETER shown
    source_plug_name = 'TO_V1' "define a NEW outbound plug
    target_component_name = 'SALV_WD_TABLE' "all STANDARD
    target_component_usage = 'ALV' "all STANDARD
    target_view_name = 'TABLE' "all STANDARD
    target_plug_name = 'DEFAULT' "all STANDARD
    target_embedding_position = 'V_MAIN/VC_ALV' "main view NAME / *container NAME
  ).
  wd_this->fire_to_v1_plg( ).

former_member131774
Contributor
0 Kudos

Hi Experts,

Could anyone answer this question?

best regards,

Vincent