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 regarding gui_download

Former Member
0 Likes
406

hi ,

i am append the data into one internal table (iresult) . and internal table contain data row by row . when data is downloaded into destop it is storing in text file continously. plz help me its urgent .points must be rewarded**

BEGIN OF iresult OCCURS 5,

rec(450),

END OF iresult,

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

filename = file

filetype = 'ASC'

mode = mode

TABLES

data_tab = iresult

EXCEPTIONS

file_open_error = 1

file_write_error = 2

invalid_filesize = 3

invalid_type = 4

no_batch = 5

unknown_error = 6

invalid_table_width = 7

gui_refuse_filetransfer = 8

customer_error = 9

OTHERS = 10.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
391

Hi Manoj,

To download a tab delimited file you need to fill in the following paramters for GUI_DOWNLOAD.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = file

FILETYPE = 'ASC'

WRITE_FIELD_SEPARATOR = 'X'

TABLES

DATA_TAB = iresult.

Revert back for further help.

Regards,

Naresh

2 REPLIES 2
Read only

Former Member
0 Likes
392

Hi Manoj,

To download a tab delimited file you need to fill in the following paramters for GUI_DOWNLOAD.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = file

FILETYPE = 'ASC'

WRITE_FIELD_SEPARATOR = 'X'

TABLES

DATA_TAB = iresult.

Revert back for further help.

Regards,

Naresh

Read only

former_member188594
Active Participant
0 Likes
391

Hi Manoj,

you can call the function module GUI_DOWNLOAD instead of WS_DOWNLOAD and pass the necessary parameters to it.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

  • BIN_FILESIZE =

FILENAME =

  • FILETYPE = 'ASC'

  • APPEND = ' '

  • WRITE_FIELD_SEPARATOR = ' '

  • HEADER = '00'

  • TRUNC_TRAILING_BLANKS = ' '

  • WRITE_LF = 'X'

  • COL_SELECT = ' '

  • COL_SELECT_MASK = ' '

  • DAT_MODE = ' '

  • CONFIRM_OVERWRITE = ' '

  • NO_AUTH_CHECK = ' '

  • CODEPAGE = ' '

  • IGNORE_CERR = ABAP_TRUE

  • REPLACEMENT = '#'

  • WRITE_BOM = ' '

  • TRUNC_TRAILING_BLANKS_EOL = 'X'

  • WK1_N_FORMAT = ' '

  • WK1_N_SIZE = ' '

  • WK1_T_FORMAT = ' '

  • WK1_T_SIZE = ' '

  • WRITE_LF_AFTER_LAST_LINE = ABAP_TRUE

  • IMPORTING

  • FILELENGTH =

TABLES

DATA_TAB =

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

Check if this is working fine for you. Reward points if useful.