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

Excel Formatting through ABAP

Former Member
0 Likes
2,392

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...

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...

5 REPLIES 5
Read only

former_member226225
Contributor
0 Likes
1,012

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

Read only

former_member491621
Contributor
0 Likes
1,012

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...

Hope this helps

Reward points if helpful

Read only

0 Likes
1,012

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.

Read only

marcosmata
Participant
0 Likes
1,012

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

Read only

Former Member
0 Likes
1,012

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 @ [email protected]

Best

Eric