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

GUI_DOWNLOAD problem with filetype DBF

Former Member
0 Likes
994

Hi everyone,

My code downloads 4 internal tables to a single excel file by calling gui_download 4 times. The first time, parameter Append is blank, the remaining times, parameter Append is X. It works fine when all filetypes are ASC. I want the last internal table to download as filetype DBF, to preserve some specific formatting. When I change the last filetype to DBF, it no longer appends, but now overwrites the previous internal tables.

Does anyone know how to fix this problem? Here is code:

*download report sections

clear: l_append, l_ftype.

move ' ' to l_append.

move 'ASC' to l_ftype.

perform xl_download tables gt_col_header

using ld_fullpath

l_ftype

l_append.

if sy-subrc eq 0.

move 'X' to l_append.

move 'ASC' to l_ftype.

perform xl_download tables gt_outheader

using ld_fullpath

l_ftype

l_append .

if sy-subrc eq 0.

move 'X' to l_append.

move 'ASC' to l_ftype.

perform xl_download tables gt_col_report

using ld_fullpath

l_ftype

l_append .

if sy-subrc eq 0.

move 'X' to l_append.

move 'DBF' to l_ftype.

perform xl_download tables gt_outreport

using ld_fullpath

l_ftype

l_append.

endif.

endif.

endif.

                    • ********** ********** ********** **********

FORM xl_download TABLES P_DATATAB type standard table

USING p_fullpath

p_ftype

p_append.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = p_fullpath

filetype = p_ftype

APPEND = p_append

write_field_separator = 'X'

TABLES

data_tab = p_datatab

  • FIELDNAMES =

EXCEPTIONS

FILE_WRITE_ERROR = 1

GUI_REFUSE_FILETRANSFER = 2

INVALID_TYPE = 3

NO_AUTHORITY = 4

UNKNOWN_ERROR = 5

HEADER_NOT_ALLOWED = 6

SEPARATOR_NOT_ALLOWED = 7

FILESIZE_NOT_ALLOWED = 8

HEADER_TOO_LONG = 9

DP_ERROR_CREATE = 10

DP_ERROR_SEND = 11

DP_ERROR_WRITE = 12

UNKNOWN_DP_ERROR = 13

ACCESS_DENIED = 14

DP_OUT_OF_MEMORY = 15

DISK_FULL = 16

DP_TIMEOUT = 17

FILE_NOT_FOUND = 18

DATAPROVIDER_EXCEPTION = 19

CONTROL_FLUSH_ERROR = 20 .

ENDFORM. " xl_download

Hi everyone,

My code downloads 4 internal tables to a single excel file by calling gui_download 4 times. The first time, parameter Append is blank, the remaining times, parameter Append is X. It works fine when all filetypes are ASC. I want the last internal table to download as filetype DBF, to preserve some specific formatting. When I change the last filetype to DBF, it no longer appends, but now overwrites the previous internal tables.

Does anyone know how to fix this problem? Here is code:

*download report sections

clear: l_append, l_ftype.

move ' ' to l_append.

move 'ASC' to l_ftype.

perform xl_download tables gt_col_header

using ld_fullpath

l_ftype

l_append.

if sy-subrc eq 0.

move 'X' to l_append.

move 'ASC' to l_ftype.

perform xl_download tables gt_outheader

using ld_fullpath

l_ftype

l_append .

if sy-subrc eq 0.

move 'X' to l_append.

move 'ASC' to l_ftype.

perform xl_download tables gt_col_report

using ld_fullpath

l_ftype

l_append .

if sy-subrc eq 0.

move 'X' to l_append.

move 'DBF' to l_ftype.

perform xl_download tables gt_outreport

using ld_fullpath

l_ftype

l_append.

endif.

endif.

endif.

                    • ********** ********** ********** **********

FORM xl_download TABLES P_DATATAB type standard table

USING p_fullpath

p_ftype

p_append.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = p_fullpath

filetype = p_ftype

APPEND = p_append

write_field_separator = 'X'

TABLES

data_tab = p_datatab

  • FIELDNAMES =

EXCEPTIONS

FILE_WRITE_ERROR = 1

GUI_REFUSE_FILETRANSFER = 2

INVALID_TYPE = 3

NO_AUTHORITY = 4

UNKNOWN_ERROR = 5

HEADER_NOT_ALLOWED = 6

SEPARATOR_NOT_ALLOWED = 7

FILESIZE_NOT_ALLOWED = 8

HEADER_TOO_LONG = 9

DP_ERROR_CREATE = 10

DP_ERROR_SEND = 11

DP_ERROR_WRITE = 12

UNKNOWN_DP_ERROR = 13

ACCESS_DENIED = 14

DP_OUT_OF_MEMORY = 15

DISK_FULL = 16

DP_TIMEOUT = 17

FILE_NOT_FOUND = 18

DATAPROVIDER_EXCEPTION = 19

CONTROL_FLUSH_ERROR = 20 .

ENDFORM. " xl_download

3 REPLIES 3
Read only

Former Member
0 Likes
640
Read only

0 Likes
640

Sunil, I did not see anything related to download of filetype DBF on the website you recommended.

Read only

Former Member
0 Likes
640

Can't use DBF and append it to previous ASC files. No fix available.