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

Delete filter option grey out using set_table_for_first_display

former_member420959
Participant
0 Likes
3,045

Hello all,

I am using set_table_for_first_display to display the output.

in the output i set filter on fields and its working fine but if i want to delete filter the delete filter option is greyed out.

Is there any thing we can do to get this.

Thanks

Ujwal

Hello all,

I am using set_table_for_first_display to display the output.

in the output i set filter on fields and its working fine but if i want to delete filter the delete filter option is greyed out.

Is there any thing we can do to get this.

Thanks

Ujwal

14 REPLIES 14
Read only

former_member187748
Active Contributor
0 Likes
2,822

Hi Ujwal,

if you are using a custom container, please change it to a docking container instead.

Can you please provide the code you have written in

SET_TABLE_FOR_FIRST_DISPLAY

Read only

0 Likes
2,822

CALL METHOD cl_alv->set_table_for_first_display

       EXPORTING

         is_layout       = wa_lay

         is_variant      = g_variant

         i_save          = g_save

         i_default       = 'X'

       CHANGING

         it_outtab       = t_final[]

         it_sort         = t_sort[]

         it_fieldcatalog = t_fieldcat.

Read only

0 Likes
2,822

Hi Ujwal,

here is the link providing help on set_table_for_first_display,

please read it carefully and make necessary changes

Help from SAP

set_table_for_first_display (SAP Library - ALV Grid Control (BC-SRV-ALV))

Read only

Former Member
0 Likes
2,822

Hii Ujwal,

Once you have set filter on a field and provide value for filter then in the filter option, delete filter option will be highlighted under filter option. check out whether the filter is set or not. Click on the Filter angle as shown in pics

Highlighted,

If filter is set then delete filter option will be automatically get highlighted.

Try to set filter on other fields and set value for the filters, then check whether the delete filter option is highlighted or not and while clicking delete it's get deleted or not.

regards

Syed

Read only

0 Likes
2,822

Hi syed,

yes I know the option, even i set the filter the delete filter option is not enabled.

Read only

0 Likes
2,822

Hii Ujwal,

Are you setting filter value or not?

If you will just set the filter and will not set the filter value then the delete filter option will not be enabled.

So set filter and filter value and then check whether the delete filter option is enabled or not?

regards

Syed

Read only

0 Likes
2,822

yes, i am giving value also.

Read only

0 Likes
2,822

hi ujwal ,

Have you set the values inside the filter.. I just tried creating a filter in my alv. If i did'nt set any values in filter i can't able to see delete filter button . Only after creating a filter value , I was able to see the delete filter button.

Just a thought. If you have not tried this , give it a try.

Regards,

sivaganesh

Read only

0 Likes
2,822

hi all,

this is a support issue and just now i found whats the problem.

a perform  FILTER_RECORDS is written in HANDLE_USER_COMMAND event

now my problem is he is manually doing the filtering process and filling the internal table and calling the catalog again.

thats the reason its not showing the delete filter option.

is there any method to replace the new vales after filtering without calling the set_table_for_first_display.

Thanks

Ujwal

Read only

0 Likes
2,822

Hii Ujwal,

then it's strange. Generally if the filter is set then delete filter option  will be automatically enabled. Are you able to get the filter symbol on the field on which  set filter in the output as shown in pics

Here i set the filter on sales organization field and in the right most the filter option is visible.

Can you provide code of wa_lay and screen shot of your output having filter set on field.

regards

Syed

Read only

0 Likes
2,822

Hii Ujwal,

Check out whether there is code for filter deletion.

You can find out the deletion code in your codeby looking at this statement if sy-ucomm = '&DELETE_FILTER'.

If this is not in the code then do the coding for filter deletion manually as did for filter set.

Do like below,

IF sy-ucomm EQ '&DELETE_FILTER'.

     *then loop filter data internal table and delete it .

ENDIF.

regards

Syed

Read only

0 Likes
2,822

no there is no code for filter deletion.

Read only

0 Likes
2,822

Hii Ujwal,

Write the code for manual filter deletion in subroutine FILTER_RECORDS which is written in HANDLE_USER_COMMAND event.

Proceed like this,

IF sy-ucomm EQ '&DELETE_FILTER'.

     *then loop filter data internal table and delete it .

ENDIF.

CLEAR sy-ucomm.

Regards

Syed

Read only

0 Likes
2,822

Hello Ujwal,

You can use REFRESH_TABLE_DISPLAY method of class Cl_GUI_ALV_GRID  to Replace the

set_table_for_first_display method for display new table of ALV grid.


First time the screen is called Container is initial so you set_table_for_table _display method next on wards you call refresh_table_display.

If Container is inital

call set_table_for_first_display method.

else.

call refresh_table_display.

endif.

Thanks and Best Regards,

Madhukumar