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

problem with GUI_DOWNLOAD

Former Member
0 Likes
1,093

DATA: BEGIN OF t_interface OCCURS 0,

var1(12) type c value '0.00'

sep1 type c value '|',

var2(18),

sep2 type c value '|',

endof t_interface .

im using GUI_DOWNLOAD to download the table t_interface to a .txt file but a have this result:

0.00

AGUAC/GAS123

But i want this, i already use condense ...any help .

0.00

AGUAC/GAS123

regards

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,009

Hi Luis,

Have you set TRUNC_TRAILING_BLANKS as 'X' of GUI_DOWNLOAD?

Cheers,

Patrick

DATA: BEGIN OF t_interface OCCURS 0,

var1(12) type c value '0.00'

sep1 type c value '|',

var2(18),

sep2 type c value '|',

endof t_interface .

im using GUI_DOWNLOAD to download the table t_interface to a .txt file but a have this result:

0.00

AGUAC/GAS123

But i want this, i already use condense ...any help .

0.00

AGUAC/GAS123

regards

9 REPLIES 9
Read only

Former Member
0 Likes
1,010

Hi Luis,

Have you set TRUNC_TRAILING_BLANKS as 'X' of GUI_DOWNLOAD?

Cheers,

Patrick

Read only

0 Likes
1,009

tks it works Weeeeeeeeeeeeeeeeeeeeeeee!!!

Regards,

Luis

Read only

Former Member
0 Likes
1,009

Hi Luis,

Think Condense should work. When are you condensing the values. Try condensing before moving the data to the internal table.

Hope this helps

Cheers

VJ

Read only

0 Likes
1,009

Just for the option,

Can you check what is the Data Type of the first column.

If it is TYPE C, you will not get any blank spaces.

RohitPS Do not forget to Reward Points if the solution helps

Read only

0 Likes
1,009

Use the TRUNC_TRAILING_BLANKS and TRUNC_TRAILING_BLANKS_EOL options of GUI_DOWNLOAD.

By default, system truncates blanks at the end of the fields. You can use these options to transfer the blanks to the file as well.

Read only

Former Member
0 Likes
1,009

Hi Luis,

Use CONDENSE c NO-GAPS.

Thanks,

Susmitha

Read only

Former Member
0 Likes
1,009

hi luis,

welcome to SDN,

set TRUNC_TRAILING_BLANKS = 'X'.

hope this helps,

priya.

Read only

Former Member
0 Likes
1,009

Hey Luis,

just copy and run the code.

You will get the output as you have asked.

  • Start of code

DATA: BEGIN OF t_interface OCCURS 0,

sep TYPE c ,

var1(12) TYPE c ,

sep1 TYPE c ,

var2(18),

sep2 TYPE c ,

END OF t_interface .

t_interface-var1 = '0.00'.

t_interface-sep = '|'.

t_interface-sep1 = '|'.

t_interface-sep2 = '|'.

t_interface-var2 = 'AGUAC/GAS123'.

APPEND t_interface.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = 'D:\file_test.txt'

filetype = 'ASC'

  • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = 'I'

  • HEADER = '00'

trunc_trailing_blanks = 'X'

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

replacement = '*'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • IMPORTING

  • FILELENGTH =

TABLES

data_tab = t_interface

  • FIELDNAMES =

EXCEPTIONS

file_write_error = 1

no_batch = 2

gui_refuse_filetransfer = 3

invalid_type = 4

no_authority = 5

unknown_error = 6

header_not_allowed = 7

separator_not_allowed = 8

filesize_not_allowed = 9

header_too_long = 10

dp_error_create = 11

dp_error_send = 12

dp_error_write = 13

unknown_dp_error = 14

access_denied = 15

dp_out_of_memory = 16

disk_full = 17

dp_timeout = 18

file_not_found = 19

dataprovider_exception = 20

control_flush_error = 21

OTHERS = 22

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

      • End of Code .

Regards,

Kunal.

Read only

Former Member
0 Likes
1,009

try condense t_interface no-gaps.

if it doesn't work , declare an internal table <itab> which can take all the characters of the internal table t_interface.

concatenate all the fields of the internal table into the <itab> and then use condense <itab> no-gaps.