02-21-2023 8:42 PM
Hey,
I'm using a report that calls a function module in order to read an Excel-file.
I do this in the SAP GUI and / or in Eclipse IDE
using the same Excel-file.
The function module behave similarly on the PC and Mac until this statement:
SET PROPERTY OF ls_excel 'Visible' = 0.
where ls_excel is defined as following:
DATA ls_excel type ole2_object.
After this statement the SY-SUBRC is 0 on the PC and 3 on the Mac.
Do you have any idea why this different behavior happens?
Just before the SET PROPERTY… line there is this statement
CREATE OBJECT ls_excel 'Excel.Application'.
Could it be that this line must be different on a Mac?
All the screenshots are in a ZIP-archive in Dropbox here:
https://www.dropbox.com/s/hwb8hcy5teiai59/Mac%20Anomalie.zip?dl=0
Thanks!
Regards,
Vlad
P.S. Here come a couple of relevant screenshots:
- PC
- Mac
05-04-2023 9:59 AM
Hey,
since the original posting I was trying in my spare time 😉 to use abap2xlsx for reading my Excel-file… and yesterday with the help of an example from codezentrale.de (it was not easy to find an example of using abap2xlsx for reading XLSX / CSV! 😞 ) I finally got it!
It's still a lot of work because
but at least I can (sometime 😉 read (at least parts of 😉 my XLSX-file - compared with the original error it's a huge step forward!
That's reason enough for me to close this ticket / thread and start tinkering with the abap2xlsx.
Thank you all for your input and especially c5e08e0478aa4727abc4482f5be390b2 & sandra.rossi for pointing me in the right direction 😉
Until next time,
Vlad
02-21-2023 9:03 PM
It looks to me like the issue is that OLE works differently between MacOS and Windows.
02-21-2023 9:36 PM
One could also use abap2xlsx to read the file and relegate OLE where it belongs 😉
To get started, you might want to follow the blogposts by bfeeb8ed7fa64a7d95efc21f74a8c135, starting from the january issue
02-22-2023 8:22 AM
You can embed the screenshots directly in your question. Dropbox needs people to sign in if I'm not wrong.
NB: I didn't even know that Mac would even support OLE.
Taken from note 1682628 - Solution Manager: Limitations with Apple OS X:
02-22-2023 11:35 AM
Thanks for all the comments so far.
matthew.billingham I didn't think of it - I've only checked the right and permissions of the SAP GUI's temp folders on the Mac. How can I read then an Excel-file into a report from a Mac?
c5e08e0478aa4727abc4482f5be390b2 abap2xlsx sounds good but - if I understand it correctly - it's only for output-ing XLSX. In my case I need to use a XLSX-file as an input.
sandra.rossi I didn't think about Dropbox requiring a sign in :-(. I embedded 4 of the screenshots in the question. Thanks for the note! But - similar to the question to Matthew Billingham - if so, how to read an XLSX-file into an ABAP-program on a Mac?
Thanks again!
02-22-2023 12:20 PM
Thanks. You're right, I was too quick, login is optional it's just that the below dialog is displayed the first time but is in fact optional. It's easy to work with Excel files using abap2xlsx, as Andrea explained. It's also for reading.
02-22-2023 12:34 PM
Sorry for missing the upload part of abap2xlsx - I'm starting to read (again! 😉 the description of abap2xlsx and all the blog-posts of Paul Hardy...
02-22-2023 12:53 PM
You have both the option of reading a file cell by cell, which allows you to make quick decisions based on the contents for example, and that of reading a whole tab into an internal table.
02-28-2023 11:28 AM
Here I am again, after reading something 🙂 about abap2xlsx (= blog posts + Paul Hardy chapter on abap2xlsx from "ABAP to the Future").
Unfortunately everything I found so far is about outputting XLSX... so I cloned locally the GitHub-repo.
At first I was surprised by the amount of classes 😉
Just in order to begin with the ones that are possibly relevant for me (remember: I want to ONLY READ an XLSX-file with more than one tab and work with the data from each tab) I filtered the *reader*.abap* from the folder src
Am I on the right path so far or is it completely the wrong approach?
Thanks!
05-04-2023 9:59 AM
Hey,
since the original posting I was trying in my spare time 😉 to use abap2xlsx for reading my Excel-file… and yesterday with the help of an example from codezentrale.de (it was not easy to find an example of using abap2xlsx for reading XLSX / CSV! 😞 ) I finally got it!
It's still a lot of work because
but at least I can (sometime 😉 read (at least parts of 😉 my XLSX-file - compared with the original error it's a huge step forward!
That's reason enough for me to close this ticket / thread and start tinkering with the abap2xlsx.
Thank you all for your input and especially c5e08e0478aa4727abc4482f5be390b2 & sandra.rossi for pointing me in the right direction 😉
Until next time,
Vlad
05-07-2023 12:48 PM
abap2xlsx has a separate repository of demo programs, including one to read XLSX file.
05-08-2023 4:52 PM
Thanks sandra.rossi, I'll give it a try - although I still have problems setting an online or offline repository of abap2xlsx on my systems. I'll report these issues in GitHub.
I was lucky to find an offline repository with the abap2xlsx from 2018 somewhere in our system (!) and this is what I used with the example from codezentrale.de and your snippet as well.
That's also why I couldn't get any of the demo programs - I couldn't find them anywhere in the system.