‎2007 Feb 16 8:24 AM
Hi All,
i have a table in the abap-dictionary filled with names...when i try to select them with the select-statement with condition:
table-name_column like 'some_name'
I have encountered some problems...the inquiry is case-sensitive. What i want to do is to read the value from the abap-dictionary table uppercase or lowercase and compare it with the needed value also translated in uppercase or lowercase.
The only idea i have is to select all values of the dictionary table into an internal table and to translate the values there in uppercase or lowercase and then to loop trough it. But this approach would cost a lot of performance.
Do someone has an other proposal?
‎2007 Feb 16 8:27 AM
Hello Anton,
Your solution is one; there is another one which SAP frequently uses when facing this problem. Define another field in the table of the same length as the one which is case-sensitive but this field will hold the value in uppercase. You can than use this field (perhaps even defining an index for performance reasons) for your selections.
Regards,
John.
‎2007 Feb 16 8:27 AM
Hello Anton,
Your solution is one; there is another one which SAP frequently uses when facing this problem. Define another field in the table of the same length as the one which is case-sensitive but this field will hold the value in uppercase. You can than use this field (perhaps even defining an index for performance reasons) for your selections.
Regards,
John.
‎2007 Feb 16 8:42 AM
check...
It would be difficult , because it is based on how data is stored in the data base , now consider the scenario of the system i am using , we can material description as 'test' or 'TEST' , 'Test' .
If in your system there are only stored in either caps or small the you can perform the select twice .
But i myself dont find it to be such a good solution , but you can give it a try
There is one more solution specific to material description ,and that is in the table MAKT there is a field MAKTG , which stored the description in uppercase , so for this you can first convert the description to uppercase and then perform select on this field
‎2007 Feb 16 8:45 AM
Hi
In the selection-screen design itself.
Selection-screen : field type table-fieldname lower-case/upper case.
u can get the required case data only.
Regards,
kumar
‎2007 Feb 16 2:41 PM
If the field will be selected against in many times multiple applications, then use the suggestion of creating an uppercase field and translate it everytime the case sensitive field changes.
However, if this is for a single application, consider native SQL. Something like:
REPORT ztest NO STANDARD PAGE HEADING.
TABLES lfa1.
DATA: name LIKE lfa1-name1 VALUE 'YOUR NAME HERE'.
EXEC SQL.
SELECT *
INTO :LFA1
FROM LFA1
WHERE UPPER(NAME1) = :NAME
ENDEXEC.
Rob