Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to read excel template from application server.

Former Member
0 Likes
1,700

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,061

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.

4 REPLIES 4
Read only

Former Member
0 Likes
1,062

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

Read only

0 Likes
1,061

Yeah, exactly all things that i need, thanks so much, Kiran.

Hung.

Read only

0 Likes
1,061

Hi,

would you please upload the code? I am little bit confused about it.

Thanks,

Sajjad

Read only

0 Likes
1,061

*--- 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.