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: 

Select clause where comparison String

Former Member
0 Kudos

Hello Experts,

I have an issue.

I have in the selection screen one Select-option without intervals.

This select-option for one filed NAME (String).

In my specific table, the name can be in upper case or low case or both like: Smith, SMITH or smith or SmiTh...

For my case, in the table i have: "Smith" and when i put Smith in the select-option, in debugg i have "SMITH" so in the query Select, it doesn't return anything.

Exists a way to do Select Upper(Field) = Parameter of the selection-screen?

Exist other way apart from do the selection with other criteria and after a Loop and compare the Upper (Field) with the parameter of the selection screen? I want do it in the query?

Thank you very much.

10 REPLIES 10

Former Member
0 Kudos

Depending on your database, you may be able to use native SQL to do this. What database are you using?

Rob

former_member156446
Active Contributor
0 Kudos

use this :

SELECT-OPTIONS: so_name FOR makt-maktx LOWER CASE NO INTERVALS.

0 Kudos

Thank you for your reply.

The Database is ORACLE , Version 9.2.0.8.0.

It's possible?

J@Y, i Can't do the low case because, i can found the upper cas too.

Former Member
0 Kudos

Hi,

Try this.

make the select option of the type data element of the field which are using in the select stmt to compare, so the select option will have the same values as you have entered in it.

Hope this helps.

Regards,

Sharin.

0 Kudos

Hello Sharin,

So using the same data element will help but it will not be a full-proof solution.

Consider this: The user can input 'Smith', 'SMITH', 'smith' in the sel. screen. But none of that will fetch data if you have 'sMiTh' in the DB table. I hope you understand the flaw.

@ OP: This is happening b'coz the DB field in consideration is "case sensitive". In the domain of the dataelement you can see that the checkbox: "Lowercase": is checked.

BR,

Suhas

Edited by: Suhas Saha on Apr 3, 2009 11:45 AM

0 Kudos

Hello Sharine,

Thank you for your reply.

I try it but doesn't work. Because in the Databse the name is Smith and in the paramater the name is "SMITH".

SuhaSaha
Advisor
Advisor
0 Kudos

>

> Exist other way apart from do the selection with other criteria and after a Loop and compare the Upper (Field) with the parameter of the selection screen? I want do it in the query?

>

Hello Salhi,

I think this the best workaround i can think of. I donot know of any direct approach.

Awaiting other responses.

BR,

Suhas

Former Member
0 Kudos

Thank you Suhas,

I have found the syntax "Lower Case". It works but the problem that we can't ask the user to write the text exactly like in the DB table.

The councillor must be able to recuperate the record in all of the cases.

BR,

Amal

Former Member
0 Kudos

Hi,

Check for the matchcode field from the NAME in the DB table you are searching from.

Generally SAP use's these MATCH Code field to search the records depening on the name value as these fields stores the value in uppercase.

Ex: in KNA1 table the values which are stores in the NAME1 NAME2 ORT01 will be stored same in

MCOD1 MCOD2 MCOD3 but in upper case. So you can use these fields in searching data from the report program.

NAME1 - MCOD1
NAME2 - MCOD2
ORT01 -MCOD2

Former Member
0 Kudos

As I said, native SQL should work. Try:

TABLES lfa1.

DATA: name LIKE lfa1-name1 VALUE 'SMITH'.

EXEC SQL.
  SELECT *
  INTO :LFA1
  FROM  LFA1
  WHERE UPPER(NAME1)  =  :NAME
ENDEXEC.

Rob