forked from isnoopytokky/AutoItRTE4ABAP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzTestAutoItRTE.abap
39 lines (28 loc) · 1.23 KB
/
zTestAutoItRTE.abap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
"-Begin-----------------------------------------------------------------
Program ZTESTAUTOITRTE.
Data:
lo_AutoIt Type Ref To ZCL_AUTOIT,
lv_WorkDir Type String,
lv_Str Type String
.
"-Main--------------------------------------------------------------
Create Object lo_AutoIt.
Try.
lo_AutoIt->ProvideRTE( i_DeleteExistRTE = ABAP_TRUE ).
"-Get path of SAP work directory----------------------------------
lv_WorkDir = lo_AutoIt->GETWORKDIR( ).
"-Read AutoIt code from include and store it as file--------------
lo_AutoIt->StoreInclAsFile( i_InclName = 'ZINPUTBOXAU3'
i_FileName = lv_WorkDir && '\InputBox.au3').
"-Execute AutoIt with InputBox.au3--------------------------------
lo_AutoIt->Execute( i_FileName = 'InputBox.au3'
i_WorkDir = lv_WorkDir ).
"-Get result from clipboard---------------------------------------
lv_Str = lo_AutoIt->GetClipBoard( ).
Write: / lv_Str.
lo_AutoIt->DeleteFile( i_filename = lv_WorkDir && '\InputBox.au3' ).
lo_AutoIt->DeleteExistingRTE( ).
Catch cx_Root.
Write: / 'An error occured'.
EndTry.
"-End-------------------------------------------------------------------