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

Function for Case Insensitive

Former Member
0 Likes
760

Hi all,

Can anybody tell any logic or function module to find the records when user enter in selection screem (for ex)

Ram 0r

ram or

RAM or

any such combination. It will consider all the input same and fetch the records.

Best Regards,

Aastha

7 REPLIES 7
Read only

Former Member
0 Likes
735

Hi,

No conditions Required as it will be stored in the form of Capital letters in the Database.

Read only

Former Member
0 Likes
735

Hi Aastha Gupta,

Generally when we enter any value in selection screen field and press enter it automatically coverts the alphabets in to CAPITALS.

If we declare the parameters as lower case then we need to use some logic.

as data base stores the data in upper case, we need to convert the data to upper case using TRANSLATE keyword and then we need to fetch data from database.

Best regards,

raam

Read only

Former Member
0 Likes
735

Hi,

parameters: p_name(20) type c lower case.

Example:

tables pa0001.

parameters: p_name type pa0001-ename lower case.

select-options: s_name for pa0001-ename lower case.

Edited by: Velangini Showry Maria Kumar Bandanadham on May 23, 2008 10:47 AM

Read only

Former Member
0 Likes
735

Hi,

As such by default SAP uses upper case to store in the database and converts all the inputs on the screen to upper case. However It depends on how the domain has been defined for the field . If the Lowercase checkbox is checked in the Output characteristics of the domain , then the data can be stored in sentence case ex, RAM, Ram or ram. Then it will not find a entry if you have entered 'RAM' in the data base but try to find and entry with 'ram'.

regards,

Advait.

Read only

0 Likes
735

If the lower case check box is checked in domain (Example TEXT132 domain) then how do we fetch entries by ignoring case.

KNA1-knurl is one such example. This field is on the selection screen.

I want to fetch URL entries irrespective of case.

example: www.sdn.sap.com or WWW.SDN.SAP.COM should both be treated the same.

Read only

Former Member
0 Likes
735

Hi Astha,

If the field is not case sensitive, you can directly use that inside select query.

If the filed is case sensitive , do use that in the select query.

After fetching the data, compare it with the input as

IF ITAB-NAME CS P_NAME

Read only

Former Member
0 Likes
735

Use TRANSLATE statement to convert to Upper case or lower

case before the database select.


TRANSLATE string5 TO UPPER CASE
or 
TRANSLATE string5 TO LOWER CASE.