Search the Community
Showing results for tags 'Integrate'.
-
Hello community, here is my script integration library ScriptX. With this library is it very easy possible to integrate AutoIt inside SAPs programming language ABAP. Here an ABAP example: "-Begin----------------------------------------------------------------- Program ZSCRIPTX. "-Constants--------------------------------------------------------- Constants CrLf(2) Type c Value %_CR_LF. Constants SW_SHOWNORMAL Type i Value 1. "-Variables--------------------------------------------------------- Data oScriptX Type OLE2_OBJECT. Data Buffer Type String Value ''. Data WorkDir Type String Value ''. Data FileName Type String Value ''. Data rc Type i Value 0. "-Macros------------------------------------------------------------ Define _. Concatenate Buffer &1 CrLf Into Buffer. End-Of-Definition. Define Flush. Call Function 'AC_SYSTEM_FLUSH' Exceptions Others = 1. End-Of-Definition. "-Main-------------------------------------------------------------- Create Object oScriptX 'ScriptX'. If sy-subrc <> 0 Or oScriptX-Handle = 0 Or oScriptX-Type <> 'OLE2'. Call Function 'ZSCRIPTXDLL'. Create Object oScriptX 'ScriptX'. EndIf. If sy-subrc = 0 And oScriptX-Handle > 0 And oScriptX-Type = 'OLE2'. Call Method Of oScriptX 'About'. Flush. Call Function 'ZAUTOIT3EXE'. "-AutoIt Script begin--------------------------------------------------- _ 'MsgBox(0, "AutoIt", "Version " & @AutoItVersion)'. "-AutoIt Script end----------------------------------------------------- Call Method cl_gui_frontend_services=>get_sapgui_workdir Changing SAPWORKDIR = WorkDir Exceptions Others = 1. Concatenate WorkDir '\Version.au3' Into FileName. Flush. Call Method Of oScriptX 'WriteFile' Exporting #1 = FileName #2 = Buffer. Flush. Call Method Of oScriptX 'Shell' = rc Exporting #1 = 'AutoIt3.exe' #2 = 'Version.au3' #3 = SW_SHOWNORMAL #4 = 1. Flush. Free Object oScriptX. EndIf. "-End------------------------------------------------------------------- Good integration. Cheers Stefan