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: 

FM to download from internal table to excel

Former Member
0 Kudos

hi,

What is the function module to down load the data from internal table to excel.?

5 REPLIES 5

Former Member
0 Kudos

GUI_DOWNLOAD

take the parameter file type according to your req the various possible values are

File Type (ASC or BIN)

Description

During download, the data can be transmitted in different formats,

depending on the value of the FILETYPE parameter.

Value range

'ASC' :

ASCII format. The table is transferred as a text. Here, conversion exits

are executed. The output format also depends on the parameters CODEPAGE,

TRUNC_TRAILING_BLANKS, and TRUNC_TRAILING_BLANKS_EOL.

'IBM' :

ASCII format with IBM code page conversion (DOS). This format

corresponds to the 'ASC' format, with use of target code page 1103. This

code page is often used for data exchange by floppy disk.

'DAT' :

Transmission column by column. In this format, the data is transmitted

just like ASCals text. However, no conversion exists are executed, and

the columns are separated using tab characters. This format creates

files that can be imported again using gui_upload or ws_upload.

'DBF' :

The data is downloaded in dBase format. With this format, the data types

are stored as well, For this reason, import problems can be avoided -

for example, problems with Microsoft Excel. In particular, you can avoid

problems with the interpretation of numeric values.

'WK1' :

The data is downloaded in Lotus 1-2-3 format.

'BIN' :

Binary format. The data is transmitted in binary form. There is no

editing and no code page conversion. The data is interpreted line by

line and not column by column. The length of the data must be specified

in the BIN_FILESIZE parameter. The table should consist of a column of

type X, since - in Unicode systems - the conversion of structured data

to binary data can cause errors.

reward if helpful

former_member181995
Active Contributor
0 Kudos

Hi Vipin,

try with WS_EXCEL Fm.

Amit.

Former Member
0 Kudos

Hi

Do the following.

gt_display is the internal table u want to download.

DATA lv_filename LIKE rlgrap-filename.
  DATA lv_pathname LIKE rlgrap-filename.

  CLEAR: lv_filename, lv_pathname.

  CALL FUNCTION 'WS_ULDL_PATH'
       IMPORTING
            download_path = lv_pathname.

  CONCATENATE lv_pathname '*.XLS' INTO lv_filename.

  CALL FUNCTION 'DOWNLOAD'
       EXPORTING
            filename                = lv_filename
            filetype                = 'DAT'
            filemask_mask           = '*.XLS'
            filemask_text           = '*.XLS'
            filetype_no_change      = 'X'
            filetype_no_show        = 'X'
       IMPORTING
            act_filename            = lv_filename
       TABLES
            data_tab                = gt_display
       EXCEPTIONS
            invalid_filesize        = 1
            invalid_table_width     = 2
            invalid_type            = 3
            no_batch                = 4
            unknown_error           = 5
            gui_refuse_filetransfer = 6
            OTHERS                  = 7.

  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

Thanks,

Anon

Former Member
0 Kudos

You can use GUI_DOWNLOAD or XXL_FULL_API.

Please have a look at below links for more details.

http://searchsap.techtarget.com/tip/0,289483,sid21_gci956793,00.html

I hope it helps.

Thanks,

Vibha

Please mark all the useful answers

Former Member
0 Kudos

Hi,

You can use GUI_DOWNLOAD.

REWARD IF USEFUL