on 03-11-2011 11:24 AM
Hi Experts,
I have developed an application where I am using Filter functionality on table. It is working fine but how to make the search case insensitive.
Thanks,
Deepshikha
Can you elaborate on what you mean by search case insensitive?
Regards,
Madhu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The only way is to make sure that all the data is converted to the same case. You can use the ABAP commands TRANSLATE TO UPPER CASE, for example. If all your source data is upper case (as is quite often the situation in ABAP) then simply translate the filter to upper case before performing the search for the filter logic.
If all your data is mixed case you might have to create another column in your source internal table to hold a converted version of the text.
If the data in the table itself is mixed, I would suggest creating another column in the internal table (that won't be displayed). You can then loop through the table and for each row copy the dta to the additional column and perform the TRANSLATE TO UPPER CASE on it. This way you have a copy of all the data which is case insensitive in order perform the filter upon.
Hello Thomas,
i thought about it but by this way basically we are converting the data of the complete table in UPPER CASE and then search will be performed using UPPER CASE LETTERS only.
My exact requirement is as this example
Scenario 1:
FILTER
DEEP
DATA
DEEP
dee123
Present result = DEEP
Scenario 2:
FILTER
deep
DATA
DEEP
dee123
Present result = no result ( i want DEEP to come so that search becomes case insensitive without *)
and similarly vice versa.
Convert all data in the table to upper case as Thomas has mentioned. When the user enters the search criteria convert that as well to upper case and then search.
Example:
Data in table before conversion:
deep
Dee123
Data in table after conversion to upper case: (do not display this to user, store it internally)
DEEP
DEE123
Now when the user enters the filter as 'Deep', convert this to upper case. Then it becomes 'DEEP' which can be found in the table as first row. Therefore you can return 'deep' from the orginal table to the user.
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.