04-02-2009 9:57 PM
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.
04-02-2009 10:02 PM
Depending on your database, you may be able to use native SQL to do this. What database are you using?
Rob
04-02-2009 10:03 PM
use this :
SELECT-OPTIONS: so_name FOR makt-maktx LOWER CASE NO INTERVALS.
04-03-2009 10:26 AM
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.
04-03-2009 10:33 AM
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.
04-03-2009 10:41 AM
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
04-03-2009 11:10 AM
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".
04-03-2009 11:13 AM
>
> 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
04-03-2009 11:31 AM
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
04-03-2009 11:45 AM
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
04-03-2009 2:27 PM
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