‎2010 Mar 23 3:30 PM
Dear Experts,
I need to concatenate the ' ( ' ) with the text , but I'm unable to declare the constant '
Eg : my text element contans welcome
So I want the result to be 'welcome'
Can some one plese guide me on how to declare the constant for ' .
And how to use concatenate statement in this place.
Thanks
-Amit
‎2010 Mar 23 3:34 PM
Hi
The character ' must be written 2 times when declared as constant
CONSTANTS: ch TYPE c VALUE ''''.
DATA: message(100).
CONCATENATE '(' ch 'WELCOME' ch ')' INTO message.
WRITE message.Regards
Dean Q.
‎2010 Mar 23 3:35 PM
Hi,
DATA: lv_var TYPE c LENGTH 7 VALUE 'Welcome'.
CONSTANTS: lv_con TYPE c LENGTH 7 VALUE 'Welcome'.
Regards
Enrico.
‎2010 Mar 23 3:36 PM
Check this :
Basically you can try one of this:
CONCATENATE '''' 'Welcome' '''' INTO V_STR.For any single quote you want to use you have to add an additional quote as an escape character.
OR, use string literals (back quotes)
CONCATENATE `'` 'Welcome' `'` INTO V_STR.
‎2010 Mar 23 4:22 PM
Moderator message - Please search before asking - post locked Rob