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 downloading data table

Former Member
0 Likes
523

Hi again.

I've got the following issue.

I have a table with data (in which i have char fields and decimal fields) and when i try to download this data to a local file, either using WS_DOWNLOAD or CL_GUI_FRONTEND_SERVICES=>DOWNLOAD, the generated file doesn't have the correct format (i've got strange characters instead of the decimal fields and i don't know why)

Should i use a different FM instead?

Thanks again.

Regards.

4 REPLIES 4
Read only

amit_khare
Active Contributor
0 Likes
503

First of all whats the extension of the file...

try with GUI_DOWNLOAD instead of WS_UPLOAD.

Regards,

Amit

Read only

Former Member
0 Likes
503

The downloaded file is a .txt file.

GUI_DOWNLOAD is not working either.

Edited by: Javier Suárez Zapico on Feb 13, 2008 10:20 AM

Read only

Former Member
0 Likes
503

Hi

I finally made it work, by storing the decimal fields in char fields an using any of these functions.

Read only

Former Member
0 Likes
503

Hello Javier Suárez Zapico ,

Instead of using the Wa_download Please use the Following function.

In the file name define your own format what you want to be.

call function 'GUI_DOWNLOAD'

exporting

  • BIN_FILESIZE =

filename = 'C:SAPTEST_DATA2.xls'

FILETYPE = 'ASC'

  • APPEND = 'A'

WRITE_FIELD_SEPARATOR = ','

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = 'X'

  • 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 = ITAB

  • 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.

Regards

Swati ....