Skip to Content
author's profile photo
Former Member

FUNCTION MODULE FOR DOWNLOAD

Can u guys suggest me whch Function Module to be used to DOWNLOAD

data from an INTERNAL TABLE to an EXCEL file.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

8 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 01:24 PM

    Hi John,

    Use <b>GUI_DOWNLOAD.

    ex:

    • Download the File.

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    FILENAME = V_FILENAME " name of the file

    FILETYPE = 'ASC'

    WRITE_FIELD_SEPARATOR = '#' "tab seperator you can put ',' instead

    TABLES

    DATA_TAB = I_ERR_REC "internal table from which data is obtained

    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.

    Reward points if this helps,</b>

    Kiran

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 01:21 PM

    hi,

    U can use GUI_DOWNLOAD and u assign the file type as '.xls'.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 23, 2007 at 01:21 PM

    Hi,

    There is no direct function module to download to excel.

    But you can use fm GUI_DOWNLOAD

    or you can try with XXL_FULL_API

    aRs

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 01:22 PM

    use gui_download and give the file name with the ext .xls.

    reward if helpful.

    cheers

    sharadendu

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 01:27 PM

    Hello John

    With respect to <b>Unicode </b>we should no longer use the function modules for download/upload to/from the presentation server (= local PC) but instead use method <b>CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD</b> (and GUI_UPLOAD, respectively).

    Regards

    Uwe

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 01:31 PM

    where to give the file type as XLS ?

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi John,

      generally CSV i.e. comma separated value files are stored as .XLS file.

      so for the parameter <b>WRITE_FIELD_SEPARATOR</b> assign ',' you shall get your desired result.

      <b>Reward points if this helps,</b>

      Kiran

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 01:35 PM

    hi,

    U have to give it in the filename u r giving.

    CALL FUNCTION 'GUI_DOWNLOAD'

    EXPORTING

    filename = 'test.xls'

    tables

    data_tab =

    .

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 01:51 PM

    Hello,

    You can use

    <b>GUI_DOWNLOAD

    or

    SAP_CONVERT_TO_XLS_FORMAT</b>

    reward if helpful,

    Regards,

    LIJO

    Add comment
    10|10000 characters needed characters exceeded