09-11-2009 5:15 PM
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
09-14-2009 2:07 AM
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]
09-13-2009 9:30 PM
09-14-2009 2:07 AM
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]
09-14-2009 10:47 AM
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