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

Reg : blank spaces

Former Member
0 Likes
939

hi all ,

the reuqirement is that i need to have blank spaces and that needs to be concatenated into another variable ..so how define a constant if the size is 20 type c and i need to have to twenty blank spaces ...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
910

hi,

try to code like this.

data: lv_c(20) type c value '0'. " i think character takes by default value as '0', if so than dont define character value.

loop at itab.

call function 'CONVERSION_EXIT_ALPHA_INPUT'

exporting

input = lv_c

importing

output = lv_c.

concatenate lv_c var1 into var2.

endloop.

hi all ,

the reuqirement is that i need to have blank spaces and that needs to be concatenated into another variable ..so how define a constant if the size is 20 type c and i need to have to twenty blank spaces ...

6 REPLIES 6
Read only

Former Member
0 Likes
911

hi,

try to code like this.

data: lv_c(20) type c value '0'. " i think character takes by default value as '0', if so than dont define character value.

loop at itab.

call function 'CONVERSION_EXIT_ALPHA_INPUT'

exporting

input = lv_c

importing

output = lv_c.

concatenate lv_c var1 into var2.

endloop.

Read only

0 Likes
910

data : abc(20) type c VALUE '0'.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = abc

IMPORTING

OUTPUT = abc

.

concatenate abc into var2.

Read only

peter_ruiz2
Active Contributor
0 Likes
910

hi,

data:

v_count type p,

v_test(20) type c.

v_count = 0.

do 20 times.

v_test+v_count(1) = space.

add 1 to v_count.

enddo.

write v_test.

regards,

Peter

Read only

Former Member
0 Likes
910

Hi!

DATA: gv_string TYPE string,
      gv_3c(3) TYPE c.

gv_string = 'abcdef'.
CLEAR: gv_3c.
CONCATENATE gv_string  gv_string INTO gv_string
  SEPARATED BY gv_3c.

*The output will be 'abcdef   abcdef'.

Regards

Tamá

Read only

Former Member
0 Likes
910

hey execute this program.

data: abc(20) ,pqr(03),lmn(45).

pqr = 'pqr'.

abc = ' '.

CONCATENATE pqr abc pqr into lmn RESPECTING BLANKS.

write:/ lmn.

if u still not gettin output let me know.i'll try to help you.

Read only

Former Member
0 Likes
910

Hello



data: str1(5),
      str2(5),
      str3(20),
      str4(100).
str1 = '11111'.
str2 = '22222'.
str3 = '                    '.
concatenate 'a' str1 str2 into str4 separated by str3.
shift str4 left.
write str4. " '                    11111                    22222'