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,181

i´m trying to download some records from internal table using GUI_DOWNLOAD. but, when the function was execute, i received just one line in the file.

anyone knows what happening?

check if you are passing the header line or the whole table to gui_download

if that does not solve ur issue search in SCN with key words line feed carriage return.

9 REPLIES 9
Read only

former_member156446
Active Contributor
0 Likes
1,158

check if you are passing the header line or the whole table to gui_download

if that does not solve ur issue search in SCN with key words line feed carriage return.

Read only

0 Likes
1,158

i´ve passed internal table not header line.

by the way, i´m testing in function module (se37).

thanks

Read only

0 Likes
1,158

in se37 it would show you single line.. try it in a program it will give you the whole table output.

[Search for sample codes:>:>:>|https://forums.sdn.sap.com/search.jspa?q=gui_download&dateRange=last90days&searchID=25511009&rankBy=10001&start=0]

Read only

0 Likes
1,158

Hi,

Try this code

DATA : w_file_path TYPE string.

w_file_path = p_p_per.

  • Function module to download the file to PC path

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = w_file_path " Path

filetype = 'ASC'

trunc_trailing_blanks_eol = ' '

TABLES

data_tab = p_t_personal " Internal table with data

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.

Regards

Krishna

Read only

0 Likes
1,158

i´ve tried to do this, but it didn´t work!

i´m thinking there is some customizing to do for basis. i did the same test, using sm37, in two enviroment different and one works well and the other no.

thanks.

Read only

0 Likes
1,158

Hi,

open the file in the notepad, click on format and then click on word wrap.... may be that might be the problem...

Regards,

Siddarth

Read only

Former Member
0 Likes
1,158

Hey.

This can help you.

CALL FUNCTION 'GUI_UPLOAD'

EXPORTING

FILENAME = 'D:\NE\TEST.TXT'

FILETYPE = 'ASC'

HAS_FIELD_SEPARATOR = 'X'

IMPORTING

FILELENGTH = fsize

    • HEADER =

TABLES

DATA_TAB = itab.

*EXCEPTIONS

Thanks and Regards,

Krishna Chaitanya G

Read only

Former Member
0 Likes
1,158

Hi,

Try this code

DATA: lv_filetype(10) TYPE c,

lv_gui_sep TYPE c,

lv_file_name TYPE string.

lv_filetype = 'ASC'.

lv_gui_sep = 'X'.

lv_file_name = pa_filep.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = lv_file_name

filetype = lv_filetype

write_field_separator = lv_gui_sep

TABLES

data_tab = tb_output1_file

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.

ENDFORM. "gui_download

Hope it helps.

Regards,

Manish

Read only

0 Likes
1,158

Kindly use

"v_filetype = 'DAT'.

ur problem will be solved...rest the above response are same