cancel
Showing results for 
Search instead for 
Did you mean: 

Web Dynpro ABAP - alv loading default filter values

Former Member
0 Kudos

Greeting,

I have an ALV in a web dynpro in which I am display the filter row automatically. Now I wish to be able to load a default value in a field in the filter row.

How do I do this?

Thanks,

rv

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

I want to just display a value in the filter without executing the filter. This is in an ALV in web dynpro abap.

amy_king
Active Contributor
0 Kudos

Hi Richard,

See .

Cheers,

Amy

Former Member
0 Kudos

You're fast. I'll check it out. Would this work in Web Dynpro?

Former Member
0 Kudos

Hi,

The following code can be used in WDA to set filter value to ALV table:

  DATA:
    lr_alv_usage       TYPE REF TO if_wd_component_usage,
    lr_if_controller   TYPE REF TO iwci_salv_wd_table,
    lr_config          TYPE REF TO cl_salv_wd_config_table,
    lr_column_settings TYPE REF TO if_salv_wd_column_settings,
    lt_columns         TYPE        salv_wd_t_column_ref,
    lr_link            TYPE REF TO cl_salv_wd_uie_link_to_action.

  FIELD-SYMBOLS
    <fs_column> LIKE LINE OF lt_columns.

* Instantiate the ALV Component
  lr_alv_usage = wd_this->wd_cpuse_alv_selection( ).

  IF lr_alv_usage->has_active_component( ) IS INITIAL.
    lr_alv_usage->create_component( ).
  ENDIF.

* Get reference to model
  lr_if_controller = wd_this->wd_cpifc_alv_selection( ).
  lr_config        = lr_if_controller->get_model( ).

  DATA: lr_field TYPE REF TO cl_salv_wd_field.

  lr_field = wd_this->lr_config->if_salv_wd_field_settings~get_field( 'HIGH_LVL_ITEM' ).
  lr_field->if_salv_wd_filter~delete_filter_rules( ).
  lr_field->if_salv_wd_filter~create_filter_rule( low_value = '000000' ).

Thanks,

Pris.