2009 Sep 14 10:27 AM
Hi experts,
I need to read excel template file from application server(with columns format such as number, currency ...), change some info then save to pc path. Requirement is read directly excel template into program.
Is there any way to do this one?
Thanks,
Hung.
2009 Sep 14 10:59 AM
Hi Hung,
Your requirement can be accomplished by using hte Desktop Office integration concept(DOI). Follow the below steps:
1. Upload the template to theBDS(Business document server).
2. Create a Document container control instance with reference to the interface I_OI_CONTAINER_CONTROL.
CALL METHOD c_oi_container_control_creator=>get_container_control
IMPORTING
control = gcl_control
error = gcl_error.
3.Create a Container instance with reference to the class CL_GUI_CUSTOM_CONTAINER.
4. Initialize the above created Control instance using the method INIT_CONTROL by passing the Container instance.
5. Create an instance for the document that would like to be opened with reference to the interface I_OI_DOCUMENT_PROXY using the method GET_DOCUMENT_PROXY of the interface I_OI_CONTAINER_CONTROL by passing the document typeu2019.
5.Create an instance for the document maintained in the BDS server with reference to the CL_BDS_DOCUMENT_SET and use the method GET_WITH_URL
7.Use the OPEN_DOCUMENT method of I_OI_DOCUMENT_PROXY to open the required document by passing the above obtained URL..
8. use the method get_spreadsheet_interface of the above document instance and get the interface(i_oi_spreadsheet). Now use the methods of the interface to modify the sheet.
Regards,
Kiran BObbala
Hi experts,
I need to read excel template file from application server(with columns format such as number, currency ...), change some info then save to pc path. Requirement is read directly excel template into program.
Is there any way to do this one?
Thanks,
Hung.
2009 Sep 14 10:59 AM
Hi Hung,
Your requirement can be accomplished by using hte Desktop Office integration concept(DOI). Follow the below steps:
1. Upload the template to theBDS(Business document server).
2. Create a Document container control instance with reference to the interface I_OI_CONTAINER_CONTROL.
CALL METHOD c_oi_container_control_creator=>get_container_control
IMPORTING
control = gcl_control
error = gcl_error.
3.Create a Container instance with reference to the class CL_GUI_CUSTOM_CONTAINER.
4. Initialize the above created Control instance using the method INIT_CONTROL by passing the Container instance.
5. Create an instance for the document that would like to be opened with reference to the interface I_OI_DOCUMENT_PROXY using the method GET_DOCUMENT_PROXY of the interface I_OI_CONTAINER_CONTROL by passing the document typeu2019.
5.Create an instance for the document maintained in the BDS server with reference to the CL_BDS_DOCUMENT_SET and use the method GET_WITH_URL
7.Use the OPEN_DOCUMENT method of I_OI_DOCUMENT_PROXY to open the required document by passing the above obtained URL..
8. use the method get_spreadsheet_interface of the above document instance and get the interface(i_oi_spreadsheet). Now use the methods of the interface to modify the sheet.
Regards,
Kiran BObbala
2009 Sep 15 10:36 AM
Yeah, exactly all things that i need, thanks so much, Kiran.
Hung.
2009 Oct 12 6:07 PM
Hi,
would you please upload the code? I am little bit confused about it.
Thanks,
Sajjad
2009 Oct 13 4:08 AM
*--- For read template in BDS
First, upload template to BDS using tcode OAOR
2nd read it:
Ref: [http://www.sapfans.com/forums/viewtopic.php?f=13&t=286360|http://www.sapfans.com/forums/viewtopic.php?f=13&t=286360] for more detail
*--- For DOI processing, u could ref SAP demo program: SAPRDEMO_SPREADSHEET_INTERFACE
Regards,
Hung.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |