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

Internal Table to Excel

Former Member
0 Likes
2,691

Hello.

I need to save my internal table data to an excel file. Is there any useful function module to do this???

Thanks.

Hello.

I need to save my internal table data to an excel file. Is there any useful function module to do this???

Thanks.

9 REPLIES 9
Read only

Former Member
0 Likes
2,653

Hi,

create the output in ALV-Grid, change layout to excel and save the excel-sheet.

Regards, Dieter

Read only

0 Likes
2,653

I've used WS_EXCEL and it works fine.

Thanks anyway.

Read only

0 Likes
2,653

You shouldn't use WS_EXCEL.

I use: REUSE_ALV_GRID_DISPLAY

It is very easy to build an excel output with this FM.


    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
         EXPORTING
              i_callback_program = MYREPORT
              is_layout          = gd_layout
              it_fieldcat        = gd_fieldcat[]
              i_save             = 'X'
         TABLES
              t_outtab           = ITAB
         EXCEPTIONS
              program_error      = 1
              others             = 2.

Good luck.

SL

Read only

Former Member
0 Likes
2,653

Use the function GUI_DOWNLOAD

CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
      filename            = w_path
      filetype            = 'DAT'
    TABLES
      data_tab            = it_tab_exp
    EXCEPTIONS
      file_open_error     = 01
      file_write_error    = 02
      invalid_filesize    = 03
      invalid_table_width = 04
      invalid_type        = 05
      unknow_error        = 07.

Read only

0 Likes
2,634

what is gd_layout?
Does it gives straightforward excel output?

 

Read only

0 Likes
2,634

there is manual process, but could you provide a code to do it.

Read only

Former Member
0 Likes
2,653

The function module WS_EXCEL is obsolete.

Read only

Former Member
0 Likes
2,653
 Use the Function Module -   "ALSM_EXCEL_TO_INTERNAL_TABLE".

Regards

Ganesh Reddy.

Read only

2,653

The requirements was for Internal Table -> Excel.

Not Excel -> Internal Table.