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

Function module to download data from internal table to excel sheet

Former Member
0 Likes
2,255

Hi all,

I have an internal table with data. I need to download these data to an excel sheet.

Please let me know the function module for this.

Thanks

Saravana

Hi all,

I have an internal table with data. I need to download these data to an excel sheet.

Please let me know the function module for this.

Thanks

Saravana

8 REPLIES 8
Read only

Former Member
0 Likes
1,092

Hi

Use the fun module

GUI_DOWNLOAD

or

EXCEL_OLE_STANDARD_GET

to transfer from Internal table to EXCEL

Reward points for useful Answers

Regards

Anji

Read only

varma_narayana
Active Contributor
0 Likes
1,092

Hi

to download data into an Excel file

You can use the GUI_DOWNLOAD fUNCTION MODULE

Specify the filename as YourFile.xls

Regards.

Read only

Former Member
0 Likes
1,092

hi,

use gui_download.

Read only

Former Member
0 Likes
1,092

Use "GUI Download".

Thanks and Regards,

Kunjal Patel

Read only

Former Member
0 Likes
1,092

Hi,

Use GUI_DOWNLOAD.

and

MS_EXCEL_OLE_STANDARD_DAT

Read only

varma_narayana
Active Contributor
0 Likes
1,092

Hi

to download data into an Excel file

You can use the GUI_DOWNLOAD fUNCTION MODULE

Specify the filename as YourFile.xls

You can also try with FM

EXCEL_OLE_STANDARD_DAT

Regards.

Read only

Former Member
0 Likes
1,092

hi

<b>CALL FUNCTION 'GUI_DOWNLOAD'</b>

EXPORTING

  • BIN_FILESIZE =

<b>filename = 'C:\REPORT.XLS'</b>

<b>FILETYPE = 'ASC'</b> " file type as ASCI

<b>APPEND = ' '</b>

<b>WRITE_FIELD_SEPARATOR = 'X'</b>

<b>HEADER = '00'</b>

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

  • IMPORTING

  • FILELENGTH =

tables

<b> data_tab = IT_PR</b> " internal table having 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

.

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

ravish

<b>reward points if useful</b>

Read only

Former Member
0 Likes
1,092

Hi,

try this function module.. to convert the sap data to Excell...

SAP_CONVERT_TO_CSV_FORMAT

SAP_CONVERT_TO_XLS_FORMAT

and to use this function module use the type pools TRUXS.

Hope this helps you..

- Kothai