SAP GUI Scripting, API from the Past for Future Automation
17 years ago presented SAP the SAP GUI Scripting API at TechEd. Since SAP GUI for Windows 6.20, from March 2002, is SAP GUI Scripting available. “SAP GUI Scripting can make life easier for users by automating repeating tasks.”, so the words in the presentation. It goes on with “SAP GUI Scripting for Users – Recording and Playback.” You can find the great presentation here.
Today we are talking about Robotic Process Automation (RPA). One of the slogans of RPA is “automating manual repetitive tasks”, the basic obvious idea behind any automation approach. Every RPA platform, I’ve got to know, uses, for the automation of the SAP GUI for Windows, the SAP GUI Scripting API. So it can only be a benefit to have a look behind the curtain of the SAP GUI Scripting API.
You can find a lot of valuable information about SAP GUI Scripting in the presentation. The wizard is an exception, these information are out of date.
The SAP GUI Scripting API is in the file sapfewse.ocx (FEWSE = Front End Windows Scripting Engine), in the directory C:\Program Files (x86)\SAP\FrontEnd\SapGui. It is a Component Object Model (COM) library and registered in the Windows registry. On this way you can use it from any COM-enabled programming language e.g. like Visual Basic Script (VBS), Visual Basic for Application (VBA) from Microsoft Office or AutoIt. A detailed description of the methods of properties of the SAP GUI Scripting classes is available in the subdirectory SAPguihelp\ScriptingAPI, open the file index.html.
On the same way RPA platforms uses SAP GUI Scripting for automating of SAP GUI for Windows. It is very good visible at the IDs and types. Here an example with SAP Intelligent RPA. The ID and the type are exactly the same as in SAP GUI Scripting API. The presentation shows us the SAP GUI Scripting Object Model, to identify objects with unique IDs.
All these information in general and the understanding of the composition of these IDs in particularly can help us in the context of RPA also.
Last but not least a few interesting parallels to the summary of the 17 years old presentation. Replace SAP GUI Scripting with RPA:
- RPA emulates user interaction.
- RPA can be used as simple macro recorder.
- RPA can also be used as powerful tool to build complex automation workflows.
Yes, SAP GUI Scripting, an API from the past for the automation of the future. Very well thought, very well done. A timeless stable API. It is worth take a closer look at.
Rightly said Stefan, the scripting API from the past is powering future automations!
Need your help in solving the following problem:
I have a couple of complex VBSCRIPTS that I wrote for automation some transactions ( After taking a lot of help from your blogs :). I am not a developer, but learnt VBSCRIPT as the need arose)
Can I package (embed) them as-is into a desktop/web application?
as far as I can say it should be possible to use VBScripts into desktop applications, e.g. via Process.Start method of the dotNET framework. As far as I know it is not possible to do the same with web applications inside a browser, it is not allowed for safety reasons.
I am searching for a dotNET resource who would make this possible for me.
Meanwhile I also tried automating SAP GUI transactions in python using the pywin32 extension, but that too is giving unexpected errors.
I hope to resolve this soon.
Apologies for the late reply.
Thanks & Regards
I can use SAP Scripting APIs in C++ ? If yes then how?
yes, you can use SAP GUI Scripting API in C++, it is a COM interface and it is possible to use it from a lot of programming languages which supports COM, inclusive C++. You can find examples how to use COM here and here.