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: 

case insensitive search in select statement

former_member583013
Active Contributor
0 Kudos

Hi Experts,

I have entries in table as mixed case. For example i am searching on an attribute called description in the table. I want the serch to be case insensitive for that attribute. Because in table it is i.e. JUMBO Pack and in the search attribute it is i.e. Jumbo Pack.

I do not want to translate both to the same case and search. Is there an option?

Best Regards!

Sandip

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos

If its not a 'Z' table then there is no option.

But you can try some thing like

if aB is the input.

You can generate the cobinations and put into a range and then use in select

aB

Ab

ab

AB

Its a hard logic to build .. BUt i see this as an option

8 REPLIES 8

Former Member
0 Kudos

Hello,

Check if the Lowecase checkbox is checked in the domain attributes of the particular field of the table. If its a Z table, and this checkbox is not set, you can check it and make the search case insensitive.

Vikranth

0 Kudos

Hi Vikranth,

The checkbox is checked in the domain. That is why, "If this indicator is set, upper case and lower case are distinguished when you enter values with screen masks.

Otherwise all the letters entered will be converted to upper case when you enter values with a screen mask.

This mechanism is in effect for all the fields referring to this domain.".

This doesn't help my purpose. Thanks for the help.

Best Regards!

Sandip

kesavadas_thekkillath
Active Contributor
0 Kudos

If its not a 'Z' table then there is no option.

But you can try some thing like

if aB is the input.

You can generate the cobinations and put into a range and then use in select

aB

Ab

ab

AB

Its a hard logic to build .. BUt i see this as an option

0 Kudos

Hi KSD,

This seems to be a much tougher proposition than converting both strings to a common case and compare.

Thanks for the help.

Best Regards!

Sandip

0 Kudos

Hi Sandip, I wrote a wiki for a similar scenario: [select the text from lower case data element|http://wiki.sdn.sap.com/wiki/x/6gGHBQ] hope that helps you.

0 Kudos

Hi Guys,

Thanks for your suggestions. But i do not find a direct alternative to translating and comparing. So i am closing the message. Atleast this post helped to know that there is no direct ABAP supported way to copare mixed strings. Eg: like ignore case parameters for string matching in many languages .

Thanks!

Sandip

former_member217544
Active Contributor
0 Kudos

Hi Sandip,

One more alternative:

If ztext is ur original field which is saving the mixed text.

Append one extra field(ztext_upper) to the table.

Now if " Sap Sdn" is the text we are saving then

While saving the entires to the table,

1. asusual save the value(" Sap Sdn") to teh original field(ztext)

2. translate the value to upper case(SAP SDN) and save this entry to teh newly appended field(ztext_upper)

Now while doing search, translate to upper case and compare with the value in ztext_upper. If it satisfies then for display options select the original value from the field (ztext) which is corresponding to the satisfied ztext_upper field.

Regards,

Swarna Munukoti.

kesavadas_thekkillath
Active Contributor
0 Kudos

HI Sandeep,

Which table you are using ?