Application Development 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: 

download space character

rt50896
Participant
0 Kudos

Dear all,

i meet a problem: i want to download report data in internal table by FM WS_DOWNLOAD,and this internal's last column is space (length 8). but i can't remain the last column space in local text file after download.

ex. AAAABBB________ --> internal table (ok)

AAAABBB --> download to local text file (NG)

how can i remain the space character in text file by download? or other way to remain it?

TKS

Regina

7 REPLIES 7

Former Member
0 Kudos

Hi,

Use GUI_DOWNLOAD insted

Fill Input Parameters

TRUNC_TRAILING_BLANKS = SPACE

WRITE_LF = "X"

Reward if found useful...

Regards,

Gaurav

0 Kudos

After test,but it still not work!

is there anything wrong in my code:


DATA: BEGIN OF ITAB OCCURS 0,
      A(5),
      B(5),
      C(5),
      END OF ITAB.
ITAB-A = 'AAAAA'.
ITAB-B = 'BBBBB'.
ITAB-C = ''.
APPEND ITAB.

CALL FUNCTION 'GUI_DOWNLOAD'
  EXPORTING
    FILENAME                      = 'C:Test.TXT'
    FILETYPE                      = 'ASC'
    TRUNC_TRAILING_BLANKS         = ''
    WRITE_LF                      = 'X'
  TABLES
    DATA_TAB                      = ITAB
 EXCEPTIONS
   FILE_WRITE_ERROR              = 1.

0 Kudos

I tried so many ways ,it does not work.

finally i did last charcter i download one # symbol

0 Kudos

yes,this is an idea i also tried,

but we have a restrict that the total column length must be match download format

although last char. can be define...

if don't want to replace the last char. manually,how do i do?

0 Kudos

hi

good

i would suggest you not try to download and blank character value ,its better if you put any value for that in the text file,or discuss with your functional consultant and give any word that ll identify as the blank space.

thanks

mrutyun^

Former Member
0 Kudos

Hi.

Try using de following parameters:

FILENAME = <complete with file name>

FILETYPE = 'ASC'

TRUNC_TRAILING_BLANKS = ' '

WRITE_LF = 'X'

TRUNC_TRAILING_BLANKS_EOL = ' '

It worked for me in ECC 6.0.

Regards.

Sebastian.

Former Member
0 Kudos

hi,

go through this code,

DATA: BEGIN OF itab OCCURS 0,

a(5),

b(5),

c(5),

END OF itab.

DATA: l_f_length TYPE i.

itab-a = 'AAAAA'.

itab-b = 'BBBBB'.

itab-c = ''.

APPEND itab.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = 'C:\Test.TXT'

filetype = 'ASC'

trunc_trailing_blanks = 'X'

write_lf = 'X'

IMPORTING

filelength = l_f_length

TABLES

data_tab = itab

EXCEPTIONS

file_write_error = 1.

LOOP AT itab.

WRITE: l_f_length.

ENDLOOP.

<b>please reward points if helpfull.</b>

with regards,

radhika kolluru.