‎2008 Oct 23 1:49 PM
Hi everybody,
I have to read some data from an excel file in the ABAP code. This excel file is attached to a business partner (BP).
I can get the document from the BP using the method GET_DOCUMENT of the class CL_CRM_DOCUMENTS, but this gets me only the ascii data (or binary data, which is even worse).
I've read that OLE could be used, but I don't know how to pass the document to the excel instance. A possibility would be to download the file into the disk and pass that path+filename to the excel, but I don't think much of this solution.
Another idea i had is to get the URL of the document, and pass it on to the excel, but the URL I get looks like SAPR3://etc, also not use.
Does anyone have any ideas? Thank you in advance.
Regards,
Joaquin
‎2008 Oct 23 2:00 PM
why don't you save you're excel to a text file with tab delimited and use the function gui_upload to read the file ??
kind regards
arthur de smidt
‎2008 Oct 23 2:05 PM
Hi Arthur,
thanks for the quick answer.
I cannot do that because the customer is the one who attaches the excel file to the BP, therefore I can't save the excel into a different format.
Regards,
Joaquin
‎2008 Oct 23 2:08 PM
You could use the OLE to pass data into Excel using Cell, Range, Sheet objects specifically. Or just paste into each sheet from the windows clipboard.
This may help fill in some blanks with OLE and ABAP
‎2008 Oct 23 2:18 PM
Hi Kev,
thanks for the answer.
I already knew about this document, and I think that's the way to work with excel within the ABAP environment, but as I said in my post, I do not know how to pass the file to the excel instance.
The file is attached to the BP, so that means I cannot just open an excel instance and execute the method open, because I don't know which filename I should give. Maybe I could previously download the file, but this would be executed in the server-side, and I can't know which Operative System is being used, etc
Any other ideas?
Regards,
Joaquin