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: 

codepage: GUI_DOWNLOAD

Former Member
0 Kudos

Hi,

i use the function GUI_DOWNLOAD to download a .txt file. i use the codepage 4310 and the txt file encodes as UTF-8. now i want to encode the .txt file as unicode so that we can open it using EXCEL without broken characters.

Anyone can tell me which codepage can i use?

Thanks.

qiuguo

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

pass the following parameters only

U have to use DAT filetype

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

BIN_FILESIZE = NUMBYTES

FILENAME = FILEPATH

FILETYPE = 'DAT'

TABLES

DATA_TAB = PDFDATA

Narendra

8 REPLIES 8

Former Member
0 Kudos

Hi

pass the following parameters only

U have to use DAT filetype

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

BIN_FILESIZE = NUMBYTES

FILENAME = FILEPATH

FILETYPE = 'DAT'

TABLES

DATA_TAB = PDFDATA

Narendra

0 Kudos

Narendra,

thanks for your reply.

I try it as you said, but the .txt file was encoded as ANSI.

I need unicode.

thanks.

qiuguo

Former Member
0 Kudos

Hi qiuguo,

UTF-8 is used for Unicode...Do you need UTF-16 codepage ?

Regards,

Mohaiyuddin

0 Kudos

Hi,

Maybe i didn't describe the question clearly.

My problem is that i download a .txt file on local and open it. then i use the menu file - > save as, it would pop a window, on the bottom of which there will be the code type.

the code type list includes ANSI , UNICODE, UNICODE BIGENDIAN AND UTF-8. now i want the code type as UNICODE ,but use the codetype 4310 it would be UTF-8.

Pls help me.

qiuguo

Former Member

Hi,

the following is the code:

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

filename = F_INFILE

filetype = 'ASC'

  • APPEND = ' '

write_field_separator = 'X'

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

CODEPAGE = '4310' "4310

  • IMPORTING

  • FILELENGTH =

TABLES

data_tab = TAB_DATA

  • 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

.

hope your help. thanks.

qiuguo

Former Member
0 Kudos

codepage = '4013' will be OK

Former Member
0 Kudos

The code for the link below, cater for polish special characters..

Hope it helps:)

Fehmida

Former Member
0 Kudos

Hi

Maintain FILETYPE = 'DBF' for downloading in to EXCEL sheet.'