Skip to Content
author's profile photo Former Member
Former Member

Reg : ABAP report downloading into xl-file

Dear friends,

In report i have a check box for excel download,

If the user selectes download into excel file option than I need to download

the particular report variables and internal tables details like invoice header and line item details in a particular row and column of the excel file.

Additionally If we can able to download already available excel template is more

helpful for me.

If anyone knows , please provide me the details.

Thaaks for advance reply.

Thanks and Regards

V.Raja sekaran

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 08:11 AM

    Hi

    There are several ways to download the data into excel files, probably the easy way is to use fm GUI_DOWNLOAD, anyway u can see the XXL program demo like XXLSTEST in order to use the fm XXL_SIMPLE_API.

    Max

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 23, 2008 at 08:16 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 23, 2008 at 08:26 AM

    Hi,

    Use FM GUI_DOWNLOAD for this.

    END-OF-SELECTION.

    IF download EQ 'X'. " Ur selection screen check box is selected.

    Call above FM.

    ENDIF.

    I hope u have all the data in one internal table.

    Check below simple sample code.

    TYPES:BEGIN OF t_tab,
            empno(10) TYPE c,
          END OF t_tab.
    
    DATA: i_tab TYPE TABLE OF t_tab,
          wa_tab TYPE t_tab.
    
    CLEAR wa_tab.
    wa_tab-empno = '0075694'.
    APPEND wa_tab TO i_tab.
    
    
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
    *   BIN_FILESIZE                  =
        filename                      = 'D:/test.xls'
    *   FILETYPE                      = 'ASC'
    *   APPEND                        = ' '
       WRITE_FIELD_SEPARATOR         = '#'
    *   HEADER                        = '00'
    *   TRUNC_TRAILING_BLANKS         = ' '
    *   WRITE_LF                      = 'X'
    *   COL_SELECT                    = ' '
    *   COL_SELECT_MASK               = ' '
    *   DAT_MODE                      = ' '
    * IMPORTING
    *   FILELENGTH                    =
      tables
        data_tab                      = i_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
       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.
    

    If u want to append the data to existing file then pass parameter APPEND = 'X'. It will append the content.

    Thanks,

    Vinod.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.