cancel
Showing results for 
Search instead for 
Did you mean: 

WD ALV(ViewContainerUIElement) get filter value

Former Member
0 Kudos

Hi all,

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

Thanks,

Markus

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

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.

Former Member
0 Kudos

Thanks Thomas,

thats was it.

Best regards,

Markus

Former Member
0 Kudos

That was a great idea,

but its not the best i think.

it is not possible to get simply the ALV as a table.

When i get the operator, low_value and high_value than i must look at the table and find out what i must delete from the table.

i missed i simple function or anyone who give me the ALV in a table with all filtered and sorted table.

I have a table with 40 columns and i must check all of them with the filter that is not so fine.

Best regards,

Markus

TomVanDoo
Active Contributor
0 Kudos

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

Answers (1)

Answers (1)

Pramanan
Active Participant
0 Kudos

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

Former Member
0 Kudos

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