I am trying to use ole to read excel spreadsheet into my abap program. I have downloaded a sample program which...
By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.
keeps crashing on me. I do not know how to resolve the issue because I do not understand the ole concept.
Can you give me a brief explanation of how this works and a sample working code if possible?
OLE is notoriously difficult to use. You need to determine the VBA commands on the Excel side, to achieve what you want to do. Once you have determined these, you can then write the ABAP to do it, using the CREATE OBJECT, CALL METHOD and SET/GET PROPERTY OF etc. keywords. The sample code provided by SAP, RSOLETT1, is very good - and it does work, provided you have your enviroment correctly set up - you might need to speak to your basis team about this.
One of the easiest ways to use OLE, is to write a VBA macro in Excel for your task, and call that from SAP.
A simpler solution might be to save your spreadsheet as a tab delimited flat file. Then you can use WS_UPLOAD function module, or READ DATASET to read the values into your program.
Related Q&A from Matthew Billingham
An SAP user is trying to run a report in an SAP ALV Grid online and wants to know how to get the data in the report to appear along with the header.continue reading
An SAP user needs information on how to change the password on several SAP user accounts from a central location.continue reading
An SAP user needs to transfer customer purchase order spreadsheet data to SAP VA01 to create a new sales order.continue reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.