Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Concatenate statement

Former Member
0 Likes
531

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

4 REPLIES 4
Read only

Former Member
0 Likes
504

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.

Read only

0 Likes
504

Hi,

DATA: lv_var TYPE c LENGTH 7 VALUE 'Welcome'.

CONSTANTS: lv_con TYPE c LENGTH 7 VALUE 'Welcome'.

Regards

Enrico.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
504

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.

Read only

Former Member
0 Likes
504

Moderator message - Please search before asking - post locked Rob