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

hai all

Former Member
0 Likes
739

what is the function module for downloding a report into specified loaction into presentation system( give required import and export parameters also)

1 ACCEPTED SOLUTION
Read only

gopi_narendra
Active Contributor
0 Likes
716

you can use GUI_DOWNLOAD Function Module

Regards

Gopi

7 REPLIES 7
Read only

gopi_narendra
Active Contributor
0 Likes
717

you can use GUI_DOWNLOAD Function Module

Regards

Gopi

Read only

Former Member
0 Likes
716

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

Read only

Former Member
0 Likes
716

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.

Read only

former_member673464
Active Contributor
0 Likes
716

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

Read only

0 Likes
716

hi

how to declare the internal table with the size of report program. can u give me the complete code

with regards

sureshbabu

Read only

0 Likes
716

hi..

Please check this program .It may help you resolve your problem

BKD_DOWNLOAD.

regards,

veeresh

Read only

Former Member
0 Likes
716

answered