‎2005 May 23 10:46 AM
Hi guys,
I want to edit a string by using a function like UpperCase or LowerCase. Is there any function in ABAP which has the same functionality?
next problem is:
Can i use this function in an SQL query?
Like: Select SINGLE IDSEGMENT
FROM Table
INTO IDSEG
WHERE Upcase(string1) = Upcase(string2).
Is this possible?
Problem is that in the DB the string1 is spelled different (capital letters) than string2
‎2005 May 23 11:22 AM
Hi,
Use the string comparision operator CS in your select query which is not case-sensistive.
Regards,
Vijay S
‎2005 May 23 10:50 AM
Hi,
Try this out
*Code to demonstrate TRANSLATE to UPPER/LOWER CASE command
*----
DATA: ld_char(20) type c.
ld_char = 'Hello World'.
TRANSLATE ld_char TO UPPER CASE. "Result: ld_char = 'HELLO WORLD'
TRANSLATE ld_char TO LOWER CASE. "Result: ld_char = 'hello world'
See this link
http://help.sap.com/saphelp_46c/helpdata/en/fc/eb33a5358411d1829f0000e829fbfe/frameset.htm
Thanks & Regards,
Judith.
‎2005 May 23 10:52 AM
Thanks Judith,
but this was only my first problem,
any proposal for my second problem?
‎2005 May 23 10:56 AM
Hi Marcus,
Translate str to upper case.
Select SINGLE IDSEGMENT
FROM Table
INTO IDSEG
WHERE string = str.
Regards Andreas
‎2005 May 23 10:58 AM
Ok. But how can i translate the variable string?
I want both variables (str & string) to translate to upper case!
How about that?
‎2005 May 23 11:01 AM
Hi,
U cant use <b>Upcase</b>(string1) = <b>Upcase</b>(string2) in select query.
Can compare two strings thats all.Try removing that upcase and check.
Thanks & Regards,
Judith.
‎2005 May 23 11:01 AM
‎2005 May 23 11:12 AM
Hi Marcus,
Select your database table data into an internal table and use the FIND command.
You can then use the ignoring case keyword.
If less than basis 6.1 you can use SEARCH (but may have to convert internal table to uppercase before searching).
Cheers,
Brad
‎2005 May 23 11:17 AM
Actually,
FIND doesn't really support internal tables, and SEARCH doesn't have IGNORING CASE.
So you'll have to make a trade off between looping through your internal table and using FIND, or translating the internal table to uppercase and using SEARCH.
I think I'd go for looping through your table and using FIND.
Brad
‎2005 May 23 11:22 AM
Hi,
Use the string comparision operator CS in your select query which is not case-sensistive.
Regards,
Vijay S
‎2005 May 23 12:19 PM
Thank you all for ur answers.
I solved the problem with the solution from Vijayakrishnan.
Regards,
Marcus Pohl
‎2005 May 23 12:29 PM
Thank you all for ur answers.
But CS isn´t a valid comparison
Regards,
Marcus Pohl
‎2005 May 23 12:32 PM
Hi,
Try using LOWER(string1) = string
Also u can compare UPPER(string1) = String.
Like this convert anyone of teh string to the other and try it out.
Thanks & Regards,
Judith.
‎2005 May 23 12:33 PM
I didn't think so...
I think you are stuck with the internal table approach.
Brad