Skip to Content
avatar image
Former Member

Excel Formatting through ABAP

Hi

i have a requirement regrading Excel formatting. i need to download data to excel with custom formatting , earlier i tried it with OLE programming, but it is taking so much time for download, can any one  suggest me a better solutions...

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • avatar image
    Former Member
    Jan 15, 2013 at 05:36 PM

    Hi Nagesh,

    You can use XML transformation to download data to excel.

    You can check the below links

    http://www.abap-tutorials.com/2009/11/18/abap-program-to-create-formatted-excel-using-xml/#more-1021

    http://scn.sap.com/people/naimesh.patel/blog/2009/02/10/abap-and-excel--create-formatted-excel-using-xml

    Hope this helps

    Reward points if helpful ūüėä

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Through XML also it is taking much time for even lesser records. The solution need to handle huge amount of data.....any alternate for that.

  • avatar image
    Former Member
    Jan 16, 2013 at 12:57 PM

    How much data are you exporting to Excel?

    One option might be to look at Global Software which offers an Excel add-in for SAP.  Essentially, eliminates the need to rekey/download info and reformat data in Excel while provide a live connection SAP.

    You can read more here http://www.glbsoft.com/sap/spreadsheetserver.aspx

    If your interested in testing this in your environment ping me directly or email me @ Eric.Smith@glbsoft.com

    Best

    Eric

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 15, 2013 at 01:41 PM

    Hi Nagesh,

    Try the following Code,

    CALL FUNCTION 'WS_DOWNLOAD'

    EXPORTING

    *   BIN_FILESIZE                  = ' '

    *   CODEPAGE                      = ' '

       FILENAME                      = 'C:\ BKPF.XLS'

       FILETYPE                      = 'DAT'

    *   MODE                          = ' '

    *   WK1_N_FORMAT                  = ' '

    *   WK1_N_SIZE                    = ' '

    *   WK1_T_FORMAT                  = ' '

    *   WK1_T_SIZE                    = ' '

    *   COL_SELECT                    = ' '

    *   COL_SELECTMASK                = ' '

    *   NO_AUTH_CHECK                 = ' '

    * IMPORTING

    *   FILELENGTH                    =

      TABLES

        data_tab                      = it_bkpf

    *   FIELDNAMES                    =

    * EXCEPTIONS

    *   FILE_OPEN_ERROR               = 1

    *   FILE_WRITE_ERROR              = 2

    *   INVALID_FILESIZE              = 3

    *   INVALID_TYPE                  = 4

    *   NO_BATCH                      = 5

    *   UNKNOWN_ERROR                 = 6

    *   INVALID_TABLE_WIDTH           = 7

    *   GUI_REFUSE_FILETRANSFER       = 8

    *   CUSTOMER_ERROR                = 9

    *   OTHERS                        = 10

    This will download the contents of the internal table into Excel with the Horizantal and Vertical line.

    Thanks,

    Raghunadh.K

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 15, 2013 at 07:45 PM

    Send the output through ALV Grid view and then export to excel!

    Add comment
    10|10000 characters needed characters exceeded