Skip to Content
avatar image
Former Member

WD ALV(ViewContainerUIElement) get filter value

Hi all,

can someone give me an example how i can get the filter value of my ALV?

Thanks,

Markus

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Sep 03, 2008 at 06:39 PM

    You are going to have to use the ALV Model:

    data l_salv_wd_table type ref to iwci_salv_wd_table.
      l_salv_wd_table = wd_this->wd_cpifc_alv( ).
      data l_table type ref to cl_salv_wd_config_table.
      l_table = l_salv_wd_table->get_model( ).

    There is a method of the model object called GET_FIELDS. This will return a table references to the CL_SALV_WD_FIELD object - one record for each column in the table.

    The CL_SALV_WD_FIELD object has a method GET_FILTER_RULES. This method will return a table of object references to object CL_SALV_WD_FILTER_RULE. From this object you can get the OPERATOR, LOW and HIGH value of the filter object.

    Add comment
    10|10000 characters needed characters exceeded

    • there is no easy solution to your problem

      the alv does not provide a function to get the filtered values.

      but you can do things dynamically.

      get your columns collection (it returns you a table with the column names in the alv)

      loop over the columns

      . for every column get your filtered values like thomas showed

      . put them in a structure of your table type (use assign component <name> of structure <struct> into <field> )

      loop through your data table.

      . loop over the columns

      . . get filter value from structure using assign

      . . get the value in the row using assign

      . . compare values

      . . not ok, delete

      . . ok, keep

      at the end you keep the filtered table.

      hope this helps a bit

  • avatar image
    Former Member
    Sep 03, 2008 at 11:54 AM

    hi,

    Use the component SALV_WD_TABLE as a used component in your component.By default it contains filter,sorter and upload to excel functionalites.

    if you have doubts in this please inform me.

    Regards,

    Ramanan

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I used the component SALV_WD_TABLE.

      Now I need to know how what the values of the filter are. On wich columns what is filtered.

      I hope you understand it

      Best regards,

      Markus