11-03-2009 1:55 PM
Hello all,
I want to do something like this:
CONSTANTS: q type c value ' . " << thats a single quote character
DATA: final_string type string,
VAL1(12) type c,
VAL2(12) type c.
concatenate q val1 '-' val2 q into final_string. .
How can I define the single quote character as a constant?
Thanks
11-03-2009 1:56 PM
Hello Ed,
FAQ.
You can declare single quote as constant
If you are aware for single quote (') SAP uses an escape character which is the single quote itself('). Hence for every single quote you have to add an additional single quote.
CONSTANTS: q type c value ''''.
Suhas
11-03-2009 1:56 PM
Hello Ed,
FAQ.
You can declare single quote as constant
If you are aware for single quote (') SAP uses an escape character which is the single quote itself('). Hence for every single quote you have to add an additional single quote.
CONSTANTS: q type c value ''''.
Suhas
11-03-2009 2:51 PM
A more elegant and better looking way of declaring quotes
CONSTANTS: q type c value `'`.
Vikranth
11-03-2009 2:54 PM
Hello Vik,
If you read Rainer's blog on character v/s string processing,
' ' => character processing, ` ` => string processing.
I forgot about this Anyways i have even more elegant solution,
Declare ' as a text-symbol 😄
Suhas
11-03-2009 4:13 PM
Yes.
A co-worker suggested this also ... shortly after I posted the question
I even got to do exactly what I wanted. like this:
data: q type char1.
data: final_string type string,
val1 type string,
val2 type string.
concatenate q val1 val2 q into final_string.
Thanks to all for your replies.
11-03-2009 4:14 PM
11-03-2009 4:57 PM
Hello Suhas,
could you give the URL to that blog of Rainer's? I haven't been able to find it.
Thanks,
Sebastian
11-03-2009 5:12 PM
Hello Seb,
There you are : [/people/rainer.hbenthal/blog/2009/09/22/strings-chars-and-traps|/people/rainer.hbenthal/blog/2009/09/22/strings-chars-and-traps]
Also check Rainer's blog on ALV - SOS.
BR,
Suhas