Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Unique Problem with ALV Filter

Former Member
0 Likes
1,381

Hey.

I have an ALV table created using class  CL_GUI_ALV_GRID.

Users are allowed to delete rows from the ALV, and I am using Method refresh_table_display to allow them to see the changes in real-time. This solution is working well.

However, when a filter is applied on the ALV, it seems that after deletion and refresh, a line that doesn't belong in the filter criteria "sneaks in" to take the deleted line's place. I understand how this could sound weird, so I'm attaching an image with illustration. In this image I am filtering for vendor number 105608, and then try to delete the 2nd row. You can see what happens in the image.

I have been reading through a lot of SCN threads but couldn't find a solution.

I have tried using the set_filter_criteria method after refresh, but it didn't seem to re-apply the filter.

I have tried using set_table_for_first_display and sending it_filter, but that didn't go well either. When I tried calling the method without sending is_variant and is_layout, it worked well and re-applied the filter. However this has messed up the display (affecting the order of columns). When I tried calling the method with the layout and variant, the filter just reset himself.

Any ideas?

Thanks for reading.

2 REPLIES 2
Read only

aferngas
Active Participant
0 Likes
1,020

Hi Mickey,

I just created an example of ALV on my system to take a look but i can't reproduce your error. I can filter and delete a line without errors. Can you attach me the source code so I can check it?

Thanks,

Alex

Read only

ThangaPrakash
Active Contributor
0 Likes
1,020

Hello Mickey,

May be you can try like this.

After filter, use GET_FILTER_CRITERIA.

Delete the 2nd row + Refresh and call method SET_FILTER_CRITERIA.

So that the system will set the same filter criteria again after the deletion+refresh.

Regards,

Thanga