Application Development 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: 

Selecting worksheet from EXCEL

karuna_gangireddy
Contributor
0 Kudos

Hi All,

I am working with EXCEL with multiple worksheets. I am able to get the data that i need to the worksheets. But my issue now is the EXCEL will have multiple worksheets. I need to choose the worksheet by name. Lets say my EXCEL has 3 sheets.Sheet1/Sheet2 and Sheet3. When i execute for the first time i want to load my data to Sheet3. Next time may be in Sheet2.

What i am looking at is i want to check the worksheet name and if it matches my requirement then i will load into that sheet. If not i want to move to the next worksheet and check its name. Continue this till i check all the worksheet names. IDoes anyone has any idea how to go with it?

Thanks in advance,

Karuna.

Edited by: karuna Gangireddy on Sep 11, 2009 6:17 PM

1 ACCEPTED SOLUTION

former_member156446
Active Contributor
0 Kudos

Looks like Sourav also had the problem before, and he is kind enough to share his knowledge [>>>>click>>>>|http://wiki.sdn.sap.com/wiki/x/m4bUAw]

3 REPLIES 3

Sandra_Rossi
Active Contributor
0 Kudos

what do you use: OLE, xlsx, DOI, ...?

former_member156446
Active Contributor
0 Kudos

Looks like Sourav also had the problem before, and he is kind enough to share his knowledge [>>>>click>>>>|http://wiki.sdn.sap.com/wiki/x/m4bUAw]

Former Member
0 Kudos

Hi karuna,

Using the document instance get the Spreadsheet interface and call the below methods:

GET_SHEETS --- Which returns the existing sheets in an EXCEL.

SELECT_SHEET -


Which activates the required sheet in the EXCEL.

E.g;

CALL METHOD spreadsheet->get_sheets

IMPORTING sheets = sheets

error = error

retcode = retcode.

Here, spreadsheet is the instance of the Spreadsheet interface i_oi_spreadsheet.

The above instance of the interface can be obtained using the method get_spreadsheet_interface of doucment instance of type i_oi_document_proxy.

Regards,

Kiran Bobbala