‎2009 Mar 13 9:06 PM
Hi all,
I have a requirement where I have to pick a value if the text for that value is
MYCARu2019S Lovliest Car.
And so I wrote a query that
SELECT RUECK INTO XRUECK FROM AFVC WHERE ltxa1 = ' MYCARu2019S Lovliest Car'.
ENDSELECT.
But it gives me a syntax error saying
u201CLiterals taking up more than one line not permittedu201D.
Can some one tell me what is wrong. I need to select RUECK value from AFVC table if
ltxa1 value is ' MYCARu2019S Lovliest Car'.
Kindly help what is going wrong...
Regards,
Jessica Sam
‎2009 Mar 13 9:10 PM
Hi,
Give two single quotes..
SELECT rueck INTO xrueck FROM afvc WHERE ltxa1 = ' MYCAR''S Lovliest Car'.
ENDSELECT.Thanks
Naren
‎2009 Mar 13 9:10 PM
Hi,
Give two single quotes..
SELECT rueck INTO xrueck FROM afvc WHERE ltxa1 = ' MYCAR''S Lovliest Car'.
ENDSELECT.Thanks
Naren
‎2009 Mar 13 9:17 PM
Try the below code in the where condition.
' MYCARu2019'S Lovliest Car'.
Mathews
‎2009 Mar 13 9:21 PM
Thanks Mathew and Narendar.
Solved with your suggestion.
Regards,
Jessica Sam
‎2009 Mar 13 9:21 PM
To add to what Naren has pointed out: the ABAP syntax checker always looks for an even number of quotes in code and if it finds an odd number, it assumes that the last one was never closed and goes over multiple lines. The double quotes is a trick that goes back quite a while to fool the syntax checker.
Rob
‎2009 Mar 13 9:22 PM
Hi,
Narendran is right use two single quotes.
also careful wile comparing string. i think as you write ltxa1 value is ' MYCARu2019S Lovliest Car'.
so while comparing you must not use space just before staring use the following
SELECT rueck INTO xrueck FROM afvc WHERE ltxa1 = 'MYCAR''S Lovliest Car'. " Not use Space before M
ENDSELECT.Hope will help you.
Kind Regards,
Faisal