I would like to automate an SAP GUI window using the C# language.

I would like to automate an SAP GUI window using the C# language. I am able to do it in VBScript but code reuse is horrible. Besides Id like to use threading instead of having 80 or more processes running. Where can I find any documentation and samples of how to do this? Here is the code I am working with. Basically, the problem I am facing is - how do I make a connection to SAP GUI then create an SAP GUI on the fly then start making transactions and entering text in some fields.

As you can see I can create a connection but I don't know how to create a session to the GUI and start entering text in fields. Any examples and samples would be appreciated.

Views: 336

Reply to This

Replies to This Discussion

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.

Does the following file exist on your SAP file installation? x:\Program Files\SAP\FrontEnd\SAPGui\sapfewse.ocx?

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.

You're right there is not a lot of documentation on this subject. Below are a few sources that helped me get started:

-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. http://www.synactive.com/download/sap%20gui%20scripting/sap%20gui%2...

Reply to Discussion

RSS

SAP News

Convista Harmonizes Workplace Culture with SAP SuccessFactors Employee Central and SAP S/4HANA Cloud Public Edition

To build a strong foundation for future growth, Convista aimed to have one digital platform flexible and powerful enough for the entire organization.

Expanded Partnership Turns Transactions into Lasting Connections

The expanded edition of SAP Preferred Success for SAP Sales Cloud and SAP Service Cloud can deliver a transformative approach to sales and customer service.

© 2024   Created by Maisam Agha.   Powered by

Badges  |  Report an Issue  |  Terms of Service