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

Escape Sequence

Former Member
0 Likes
1,624

Hi Experts,

maybe this question is far to simple, but I just can't find out what escape sequences to use for ABAP.

The problem ist, that I want to build a string via CONCATENATE like:

CONCATENATE '/'' <fs>-field '/'' INTO string.

The string shall look like 'value_from_<fs>-field' . The / are the wrong escape characters here. My question is what character do I have to use?

Regards

Torsten

1 ACCEPTED SOLUTION
Read only

former_member189059
Active Contributor
0 Likes
1,282

try this

data: output(40).
concatenate 'field1' '''' 'field2' into output.
write:/ output.

is this what you want ?

the '' is the escape sequence for apostrophe and since it is a string type, it should be enclosed in another set of ''

hence it becomes ''''

Message was edited by:

Kris Donald

5 REPLIES 5
Read only

former_member189059
Active Contributor
0 Likes
1,283

try this

data: output(40).
concatenate 'field1' '''' 'field2' into output.
write:/ output.

is this what you want ?

the '' is the escape sequence for apostrophe and since it is a string type, it should be enclosed in another set of ''

hence it becomes ''''

Message was edited by:

Kris Donald

Read only

0 Likes
1,282

Hi Kris,

yes '''' was what I was looking for. Is ' the general escape character for ABAP?

Regards

Torsten

Read only

0 Likes
1,282

Hello Torsten,

I'm not sure, but when it comes to strings, only the apostrophe needs an escape sequence since everything else is accepted as a character

Read only

0 Likes
1,282

Thanks Kris, that should do it for now.

Read only

Former Member
0 Likes
1,282

hi

Just write this:

variable = <fs_field>.

write: / variable.

Regards

Preeti