Application Development 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: 

Create excel file on application server

Former Member
0 Kudos

Hi experts,

Is it possiblel to create an excel file on the application server in a background process ?

We have an windows nt application server.

I tried with open dataset ..but i didn't work 100% good.

has anybody any sample ?

Thanks.

9 REPLIES 9

Former Member
0 Kudos

Moo...

Did you try to create a tab separated file ? that will work fine to open in excel

bye

Gabriel P

Former Member
0 Kudos

you can create a file with extension .CSV , with the dataset commands, it would open in EXCEL

Sandra_Rossi
Active Contributor
0 Kudos

this topic was discussed a lot, please search the forum (in short, most simple is to use CSV file instead of a native excel file (if it is just needed online later, you may render result only when user requests the data); if you really want an excel file, use either excel 2007 xml format (xslx), or connect an always-switched-on computer to the application server with excel installed and communicate with OLE, or use a third-party tool)

Former Member
0 Kudos

Use of tab delimited file

Former Member
0 Kudos

Hi,

While writing the data to application server using the TRANSFER statement, use the tab delimiter format.

While downloading the same directly lets say using CG3Y / CG3Z, choose the excel format.

If you are downloading programatically, need to select the file format as EXCEL.

It will work fine.

Regards,

Nangunoori.

Former Member
0 Kudos

I m using an csv file as tabdelimited .

data: htab(1) type c.

htab = cl_abap_char_utilities=>horizontal_tab.

the file is downloaded as excel , but if i open the file i see the content of a row always in the first column.

Types : begin of ty_test,

name1 type char10,

name2 type char10,

end of ty_test.

Data : it_test type table of ty_test,

wa_test type ty_test,

wa_row type string.

data: htab(1) type c.

htab = cl_abap_char_utilities=>horizontal_tab.

wa_test-name1 = 'name1'.

wa_test-name2 = 'name2'.

append wa_test to it_test.

clear wa_test.

open dataset <filename> for output in text mode

encoding default.

loop at it_test into wa_test.

conatenate wa_test-nam1 wa_test-name2 into wa_row separated by htab.

transfer wa_row to <filename>.

endloop.

close dataset.

Edited by: Moo Yac on Jul 2, 2009 11:48 AM

0 Kudos

hi ,

there is no confusion u can save the file in application server and form there you can open with EXL fromt .

cheers.

~linganna

Former Member
0 Kudos

I open the file with excel ... the field values appear steeds in first column. so this my problem

0 Kudos

You must name the file "something.CSV". Try with a comma instead of a tab. In some countries you may need to use a semi-colon in place of comma.

If you really want to use a tab, then the user has to open the file in excel, then select column A, click menu Data | Convert, choose "tab" separator, and run, then the cells will be splitted at "tab" into multiple cells, as you wish.