Application Development 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: 

Filter Not working in ALV grid

Former Member
0 Kudos
18,456

Hi All,

The filter button in ALV Grid is not working for some fields. if the filter button is selected for a particular field in the ALV grid then no entries are getting displayed in the ALV. For few fields it is working. for few fields is it not displaying any entries after selecting filter.

Please let me know what may be the possible causes for this issue.

Thanks in Advance!

Thanks & Regards,

Preethi G

19 REPLIES 19

former_member342013
Contributor
0 Kudos
5,649

hi,

Just check the Data type of the fields....

data type should same as that is there in the table....

Regards

Smitha

0 Kudos
5,649

Hi,

The data types are correctly declared in the final table that is passed to the FM and also the value in the fileter is also correct.

Please let me know how to proceed further on this.

Thanks & Regards,

Preethi G

Edited by: Preethi Gurramkonda on Dec 23, 2009 6:59 AM

Edited by: Preethi Gurramkonda on Dec 23, 2009 7:08 AM

0 Kudos
5,649

Hi All,

The fields that are declared as Chars the problem is there. for other fields that declared as data dictionary types the problem is not there. Please let em know how to handle this.

Thanks in Advance!

Thanks & Regards,

Preethi G

0 Kudos
5,649

hi

declare all data types as there in the data dictionary..

dnt mention explicitly...

Former Member
0 Kudos
5,649

you might not be passing the correct value to the filter.. copy the exact value and paste

former_member387317
Active Contributor
5,649

Hi Preethi Gurramkonda,

I also faced same problem long back...

Filter will not work for the fields for which values are in lower case letter...

Solution :

Before passing internal table to ALV Grid ,Change the values for those columns to UPPER CASE...

Filter will work then...

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya

0 Kudos
5,649

Hi ,

As suggested converted the lower case field values to upper case. still the filter is not displaying the entries in the ALV.

Please let em know any other settings i need to do at field catalog level.

Thanks & Regards,

Preethi G

0 Kudos
5,649

Hi,

After converting the lower case characters to upper case, the filter has worked .

However in the F4 help in the filter, it is not displaying all the characters of the field values.

Please let me know how to solve this issue.

Many Thanks!

Thanks & Regards,

Preethi G

0 Kudos
5,649

Hi Preethi Gurramkonda,

Please refer below SAP Note 381360

[SAP Note 381360 : For Filter issues and solution|https://service.sap.com/sap/support/notes/381360]

Also check out below SAP Notes

898852

212869 - ALV filter: Incorrect output length on filter popup

174840 - ALV-filter: F4-help with smaller column width

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya

0 Kudos
5,649

try putting '*' after u enter field value in filter. it works.

0 Kudos
5,649

It works as suggested by you. Thanks

0 Kudos
5,649

Or,  in the Field Catalog for that particluar field check the LowerCase field.

Regards

Rich

Former Member
0 Kudos
5,649

Hi...!

I have the same problem thats u have.........and i resolve it.........plz paste ur code here where u having the problem so that i help u to resolve ur problem............!

Regards,

Muhammad Fawad

0 Kudos
5,649

Hello Friends,

Here I do have the same problem with the filter.Could you pls paste the code to resolve the issue.

If i use "*' after the search value then I'm getting the desired results.But Users need this functionality with out ''*

Thanks in Advance..

Regards

VJ

Former Member
0 Kudos
5,649

in the fieldcatalog it should be of type character and should have the output length defined.

Regards,

Prasenjit

former_member282823
Active Participant
0 Kudos
5,649

Hi,

  Ex: your output is something like this

  A                     B                         C

  1                    2                             3

  4                    2                              5

  5                    3                              6

When you filter B for value 2, then internally it creates one more internal table like this

A                    B                         C

1                002                         3

4                002                         5

5                003                         6

it tries to matches value 2 to 002 and it fails to retrive the record.

The solution is try to do the conversion exit on the column/field you are trying to filter it. It will work.

Regards,

Ramesh.

0 Kudos
5,649

Hi,

     In alv grid, if you pass any CSTRING type columns to outtab then filter functionality is not working. In this case you should pass the filter value with pattern(*).

    In most cases we are facing this problem for columns which have ALPHA conversion exit.

    I think the solution is to make sure that the alv outtab should not have any string type columns.

Regards,

Venkatesh

ONavas
Participant
0 Kudos
5,649

I had a similar error with ALV OO

The solution was indicate the correct length of the field in the definition of the object catalog.

The symptom was that popup window don't show the correct length of the field.

Mujeeb
Participant
5,649

Hi Preethi,

I am using ALV grid (CL_GUI_ALV_GRID->SET_TABLE_FOR_FIRST_DISPLAY) and I was facing the similar problem, however I was able to solve this issue. Please look into this it might help you.

Issue1:

  1. When I was clicking on the filter button; filter criteria screen comes with lower length than the length of actual values present in the column. In F4 help you will see full value but when value gets passed to the screen it get truncated.

Solution:

  1. While preparing the field catalog look into the length of data element and pass that length in LVC_S_FCAT-OUTPUTLEN

    

       

Issue2:

  1. When ALV column is of char type and values are upper case and lower case combination, applying filter on such column gives you empty result.

Solution:

  1. While preparing the field catalog pass the  LVC_S_FCAT-LOWERCASE as 'X'

    

    

    

      2. If you are not passing LVC_S_FCAT-LOWERCASE as 'X'  you can put * after the filter values in the selection criteria.


Thanks and regards,

Mujeeb