‎2009 Aug 12 10:57 AM
Hi,
I am programming generation of the Excel document from ABAP. I created additional popupscreen where the Excel should be shown with the generated spreedsheet and I have following questions:
- I used the example program SAPRDEMOEXCELINTEGRATION2 as a reference for my development. I created my own class and method to generate Excel spreedsheet, I use following objects/methods like in reference program:
c_oi_container_control_creator=>get_container_control
CREATE OBJECT container
EXPORTING container_name = 'CONTAINER'.
CALL METHOD lc_control->init_control
CALL METHOD lc_control->get_link_server
CALL METHOD link_server->start_link_serverTo retrieve the document form from repository:
CALL METHOD in_bds_document->get_info
CALL METHOD in_bds_document->get_with_urlAnd to generate the XLS:
CALL METHOD control->get_document_proxy
CALL METHOD proxy->open_document
CALL METHOD proxy->get_spreadsheet_interfaceIt works perfect, the Excel is shown in the popup dialog window. When the window is closed, following releasing methods are executed:
CALL METHOD proxy->is_destroyed
CALL METHOD proxy->close_document
CALL METHOD proxy->save_document_to_table
CALL METHOD proxy->release_document
CALL METHOD cl_gui_cfw=>dispatch.
IF NOT lc_bds_instance IS INITIAL.
FREE lc_bds_instance.
ENDIF.
IF NOT link_server IS INITIAL.
CALL METHOD link_server->stop_link_server.
FREE link_server.
ENDIF.
IF NOT lc_control IS INITIAL.
CALL METHOD lc_control->destroy_control.
FREE lc_control.
ENDIF.
LEAVE TO SCREEN 0.So it looks like all the objects are released after the Excel generation. The problem is that when the user immediately run the
program again, the Excel is not shown - just an empty popup dialog screen. Anybody has any idea what is wrong?
- Second question. This method requires to have Excel installed on the presentation frontend. So it can be used in normal dialog programming, but how to generate .XLS file in BSP? The code upper can't be used because SAP GUi is not available in this schema. Is the generating .HTML file with CONTENT-TYPE: .xls the only method to generate .XLS?
Thank you!
Edited by: Wojciech Walczak ITMAXI.COM on Aug 12, 2009 11:57 AM
‎2009 Aug 13 9:28 AM
/people/alvaro.tejadagalindo/blog/2009/02/05/excel-ole-and-abap--create-fancy-reports
‎2009 Aug 13 9:52 AM
Sorry - I asked direct questions. I don't need your links found in SDN as I studied all of them before asking that questions.
You loose our time writing such posts!