2008 Jan 31 10:01 AM
Hi all,
I have a character variable of size 284, which I want to print out with size 284 no matter how many "non space" characters there are in the variable.
What happens now is that only the characters up the first final blan are printed and not the final blanks.
E.g.:
DATA: line(284) TYPE c .
line = '26547 kjhkji ' .
WRITE / line .
What is then printed is:
26547 kjhkji
The final blanks are not printed. What can I do to write also these final blanks??
Thanks in advance for all the helpful answers!
BR,
Armin
2008 Jan 31 10:11 AM
hi,
set blanks on.
write the above statement before the write statement.
Plzz reward points if it helps.
2008 Jan 31 10:11 AM
hi,
set blanks on.
write the above statement before the write statement.
Plzz reward points if it helps.
2008 Jan 31 10:13 AM
hi
how do u know that the spaces r not printed,
bcoz after 26547 kjhkji
the remaining will be spaces only....
2008 Jan 31 10:14 AM
Hi,
empty spaces are printing
DATA: line(284) TYPE c .
line = '26547 kjhkji ' .
WRITE: line,line .
output:
26547 kjhkji
26547 kjhkji
no / used even then two line bcoz it is printing empty spaces
try this
DATA: line(14) TYPE c .
line = '26547 kjhkji ' .
WRITE: line,line .
cheers,
Will.
2008 Jan 31 10:15 AM
Hi Armin
Spaces are printed but not visible to you
to make it visble
just print another Write statement as i did
check this code :
REPORT ZSBK_DOWNLOAD_IT.
DATA: line(70) TYPE c value 'santosh'.
WRITE line(70) .
write : 'india'.
your code is also working but problem is that when 180 characters exceeded it goes to new line
hope this is helpful for you..
Edited by: Abap-fresher on Jan 31, 2008 11:20 AM
2008 Jan 31 10:17 AM
Thanks for your answer Mandjari! However there is no statement set blanks on in ABAP. There is statement set blank lines on, but that statement only dictates weather or not blank lines should be printed and not weather or not final blanks on one line shoud be printed!
2008 Jan 31 12:06 PM
Hi Armin,
Basically u hv given 284 characters length. while displaying it display's all 284 characters.
Have a look on the following code.
DATA: line(284) TYPE c.
data: ln(10).
line = '26547 kjhkji '.
ln = '1234567890'.
WRITE: line color 5.
write:/ ln color 4.
reward points,if it is useful.
Thanks,
chandu
2008 Jan 31 1:27 PM
Hi all,
Thanks a lot for all the helpful answers.
I understand now that all the lines were printed with final blanks.
What confused me was that I looked at the extraced file (List->Save/Send->File ) and in that the final blanks were removed.
Is there a way yo get the final blanks in the extracted file as well?
BR,
Armin
p.s. I have awarded ya'll with 2P for the helpful answers! Thanks!