Technical Articles
ABAP in Eclipse Automation with AutoIt Scripting Language
AutoIt is a phantastic scripting language and offers great possibilities to automate UI activities and general scripting. In the past I presented a lot of different examples with AutoIt. Another perspective in this “round dance” is the possibility to use AutoIt with ABAP in Eclipse to automate your recurring development activities.
To do that I create in my workspace directory a new directory with the name Scripts. After I did that I see in my project tree a new node with the same name.
In this directory I copied my AutoIt scripts. As example I use two scripts which uses only key commands. It closes all tabs and opens a new set of development objects.
;-Begin-----------------------------------------------------------------
;Activation of the Eclipse window
If WinActivate("<ABAP>") Then
;Waits until the Eclipse window is active
WinWaitActive("<ABAP>")
;Closes all editors
Send("{CTRLDOWN}{SHIFTDOWN}w{SHIFTUP}{CTRLUP}")
WinWaitActive("<ABAP>")
;Opens dialog to open an ABAP development object
Send("{CTRLDOWN}{SHIFTDOWN}a{SHIFTUP}{CTRLUP}")
;Waits until the dialog is active
WinWaitActive("Open ABAP Development Object")
;Fills the search string field and fire
Send("nsp_cl_bs_xl_4ui_dpc_ext{ENTER}")
;Waits until the Eclipse window is active
WinWaitActive("<ABAP>")
;Opens dialog to open an ABAP development object
Send("{CTRLDOWN}{SHIFTDOWN}a{SHIFTUP}{CTRLUP}")
;Waits until the dialog is active
WinWaitActive("Open ABAP Development Object")
;Fills the search string field and fire
Send("nsp_cl_gw_data_4ui{ENTER}")
EndIf
;-End-------------------------------------------------------------------
On this way it is very easy to restore a specific configuration of editors.
Also you can use now very easy the complete command set of AutoIt comfortable and you can execute your scripts direct from the Eclipse UI via an double click on the script.
For that all you have to do is to select the AutoIt interpreter in the Editor Selection, with the activated checkboxes – Use it for all au3-files.
Hi Stefan,
are you aware of this: https://blogs.sap.com/2015/02/27/use-mylyn-tasks-to-organize-your-abap-in-eclipse-workspace/
Using mylyn tasks and the associated context eclipse automatically stores which development objects you worked on for a specific task. Whenever you switch tasks the respective objects are opened.
Seems to be a similar functionality to what you scripted.
Christian
Hello Christian,
thank you very much for your reply. I don’t know this blog from Thomas and the possiblity that the task list view can store the open development objects and restore them with task activation.
You are right, my example do exactly the same.
The idea behind those kind of scripting is to autmate my developing activities inside and outside of Eclipse. E.g. is it possible to add scripts to send e-mails, to create documents, to check specfic process configurations on my local development system, to check system availability… Also is it possible to use any scripting language you want, AutoIt was only an example, you can also use Python, PowerShell …
Cheers
Stefan
Hello Stefan,
I used to use AutoIt to perform some repetitive tasks like creating domains, data elements and structures for SAP Notes, as well as the SSCR Object keys for those objects.
Christian,
Good reference. I wasn`t aware of mylyn, what it was made for, etc.
Regards,
JN