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: 

Downloading to excel

Former Member
0 Kudos
111

Hi,

How can we download data from an internal table into an excel file?

Which FM can we use and with what parameters?

1 ACCEPTED SOLUTION

Former Member
0 Kudos
59

Use GUI_DOWNLOAD function module...

7 REPLIES 7

Former Member
0 Kudos
60

Use GUI_DOWNLOAD function module...

Former Member
0 Kudos
59

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

bin_filesize = l_num

filename = l_fullpath

filetype = 'BIN' (or 'ASC')

TABLES

data_tab = it_content_bin

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.

Former Member
0 Kudos
59

Hi

Go through the link given below :

With Regards

Nikunj Shah

0 Kudos
59

Hello,

Please check with following code .. if it works .. pls close this issue

Example: Interface between Microsoft Excel and ABAP/4 with up- and *

downloading of data plus executing Microsoft Excel. *

TABLES: USR04.

DATA: SIZE TYPE I.

DATA: BEGIN OF USER OCCURS 100.

INCLUDE STRUCTURE USR04.

DATA: END OF USER.

Example: Select some data into an internal table.

SELECT * FROM USR04 INTO TABLE USER .

Example: Downloading data in Microsoft Excel Format with automatic

prompt popup dialog.

CALL FUNCTION 'DOWNLOAD'

EXPORTING

FILENAME = 'C:\tmp\SAPEXL1.XLS'

FILETYPE = 'WK1' "ASC, WK1, DBF, DAT, bin

MODE = ' ' "Mode ' ' = Rewrite Mode 'A' = Appending

TABLES

DATA_TAB = USER.

Example: Downloading data in Microsoft Excel Format without automatic*

prompt popup. *

CALL FUNCTION 'WS_DOWNLOAD'

EXPORTING

FILENAME = 'C:\tmp\SAPEXL2.XLS'

FILETYPE = 'WK1' "ASC, WK1, DBF, DAT, bin

MODE = ' ' "Mode ' ' = Rewrite Mode 'A' = Appending

TABLES

DATA_TAB = USER.

CLEAR USER. "Clear buffer

REFRESH USER. "Refresh, empty internal table

Edited by: AVReddy on Aug 13, 2008 2:50 PM

Former Member
0 Kudos
59

Most of them have taken time to answer to your query. Once you have found some solution from the replies, you have just closed the thread. You should have assigned some points before closing the thread as they have taken out time to answer your query...

0 Kudos
59

Ramesh,

You cannot earn points by coercion. Even this is against the rules of the forum. Its upto the OP to decide whether to award points or not. And if you feel dissatisfied by this, then you better not answer to the questions posted by the OP.

pk

Marked as Abuse.

Former Member
0 Kudos
59

I have not asking for points. I have written so that atleast they think that they are getting answers for the posts and for the better replies as a concern if any points are awarded, these inturn help SDN to donate money.