2013 Sep 06 7:44 AM
Hello experts!
I made an ABAP report that reads and writes data from Excel files, imported into SAP with T. OAOR. Each Excel file has cca twenty of the sheets. Everything works fine .... better to say almost everything, because the method select_sheet on certain sheets works well, on the others sheets does not work. The bad thing is that the return code of the method select_sheet says that went well, but the sheet you want is not selected. In this case the method get_active_sheet returns the previous sheet and not one that should be selected.
I am working with SAP ECC 6.0, SAP GUI 720, MS Excel 2007, the method returns the version 5 version.
Have any of you had a similar experience? I have the impression that it is the incompatibility between the versions.
Best regards,
Mio
2013 Sep 09 9:47 AM
Hey Mio,
See below thread of wiki, hope this will hep you for reading & writing in excel :-
Thanks
Romit Raina
Hello experts!
I made an ABAP report that reads and writes data from Excel files, imported into SAP with T. OAOR. Each Excel file has cca twenty of the sheets. Everything works fine .... better to say almost everything, because the method select_sheet on certain sheets works well, on the others sheets does not work. The bad thing is that the return code of the method select_sheet says that went well, but the sheet you want is not selected. In this case the method get_active_sheet returns the previous sheet and not one that should be selected.
I am working with SAP ECC 6.0, SAP GUI 720, MS Excel 2007, the method returns the version 5 version.
Have any of you had a similar experience? I have the impression that it is the incompatibility between the versions.
Best regards,
Mio
2013 Sep 06 2:18 PM
Hi Mio,
I ask you some additional information.
Are you using abap2xlsx.org? If so in which class is the method select_sheet?
KR,
Alessandra
2013 Sep 09 9:38 AM
Hi Alessandra,
Do not use abap2xlsx.org.
I am using the method select_sheet of SAP intrface I_OI_SPREADSHEET.
Ciao,
Mio
2013 Sep 09 9:47 AM
Hey Mio,
See below thread of wiki, hope this will hep you for reading & writing in excel :-
Thanks
Romit Raina
2013 Sep 09 11:46 AM
Thanks Romit.
This is a nice article, but I've already read.
Best regards,
Mio
2016 Jul 14 10:40 AM
hi Mio,
I am facing similar issue in my project now.
Can you tell ,how did u solved this.
Regards
Pallavi
2016 Jul 14 11:10 AM
2016 Jul 15 2:45 AM
Hi Sandra,
Thanks for your reply.
I have already referred the link.:)
I am trying to understand,
" If it reads all your worksheets, then you've got a bug in your program."
That means reading all sheets is a bug...??
My program actually reads all the sheets data as required.
But recently during testing we realized a issue, this happens only while closing the excel with Sheet10 as active ( i.e last working sheet is sheet10 just before saving the file ).
Then in the program during method call
Loop at it_sheets ( all the sheets say Sheet1 to Sheet 10)
first loop pass
call method i_oi_spreadsheet->SELECT_SHEET
exporting
name = sheet1. -->>>> This is not changing the active sheet to sheet1 from sheet10.
so sheet10 data is uploaded into internal table. Which is inconsistent.
second loop pass
call method i_oi_spreadsheet->SELECT_SHEET
exporting
name = sheet2. -->>>> This is changing the active sheet to sheet2 from sheet10.
in 10th loop pass
call method i_oi_spreadsheet->SELECT_SHEET
exporting
name = sheet10. -->>>> This is changing the active sheet to sheet9 from sheet10.
so the issue is in first loop pass method SELECT_SHEET is not able to change the active sheet10 to sheet1.
To all the surprise, if excel is saved with Sheet1 as active before uploading, then all is well.
Not sure what is missing in case of activating sheet1,If anyone of you faced similar issue, Kindly help suggest on this.
Regards
Pallavi
2016 Jul 15 11:30 AM
No, I mean: run the program provided in the link provided by Romit Raina. This program loops at all the sheets, and writes the contents. Does it loop correctly at all sheets of your workbook? it should work. If so, then you have a bug in your program!
2024 Sep 09 1:42 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |