Using OLE

I am trying to use ole to read excel spreadsheet into my abap program. I have downloaded a sample program which 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?


    Requires Free Membership to View

    When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

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.


This was first published in July 2001

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.