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 issue....

Former Member
0 Likes
636

Hi,

How can I concatename following string -

His car is 'Black' in color .

The color Black has to be in between commas.

I am getting error when I do the following -

concatenate 'His car is 'Black' in color' into <var_name> is not working.

Please help me.

Regards,

SC

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
607

Try using ` to wrap the literal. You would also need another literal or variable in the CONCATENTATE statement.

concatenate `His car is 'Black' in color` `and has 4 wheels` into <var_name>.

Regards,

Rich Heilman

5 REPLIES 5
Read only

Former Member
0 Likes
607

Hello,

I think Single quote is not possible.

You can try like this.

data:RETURNCODE type string,

valueout type string.

concatenate ' " ' 'black' ' " ' into valueout.

concatenate 'His car is' valueout 'in color' into RETURNCODE.

write RETURNCODE.

Thanks.

Ramya.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
608

Try using ` to wrap the literal. You would also need another literal or variable in the CONCATENTATE statement.

concatenate `His car is 'Black' in color` `and has 4 wheels` into <var_name>.

Regards,

Rich Heilman

Read only

0 Likes
607

By the way, the ` is the key above the Tab key. You can use multiple quotes as well, but this gets confusing in my opinion. Better to use the ` to wrap the literal.

Regards,

Rich Heilman

Read only

0 Likes
607

Thank you.

Problen solved.

Read only

former_member196064
Active Participant
0 Likes
607

DATA: Z_TEMP(500) TYPE C VALUE ' '.

CONCATENATE 'His car is &' 'Black' '& in color' INTO Z_TEMP.

REPLACE ALL OCCURRENCES OF '&' IN Z_TEMP WITH ''''.

*/ Single quotes should show in debug mode