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

Removing filter for ALV grid

Former Member
0 Likes
3,925

Hi friends

I am using an ALV grid to display my data. Once i used the filter in grid to filter some datas and go back to selection screen & executed the report again, the filter is still active and not showing all datas. How to avoid this.

Regards

Sathar

8 REPLIES 8
Read only

Former Member
0 Likes
2,092

Are you setting any Filter, I mean passing Filter information to the ALV function.

If possible post the code here..

Read only

0 Likes
2,092

Hi Vijay

I am not setting any filter in my coding. In the display if we filter using the std tool available in grid and we go back to sel screen & execute again the filter which i put previously it is still active.

Regards

Sathar

Read only

0 Likes
2,092

I am not facing any issue like that. and also when you set the filter and see the filter results

Then you can see a button Delter filter next to Filter button, Shortcut: CtrlShftF2 , Delete the filter and try.

Ideally it should refresh the data. are you using Normal ALV Grid or OO ALV Grid.

Read only

0 Likes
2,092

Hi Vijay

I'm using OO ALV grid.

The user dont want to delete the filter. If he press back button & execute again he should be able to see the entire data.

I have seen one method named 'INIT_TOOLBAR' in class cl_gui_alv_grid . will it help?? It is a protected method and how can i use than in my program.

Also, seen one attribute 'MC_FC_DELETE_FILTER' in this class. I tried to use that like g_grid=>MC_FC_DELETE_FILTER but it is showing syntax erroe.

Regards

Sathar

Read only

0 Likes
2,092

I am sure Problem is with your code , even i tested OO ALV it is working fine for me.

You post the code if possible , or simulate the same on some test program and post it here..

Read only

0 Likes
2,092
MODULE display_alv_9001 OUTPUT.
  CLEAR gt_fcat.

  IF g_ref_control IS INITIAL.

    CREATE OBJECT g_ref_control
      EXPORTING
        container_name = 'CONTROL'.

    CREATE OBJECT g_ref_alv
      EXPORTING
        i_parent = g_ref_control.

    PERFORM fieldcat.
    PERFORM layout.


    CALL METHOD g_ref_alv->set_table_for_first_display
      EXPORTING
        is_layout       = gs_layo
      CHANGING
        it_outtab       = gt_bsid
        it_fieldcatalog = gt_fcat.

  ELSE.
    CALL METHOD g_ref_alv->refresh_table_display.

  ENDIF.


ENDMODULE.                 " display_alv_9001  OUTPUT

MODULE back_command_9001 INPUT.

  g_save_code = sy-ucomm.

  CASE g_save_code.

    WHEN 'BACK'.

      LEAVE TO SCREEN 9000.

  ENDCASE.

ENDMODULE.                 " back_command_9001  INPUT
Read only

uwe_schieferstein
Active Contributor
0 Likes
2,092

Hello Sathar

You could define a layout for your ALV list showing all entries (i.e. no filtering) and define this one as default layout. For the filtered list you define another layout but do not set it as "default layout".

Regards

Uwe

Read only

Former Member
0 Likes
2,092

Hi Abdul Sathar

I find the solution if you are using ALV OO.

For delete the ALV's filter call the method SET_FILTER_CRITERIA and send the parameter IT_FILTER with a itab empty.

I hope this help you.