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 put spaces between lines while using append

Former Member
0 Likes
1,125

Hi all,

I have written the following piece of code

i_objtxt_temp = 'Hello all,'.

APPEND i_objtxt_temp  TO i_objtxt .

i_objtxt_temp = 'How are you.'.

APPEND i_objtxt_temp  TO i_objtxt .

The output to which is coming like this

Hello all,

How are you.

Now I need a space between these two lines. Please suggest how can I do that.

Points will be given.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,016

Hi

Just use another append statement with the variable cleared. as shown. which will give a blank line in between and will be printed as if there is space in between. or else rather assign  a space to the variable and then append

i_objtxt_temp = 'Hello all,'.

APPEND i_objtxt_temp  TO i_objtxt .

CLEAR i_objtxt_temp.

APPEND i_objtxt_temp  TO i_objtxt .

i_objtxt_temp = 'How are you.'.

APPEND i_objtxt_temp  TO i_objtxt .

5 REPLIES 5
Read only

Former Member
0 Likes
1,017

Hi

Just use another append statement with the variable cleared. as shown. which will give a blank line in between and will be printed as if there is space in between. or else rather assign  a space to the variable and then append

i_objtxt_temp = 'Hello all,'.

APPEND i_objtxt_temp  TO i_objtxt .

CLEAR i_objtxt_temp.

APPEND i_objtxt_temp  TO i_objtxt .

i_objtxt_temp = 'How are you.'.

APPEND i_objtxt_temp  TO i_objtxt .

Read only

Former Member
0 Likes
1,016

Hi,

Post your requirement clearly so,that we can give better solutions.


Any way PFB....

add an other column like serial number to your table structure and pass sno and text field as empty after every apped.

Read only

Former Member
0 Likes
1,016

Hi , use

APPEND INITIAL LINE TO  i_objtxt 

Read only

Former Member
0 Likes
1,016

Two ways that I can think of immediately.

1. Append initial line to i_objtxt.

2. When you loop thru your internal table and issue write statement, after the first line add a "skip 1" statement.

Thanks,

Vikram.M

Read only

Former Member
0 Likes
1,016

Hi Devanand,

I tried by assigning a space to the variable and it worked.  Thanks!

Thanks to all. It has been solved.

Debapriya