Reputation: 4561
Referring to this question here a past user was able to develop some C# code to perform SAP GUI Automation. However when looking online at tutorials/developer documentation for this library I was unable to find anything.
There are a lot of objects like like, GuiSession
, GuiApplication
, GuiConnection
that I can't find information to online.
How would I go on to writing SAP GUI automation using C# without proper documentation?
Upvotes: 0
Views: 2651
Reputation: 844
The documentation is in your Program Files > SAP. Then, search for this file "SAPGUIScripting.chm". This is the best documentation I've seen. It documents all class objects with their methods, properties and events. It will occasionally provide some direction on how to use some of the methods.
You can also click on the "SAP GUI Scripting Help" as seen below.
As far as using C#, you would use the methods and properties just like you would for any other C# object.
Best of luck and happy scripting!
Upvotes: 0
Reputation: 43
There is very little documentation for SAP Scripting in general outside of the one resource posted in the linked question (http://www.synactive.com/download/sap%20gui%20scripting/sap%20gui%20scripting%20api.pdf).
However, I also found this resource (http://help.innowera.net/PR2008/2.00/SAP_Scripting_API.pdf) which is similar to the one above but I think has a bit more detail.
Further, there is a built-in help document within SAP that you can access from the "Customize Local Layout" Menu (click the Monitor Icon in the second-from-the-top toolbar or ALT+F12) and then selecting "SAP GUI Scripting Help"
All three of these resources are primarily for VB; however, the objects, methods and rules are nearly the exact same for C#.
That being said, I do not know of any API Documentation specific to C# at this time
How would I go on to writing SAP GUI automation using C# without proper documentation?
I suggest recording scripts in VB through SAP first so that you can at least get the IDs for each button, menu, and field you use for a particular report. Then you can copy the IDs from that script into your C#. Additionally, these VB scripts can help you determine which objects and methods to use in your C#.
You can access the script recording functionality through the same "Customize Local Layout" menu and selecting "Script Recording and Playback..."
This functionality records every mouse click and keyboard input inside of SAP in VB and stores the resulting script in %AppData%\SAP\SAP GUI\Scripts
As I find more resources for SAP Scripting with C#, I will post them here.
Upvotes: 1