‎2007 May 07 5:44 AM
what is the function module for downloding a report into specified loaction into presentation system( give required import and export parameters also)
‎2007 May 07 5:46 AM
‎2007 May 07 5:46 AM
‎2007 May 07 5:47 AM
hi
Use <b>GUI_DOWNLOAD</b> FM
Here is the sample program for the same
* This method of file download with check uses the latest techniques
* and achieves a very neat solution
DATA: ld_filename TYPE string,
ld_path TYPE string,
ld_fullpath TYPE string,
ld_result TYPE i.
* Display save dialog window
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
* window_title = ' '
DEFAULT_EXTENSION = 'XLS'
default_file_name = 'accountsdata'
INITIAL_DIRECTORY = 'c:temp'
CHANGING
filename = ld_filename
path = ld_path
fullpath = ld_fullpath
user_action = ld_result.
* Check user did not cancel request
CHECK ld_result EQ '0'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = ld_fullpath
filetype = 'ASC'
* APPEND = 'X'
write_field_separator = 'X'
* CONFIRM_OVERWRITE = 'X'
TABLES
data_tab = it_datatab[] "need to declare and populate
EXCEPTIONS
file_open_error = 1
file_write_error = 2
OTHERS = 3.Message was edited by:
Santosh Kumar Patha
‎2007 May 07 5:51 AM
hi,
use function module GUI_download
EXPORTING
filename = 'z:\cerror.txt'
FILETYPE = 'ASC'
WRITE_FIELD_SEPARATOR = 'X'
IMPORTING
FILELENGTH = FILELENGTH
TABLES
data_tab = it_error
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.
‎2007 May 07 6:01 AM
hi..
You can use read report key word to read the report and save it in an internal table and use function module 'GUI_DOWNLOAD' as above and pass the internal table for function module to save in preasentation layer.
Syntax
READ REPORT prog INTO itab [MAXIMUM WIDTH INTO wid]
[STATE state].
i hope this will help you .
regards,
veeresh
‎2007 May 07 6:47 AM
hi
how to declare the internal table with the size of report program. can u give me the complete code
with regards
sureshbabu
‎2007 May 07 7:12 AM
hi..
Please check this program .It may help you resolve your problem
BKD_DOWNLOAD.
regards,
veeresh
‎2007 Jun 25 1:20 PM