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: 

GUI_DOWNLOAD: problems with table containing char length 8000

Former Member
0 Kudos

Hi

I have some problems using GUI_DOWNLOAD. Here is some of my code:

DATA: g_record TYPE Z_CHAR8000 OCCURS 0 WITH HEADER LINE.

  • z_char8000 is a char of length 8000

      • insert code to fill data in g_record

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = g_filename

  • filetype = 'ASC'

filetype = 'BIN'

TRUNC_TRAILING_BLANKS = 'X'

TRUNC_TRAILING_BLANKS_EOL = 'X'

TABLES

data_tab = g_record

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.

An example of data in g_record:

Hans,Kruger,Berlin,Superstrass 3,0101709991,,,,,,,,,,,,

When I open the resulting file in notepad the above data is present, and that's a good thing! The bad thing is that for every entry I have in the g_record table the GUI_DOWNLOAD puts 8000 characters into the file (the data from g_record and trailing blanks so that the line becomes 8000 chars long). I dont want the trailing blanks and TRUNC_TRAILING_BLANKS dont seem to work. Have any of you had hte same problem and/or is there a solution?!

I have tried using filetype ASC and here I dont get the trailing blanks, but another problem hits me. I cant download more that 1024 characters from each entry in g_record and thats not good enough!

Regards Anders

2 REPLIES 2

andreas_mann3
Active Contributor
0 Kudos

Hi Andres,

take this itab-definition for your download:

TYPES:BEGIN OF ty_down,
      line TYPE string,
      END OF ty_down.
DATA wa_down TYPE ty_down.
DATA g_record  TYPE TABLE OF ty_down.

regards Andreas

0 Kudos

Hi Andreas

Because I have som other code in my program that uses a structure of type char I need to use char and I cannot use string :((( (hope you understand) So if it is possible I really would love to be able to use char.