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

Inserting Sapces

Former Member
0 Likes
619

Hallo I want to insert spaces in a varribable value.

I have tries with

CONCATENATE ' ' variable to result. But it dont function. Can somebody tell me how can I do it.

regards

rana

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
589

Hi,

try this,

CONCATENATE ' ' f1 f2 INTO f3 SEPARETED BY SPACE

hope it'll help.

Regards,

Sneha.

4 REPLIES 4
Read only

Former Member
0 Likes
589

hi,

if u r adding spaces at the end then it will not be reflected in the output u need to add with some other values followed by sapces ..plz find below the piece of code...

DATA: a(10) type c.

a = 'Abap'.

DATA: b(4) type c.

b = 'Code'.

DATA c(12) type c.

CONCATENATE a b INTO c SEPERATED BY SPACE.

Thanks & Regards

Ashu Singh

Read only

former_member209217
Active Contributor
0 Likes
589

Hi,

Use SEPARATED BY SPACE addition with CONCATENATE statement.

Regards,

Lakshman.

Read only

MarcinPciak
Active Contributor
0 Likes
589

Hi,

If you want to concatenate just a space to a data object (variable), you have to use string literals ` ` (enclosed in back quotes) instead of text literals ' ' (enclosed in normal quotes). This can be done as follows:


data my_var type string value 'Some string'.

concatenate my_var ` ` into my_var.  "not ' '

In contrast to text literals, string literas don't suppress space at the end.

Regards

Marcin

Read only

Former Member
0 Likes
590

Hi,

try this,

CONCATENATE ' ' f1 f2 INTO f3 SEPARETED BY SPACE

hope it'll help.

Regards,

Sneha.