cancel
Showing results for 
Search instead for 
Did you mean: 

How to capture the values after applying filter in ALV.

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I have an ALV in my application with 10 projects displayed. Out of those 10 projects, 5 projects have banking as industry.

when you filter the ALV based on industry banking I get 5 projects .In run time how can I capture only these 5 projects. when I debugged and saw the ALV table node is holding 10 prj not 5 prj.

How can read only those 5 values. Kindly help me out with sample code.

Thanks,

Priya

Accepted Solutions (0)

Answers (2)

Answers (2)

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Lekha,

I couldnt get the method in the class which you mentioned. Pls can you let me know the correct class.

Actually my requirememnt is, out of 10 records in the ALV, after applying filter, if I see only 4 records in the table, I want to be able to get these four records into my internal table. When we use get_static_attributes, its brining all 10 records, where as I need reference to only 4 records.

Thanks,

Priya

Former Member
0 Kudos

Hi,

The class name is correct - CL_SALV_WD_FIELD. When you refer the model object(CL_SALV_WD_CONFIG_TABLE-IF_SALV_WD_FIELD_SETTINGS) this will return the field for which

you have applied filter by passing the field name.

Before you try out this approach, check the ALV event ON_CELL_ACTION fro that column name to capture the filtering value. Based on this loop at the table where field eq <<filerting value>> and get the filtered records.

As you have get_static_attributes_table it deosnot return the filtered values.

Regards,

Lekha.

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Thx i have done a work around for this....

Former Member
0 Kudos

Hi Chaitanya Priya,

Even i have the same case now, i need to capture filtered records in any internal table. How did you done that? Can u plz explain that?

Former Member
0 Kudos

Hi,

As per my understanding, when you have applied filter for that field

Refer to this class CL_SALV_WD_FIELD -

Using the method GET_FILTER_RULE's attributes, you can get value that is selected for that filtering.

Using this value you need to filter the records from the node.

As you will get the Internal table for that node entries,

filter this internal table data using this captured value that resulted from filtering method.

Or

Use the ALV event ON_CELL_ACTION for which you are applying the filter column.

I think, In this event you can capture the filtered value.

If this doesn't return anything check the other ALV events.

Please try out this way as I didnt tried it out.

Regards,

Lekha.