07-01-2009 4:48 PM
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.
07-01-2009 5:05 PM
Moo...
Did you try to create a tab separated file ? that will work fine to open in excel
bye
Gabriel P
07-01-2009 5:05 PM
you can create a file with extension .CSV , with the dataset commands, it would open in EXCEL
07-01-2009 5:06 PM
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)
07-01-2009 5:13 PM
07-01-2009 5:17 PM
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.
07-02-2009 10:47 AM
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
07-02-2009 10:57 AM
hi ,
there is no confusion u can save the file in application server and form there you can open with EXL fromt .
cheers.
~linganna
07-02-2009 10:59 AM
I open the file with excel ... the field values appear steeds in first column. so this my problem
07-02-2009 11:16 AM
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.