I would like to automate an SAP GUI window using the C# language. - The SAPZilla Community Network2024-03-29T06:55:48Zhttps://www.sapzilla.com/forum/topics/i-would-like-to-automate-an-sap-gui-window-using-the-c-language?feed=yes&xn_auth=noThis might be necro-threadi…tag:www.sapzilla.com,2020-03-03:6606593:Comment:661062020-03-03T09:10:07.219ZMathew Sicahttps://www.sapzilla.com/profile/MathewSica
<div class="votecell post-layout--left"><div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200"><div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4" title="loading when this answer was accepted..."></div>
<div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4" title="loading when this answer was accepted..."></div>
</div>
</div>
<div class="votecell post-layout--left"><div class="js-voting-container grid fd-column ai-stretch gs4 fc-black-200"><div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4" title="loading when this answer was accepted..."></div>
<div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4" title="loading when this answer was accepted..."></div>
<div class="js-accepted-answer-indicator grid--cell fc-green-500 ta-center py4" title="loading when this answer was accepted...">This might be necro-threading but I was in a similar situation where I work. We needed SAP GUI Automation for testing purposes that could integrate with the rest of our homegrown automation platform written in C#. I helped create a proposal for one solution that took advantage of an SAP provided library for GUI automation that could be used as the basis for an automation layer for SAP.</div>
</div>
</div>
<div class="answercell post-layout--right"><div class="post-text"><p>Does the following file exist on your SAP file installation? x:\Program Files\SAP\FrontEnd\SAPGui\sapfewse.ocx?</p>
<p>If so, add it to Visual Studio (or whatever IDE you're using) as a reference. It is basically a class library that contains a bunch of SAP specific objects that will allow you to interact with. It is very effective because it exposes most of what you need from the SAP GUI. We discovered in other attempts that a lot of the objects in SAP were not available.</p>
<p><span>You're right there is not a lot of documentation on this subject. Below are a few sources that helped me get started:</span></p>
<p><span>-Documentation on the API (For VB and javascript but the general rules and objects are identical). Definitely read the portion on the SAP GUI Runtime hierarchy. It'll answer a lot of questions. <a href="http://www.synactive.com/download/sap%20gui%20scripting/sap%20gui%20scripting%20api.pdf" rel="noreferrer">http://www.synactive.com/download/sap%20gui%20scripting/sap%20gui%20scripting%20api.pdf</a></span></p>
<p></p>
</div>
</div>