Scripting Tracker is a utility and a replacement to the SAP ® GUI Scripting Development Tools. It is an SAP ® GUI analyser, scripting recorder for different programming languages, SAP ® GUI Scripting API viewer, code composer, screen comparator and dump state viewer on SAP ® GUI Scripting base. The program shows a clearly arranged tree with. Since the fields in the SAP GUI are named using a consistent naming convention, and API calls exist to iterate over all objects displayed in a screen, I could create a tool that performs all tasks above, but instead of coding each step in the process, create a data structure which captures the data needed to do an export - e.g. TCode, field.
Automate User Interaction with SAP GUI - and more
SAP GUI Scripting is an automation interface that enhances the capabilities of SAP GUI for Windows and Java. Using this interface, end users may automate repetitive tasks by recording and running macro-like scripts. Administrators and developers on the other hand may build tools for server-side application testing or client-side application integration.
SAP GUI Scripting provides a set of scriptable objects wrapping SAP GUI. The document describes the interface that was designed to resemble user interaction, which can then be emulated using a script.
Security Considerations
This guide deals with security aspects when using the SAP GUI Scripting API.
Presentation and Exercises
This presentation explains the benefits you have when using scripts in your daily work. Also, it describes the security settings and recommendations for SAP GUI Scripting. In addition, you will learn to access the Scripting Object Model to collect and modify data in SAP GUI and how to use the SAP sample applications that help you to get started with your own development. Also, you will get to know some prominent appplications built using the SAP GUI Scripting API.
In this exercise, you learn how to record and play back scripts using SAP GUI for Windows and SAP GUI for Java.
Availability
SAP GUI Scripting is available as of SAP GUI 6.20 for Windows and SAP GUI 6.20 for Java Revision 6. You find download information on the SAP GUI Family. SAP System versions beginning with 3.1I are supported. A complete list of all requirements is available in the security documentation above.
Important Notes
SAP Note 1441550 (SMP login required!)
Sap Scripting Tool
This note contains two archives with example applications for the use of SAP GUI Scripting. Please note that these applications are only demo programs, for which SAP does not provide support.
As Bill Gates once said: “I will always choose a lazy person to do a difficult job… because, he will find an easy way to do it” |
Scripting can be used to make repetitive time consuming tasks quick and easy. It takes some time and dedication to write a script but in the end your investment can really pay off. Your script can be faster and more accurate than you! So you have to ask yourself: Should I spend a few hours getting a script to work? If you’re only going to do something once then it’s probably not worth the time. However remember two things; when you do write a script for something, you have that script forever and you’re sharpening your scripting skills with every script you write. So go ahead – Think like a lazy person and you might end up more productive!
Starting Out
First you will need a primer on VBScripting – SAP GUI Scripting is written in Microsoft’s VBScript language. This Scripting language is easy to learn is able to handle most simple tasks. It has been included in Windows since Windows 98 so it’s fairly well documented. Microsoft’s VBScript User’s Guide can be found here: [http://msdn.microsoft.com/en-us/library/sx7b3k7y(v=vs.85).aspx]
For more complicated tasks I’ve wrote front ends in Visual Basic and then built and run a VBScript on the fly. Remember the sky is the limit with scripting so if you can imagine it, it can be done.
Of course you’ll also need to know about SAP Gui Scripting. In order for your VBscripts to access the SAP GUI and manipulate data you’ll need to use an API provided by SAP. You can find documentation for the SAP Gui API here: SAP Gui Scripting API [http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a034a16b-3bfe-2a10-e2bb-8bd880db0b3c]
Once you’ve gathered the proper documentation you can start to develop scripts!
Keep a few things in mind when you write your scripts-
Sap Scripting Tool Excel Tutorial
Make it reusable – Think about other possibilities for your scripts. Spending an extra 5 min writing in an extra feature can end up saving you an hour or two down the road when you might need it. Example – I once wrote a script to lock users. Two extra minutes of coding and it also could unlock them. These two minutes saved me an hour of work a few months later.
Do a good job with the comments – I routinely come back to scripts that I wrote one or two years ago. I can’t remember the specifics of what I was working on at the time so good comments help you understand what you were doing at the time. Some programmers say that good comments are more important than the actual code!
Scripting is dangerous! – Everyone makes mistakes. Automation gives you the ability to make mistakes. Many mistakes… very quickly. So be careful! Make sure to test your script on a sandbox before you decide to run it in Production. I cringe whenever someone asks me to run a script in production because it can be very dangerous. So for your own sake, Be Careful! Or at least make sure your Resume is up to date.
And finally – Start small – Do something simple before you take on something crazy, like scripting system refreshes. You must crawl before you can walk young grasshopper!
Setting up your Environment for SAP Gui Scripting
There are two things you’ll need to setup in order to run Gui Scripts. First you’ll need to configure your client, then the system that you are connecting to.
Step 1: Setup your Client
First, you’ll need to setup the SAP Gui Client to allow scripting on your local machine. I’ll be working with SAPGUI 7.30 on Windows.
In the options panel of your GUI, you’ll need to select “Accessibility & Scripting” and then “Scripting” in the left hand column. Then you are presented with three checkboxes.
To start, I would suggest selecting all three check boxes. Here is a description of what they do:
Enable Scripting – This box simply allows scripting on your GUI. (Has nothing to do with the server)
Notify when a script attaches to SAP GUI – Pops up a yes/no box when a script attempts to use the GUI. This is useful to have on because it give you a point to make sure you want to run what you are running. If you don’t have this on, the script will run without any confirmation.
Notify when a script opens a connection – This setting pops up a confirmation when your script connects to a system. I generally turn this off when I run a script that connects to the system multiple times to do what it does. Otherwise I leave this setting on.
Once you’ve checked “enable scripting” you’re ready to run scripts on the client side. Next, you’ll need to check your settings on the server side.
Step 2: Setup your SAP System
Microsoft office for mac 2011 service pack 3 (14.3.0). You can enable scripting by setting the profile parameter sapgui/user_scripting to TRUE. The value set using this procedure will be lost when the system is restarted. If the administrator edits the application server profile of the SAP System to include sapgui/user_scripting = TRUE, scripting will be enabled by default when the server is restarted.
REMEMBER: ENABLING SCRIPTING IN PRODUCTION SYSTEMS IS GENERALLY A BAD IDEA.
- Start transaction RZ11
- On the Maintain Profile Parameters screen, enter “sapgui/user_scripting.”
- Choose Display.
- In the Display Profile Parameter Attributes screen, choose Change value.
- Enter “TRUE” in the new value field.
- Click the Save Button.
Once you’ve done these two things – You’re ready to run scripts.
I’ll continue to add to this series on SAP GUI Scripting. Stay tuned!