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

How to store spaces in variable.

Former Member
0 Likes
2,636

Hi,

I have store 21 spaces in char21 variable how can i do that.

Thanks

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,455

hi,

Move Space to variable.

Hi,

I have store 21 spaces in char21 variable how can i do that.

Thanks

16 REPLIES 16
Read only

Former Member
0 Likes
2,456

hi,

Move Space to variable.

Read only

0 Likes
2,454

Hi,

data g_vairable type char21 value ' '.

-AMR

Edited by: Amresh kumar Panda on Dec 22, 2008 2:55 PM

Edited by: Amresh kumar Panda on Dec 22, 2008 2:56 PM

Read only

Former Member
0 Likes
2,454

Hi ,

Can you explain your specification more clearly?

thanks

siva

Read only

0 Likes
2,454

Data : char21(c) type c.

i want to store 21 empty characters (spaces) in char21 variable.

Read only

0 Likes
2,454

DATA:lv_space(21) TYPE c,

ur_space(21).

lv_space = ' '.

MOVE: lv_space to ur_space.

Try the above code.

Read only

0 Likes
2,454

try this:

data: tab_space(21) type c value ' '.

pk

Read only

0 Likes
2,454

Hi Kishan,

it will store one space in variable based on your logic, i want to store 21 spaces.

Read only

0 Likes
2,454

How do you wish to use these spaces could you tell?

If you wish to append or concatenate it with some other variable then yu dont have to fill it actually with Spaces.

Read only

0 Likes
2,454

I want to use this 21 space if char21 variable is empty, other wise it will store some valu in one conversion program.

Read only

0 Likes
2,454

Hi dear,

CHk below logic:

Do 21 times.

Concatenate SPACE W_Char21 into W_Char21.

Enddo.

Regards,

Piyush

Read only

0 Likes
2,454

i dont really understand what you are trying to do. But if you do something like this:

concatenate wa_ekpo-ebeln wa_ekpo-ebelp into wa_ekpo-con separated by tab_space.

then you can store 21 character spaces. It does not really fit your requirement. but you can make some changes to fit it in.

pk

Read only

0 Likes
2,454

Even if you try to write ayour char21 variable it will leave 21 spaces without moving any spaces in it.

By default it has blanks.

don't know how you intend to check it, but i believe when u declare char21(21) it has blanks in it.

Read only

Former Member
0 Likes
2,454

Hi,

You can use as below.

data: wf_variable type char21.

wf_variable = ` `.

PS: Observe the symbol and send 21 spaces to wf_variable.

Edited by: Deepika Y on Dec 22, 2008 11:06 AM

Read only

Former Member
0 Likes
2,454

Hi,

if you don't have any problem to do it in a static way, then apply this trick.

DATA : space(21) type c.

space = ' '.

write : space, '21 spaces have been written'.

Check this out.

It will solve your problem

Read only

Former Member
0 Likes
2,454

If you want to do this by using code then apply this.

REPORT Y_SPACE.

data : ur_space(21) type c.

DAta : s type c value ' '.

do 21 times.

concatenate s ur_space into ur_space.

enddo.

write : ur_space, 'a'. " See that a is written after 21 spaces.

Read only

Former Member
0 Likes
2,454

Hi,

Declare a constant whose default value is ascii space character by

pressing the key combination of ALT+255 not by hitting spacebar key.

data : co_space_char type c value ' '. "not a normal space it is (ALT+255)
data : char21(21) type c.

do 21 times.
 concatenate char21 co_space_char into char21.
endo.

char21 will be having length 21 with spaces.