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: 

Simple report - Downloading the file to desktop

Former Member
0 Kudos

Hi Everyone,

I need to download the output of a simple report to desktop.

Will be rewarded with points.

With Regards,

Seevangi Mishra

1 ACCEPTED SOLUTION

Former Member
0 Kudos

GO TO SE38 >GIVE REPORT NAME>DISPLAY

NOW

GO TO UTILITIES>MORE UTILITIES>DOWNLOAD

AND YOU KAN ALSO USE

GUI_DOWNLOAD FUNCTION MODULE

THANKS

8 REPLIES 8

former_member184657
Active Contributor
0 Kudos

this was a pgm that i did ages ago. its a little raw, but still serve the purpose.

REPORT ZPK_DOWNLOAD_COMMA_HEADER.

DATA: BEGIN OF WA_VBAK,

VBELN TYPE VBELN_VA,

ERDAT TYPE ERDAT,

ERZET TYPE ERZET,

ERNAM TYPE ERNAM,

END OF WA_VBAK,

IT_VBAK LIKE TABLE OF WA_VBAK.

DATA: BEGIN OF WA_FILE,

TEXT(200),

END OF WA_FILE,

IT_FILE LIKE TABLE OF WA_FILE.

DATA: V_ID(2) TYPE N.

START-OF-SELECTION.

SELECT VBELN ERDAT ERZET ERNAM INTO TABLE IT_VBAK FROM VBAK

UP TO 5 ROWS.

LOOP AT IT_VBAK INTO WA_VBAK.

V_ID = 10.

CONCATENATE V_ID

WA_VBAK-VBELN

WA_VBAK-ERDAT

WA_VBAK-ERZET

WA_VBAK-ERNAM

INTO WA_FILE SEPARATED BY '//'.

APPEND WA_FILE TO IT_FILE.

CLEAR WA_VBAK.

CLEAR WA_FILE.

ENDLOOP.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

filename = 'C:\PK_DOWNLOAD.TXT'

tables

data_tab = IT_FILE.

IF SY-SUBRC = 0.

MESSAGE S000(ZPKM).

ENDIF.

pk

former_member156446
Active Contributor
0 Kudos

In this [link|http://www.erpgenie.com/sapgenie/docs/Using%20ALV.pdf] check the 6th page

Former Member
0 Kudos

On the output screen...go to menu option

list->save/send->file

choose your desired format and save the file

valter_oliveira
Active Contributor
0 Kudos

Hello.

Use method gui_download of class cl_gui_frontend_services:


CLASS cl_gui_frontend_services DEFINITION LOAD.
CALL METHOD cl_gui_frontend_services=>gui_download
  EXPORTING
    filename                = 'C:\teste.jpg'
    filetype                = 'BIN'
  CHANGING
    data_tab                = data_tab
  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
    not_supported_by_gui    = 22
    error_no_gui            = 23
    OTHERS                  = 24.

Regards.

Valter Oliveira.

former_member181995
Active Contributor
0 Kudos

Use the path from when your output is diplayed..

from menu list>send/save>file>spreedsheet. here you can download your output to desktop.

other wise you can use gui_download FM in report.

please mark all good ans.

Amit.

Former Member
0 Kudos

If its simple list output report then at the menu go to list and go the download option.

Former Member
0 Kudos

GO TO SE38 >GIVE REPORT NAME>DISPLAY

NOW

GO TO UTILITIES>MORE UTILITIES>DOWNLOAD

AND YOU KAN ALSO USE

GUI_DOWNLOAD FUNCTION MODULE

THANKS

Former Member
0 Kudos

Hi,

you can use the FM GUI_DOWNLOAD.

CALL FUNCTION 'GUI_DOWNLOAD'

EXPORTING

FILENAME = fullpath

FILETYPE = 'ASC'

IMPORTING

FILELENGTH = length

TABLES

DATA_TAB = data_tab_asc

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.

Regards