08-24-2005 12:15 PM
Dear guys,
I have table control displaying internal table records.
now i want option of exporting this records into excel sheet or i want to save these datas into excel document.
how to do this..
pls give suggestions..
ambichan
08-24-2005 12:22 PM
Hi,
This FM exports to excel.
call function 'SAP_CONVERT_TO_XLS_FORMAT'
exporting
I_FIELD_SEPERATOR = seper
I_LINE_HEADER = 'X'
I_FILENAME = P_FILE
tables
I_TAB_SAP_DATA = itab
exceptions
CONVERSION_FAILED = 1.
Svetlin
08-24-2005 12:21 PM
Hi ,
Have a Push button on the screen, use GUI_DOWNLOAD fm.
Pass Internal table values to the FM.
See Documentation of th FM for examples.
Rgds.
08-24-2005 12:22 PM
Hi,
This FM exports to excel.
call function 'SAP_CONVERT_TO_XLS_FORMAT'
exporting
I_FIELD_SEPERATOR = seper
I_LINE_HEADER = 'X'
I_FILENAME = P_FILE
tables
I_TAB_SAP_DATA = itab
exceptions
CONVERSION_FAILED = 1.
Svetlin
08-24-2005 12:33 PM
hey svetlin
thanks for your reply.
why this FM 'SAP_CONVERT_TO_XLS_FORMAT' is not working with me?
it says some generate error?
i am working in enterprise..
ambichan
08-24-2005 12:39 PM
Hi,
I'm working on 4.6C and the FM works OK. This FM uses office intergration utilities ( especially interface i_oi_spreadsheet ). You can create your own export using this interface.
Demo program: SAPRDEMO_TABLES_IN_EXCEL
Svetlin
Message was edited by: Svetlin Rusev
08-24-2005 1:17 PM
It's recommended FM 'GUI_DOWNLOAD' to be used, instead 'WS_DOWNLOAD'.
Svetlin
08-24-2005 1:08 PM
Hi
Try to use WS_UPLOAD function module with IMPORT parameter FILETYPE = 'XLS' (default = 'ASC')
Regards
Ashish
08-24-2005 1:15 PM
Sorry Ambi
By mistake i wrote WS_UPLOAD instead of WS_DOWNLOAD
Cheers
Ashish
08-24-2005 1:17 PM
Hi,
Try this function module
DATA: BEGIN OF ole_server OCCURS 5.
INCLUDE STRUCTURE tole.
DATA: END OF ole_server.
ole_server-app = 'EXCEL.SHEET'.
APPEND ole_server.
CALL FUNCTION 'OLE_SERVER_CHECK'
IMPORTING
down_load_path = file
TABLES
ole_server_app = ole_server
EXCEPTIONS
unsupported_os = 1
unsupported_server = 2
no_ole_server_found = 3
OTHERS = 4.
if sy-subrc is initial.
CALL FUNCTION 'EXCEL_OLE_STANDARD_DAT'
EXPORTING
FILE_NAME = PATH_AND_FILE
TABLES
DATA_TAB = Tab_data
FIELDNAMES = fildnames.
endif.
I hope this will work.
Cheers,
Sasi