Skip to Content
author's profile photo Former Member
Former Member

How to store spaces in variable.

Hi,

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

Thanks

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 09:16 AM

    hi,

    Move Space to variable.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 09:17 AM

    Hi ,

    Can you explain your specification more clearly?

    thanks

    siva

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 10:04 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 10:44 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 10:49 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 22, 2008 at 10:57 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.