More than eight years ago I introduced the Scripting Tracker here. Unfortunately I lost my S-User, due to a change of employer, so I could not continue my original post. Scripting Tracker is always under development. And with the jump of the SAP GUI for Windows 8.00 to the 64-bit architecture also came the same change of the Scripting Tracker. The current major release 6 offers a 32-bit and a 64-bit version. Furthermore the recorder was ported to the dotNET Framework platform, it is now a dotNET application. In this blog I describe how the recorder can be decoupled and integrated as a separate application in other contexts.

The Decoupling

This is a very easy step. After the download of Scripting Trackers zip file, extract the following files into a directory of your choice:

  • Recorder.exe
    The dotNET recorder application
  • Recorder.exe.config
    An XML file which contains configuration details
  • Interop.SAPFEWSELib.dll
    A type definition converted with Microsoft Type Library Importer tool

This already completes all the preparatory steps.

The Execution of the Recoder

To run the recorder type recorder.exe and the following parameters in your console window:

Parameter Description
ConnID Connection number as integer, default 0.
SessID Session number as integer, default 0.
FileType Type of file as string, default PS1. Permitted values are: 

  • PS1 for PowerShell
  • CS for C#
  • VB for VisualBasic.Net
  • PY for Python
  • JAVA for Java
  • AU3 for AutoIt
  • VBS for VBScript
AddInfo Flag to add additional information as string,
default false or 0. Permitted values are true, 1, false or 0.
NWBC Flag to automate SAP Business Client as string,
default false or 0. Permitted values are true, 1, false or 0.

Now, according to the specified parameters, the recording of the activities in the SAP GUI for Windows is activated and the source code is displayed in the console window.

Examples

Console Window

Recorder.exe ConnID:1 SessID.1 FileType:CS AddInfo:true NWBC:false

This command executes the Recorder in a console window, to connect to SAP session 1 of
connection 1 and records the SAP GUI Scripting commands in C# style with additional information.

PowerShell Console

.Recoder.exe ConnID:0 SessID:0 FileType:PY

This command executes the Recorder in a PowerShell console window, to connect to SAP session
0 of connection 0 and records the SAP GUI Scripting commands in Python style.

PowerShell ISE

.Recorder.exe

This command executes the Recorder in a PowerShell ISE window, with the default parameter
values.

Hint: In a console window you can break the recording process with the esc key, but in PowerShell ISE you break it with Ctrl+Break.

Bash Console

./Recorder.exe ConnID:3 SessID:1 FileType:VB

This command executes the Recorder in a bash console window, to connect SAP session 1 of
connection 3 and records the SAP GUI Scripting command in VB.NET style.

Redirecting the Output

If you don’t want to copy the code from the console, with a redirect it is also possible to write the source code into a file.

./Recorder.exe FileType:Java > test.java

This command executes the Recorder in a bash console window, to connect SAP session 0 of
connection 0, records the SAP GUI Scripting commands in Java style and redirects the output to the
file test.java.

Refinish

Only the activities are recorded, the execution frame must be provided by yourself. The resulting source code is then to copied into it.

Conclusion

It was an important and right step to port the Scripting Tracker Recorder into a dotNET application. AnyCPU was chosen as the target platform, so this application can handle both 32-bit and 64-bit. This allows activities to be recorded in the SAP GUI for Windows 8.00, regardless of the architecture. In addition, the recorder can now be used in completely different integration scenarios, even outside of Scripting Tracker. It is lightweight and very easy to handle. This opens up new areas for interested developers in the context of SAP GUI Scripting, because a consolidated basis can be used here.

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x