2011 Aug 02 6:22 AM
hi.
i use this method to download a table to excel file.
1.when i download i get a file with 6000K and when i open it in notepad i get it tab delimeted.
2.when i opened it and make save as new_name.xls i get 2000K and when i opened it notepad i get it not tab delimeted.
i wnat it to be as the 2. option what i nedd to do.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = file_down
filetype = 'ASC' * i change it to bin too
write_field_separator = 'X' * i made remark
CHANGING
data_tab = IT_DATA
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
not_supported_by_gui = 22
error_no_gui = 23
OTHERS = 24.
2011 Aug 02 6:25 AM
Hi,
Try with File type as 'DAT' and field seperator as 'X.
BR,
Lokeswari.
2011 Aug 02 6:25 AM
Hi,
Try with File type as 'DAT' and field seperator as 'X.
BR,
Lokeswari.
2011 Aug 02 6:46 AM
2011 Aug 02 7:06 AM
Hi,
you need to create an excel file and not a csv file.
Maybe this helps you: http://abaplovers.blogspot.com/2008/05/abap-internal-table-to-excel-sheet.html
Best regards,
Oliver
2011 Aug 02 7:09 AM
2011 Aug 02 7:16 AM
If it was xls you wouldn't see tabbed data using notepad.
Excel is standard program to open csv (tabbed delimited) files. So you might think that it is excel, but it isn't.
What does your file look like in notepad after saving it again with Excel?
BR,
Oliver
2011 Aug 02 7:17 AM
this func help me.
but it open the excel file in the screen
how i can make it not open...
2011 Aug 02 7:19 AM
2011 Aug 02 7:21 AM
thank oliver.
here as i seen it in notepad
method gui_download
1.12222 22222 333333
in notepad savin in excel.
2. ׀ֿ א¡± ב > u200F " ְ u200F u200F ¡
when i use MS_EXCEL_OLE_STANDARD_DAT i get it good as " 2." but it open in the screen.
2011 Aug 02 7:57 AM
Hi,
and this is how you see that only the second is a real xls file.
For creating a file without showing you need to use the solution mentioned on the other link or maybe abap2xlsx: http://wiki.sdn.sap.com/wiki/display/ABAP/abap2xlsx
Best regards,
Oliver