Search the Community
Showing results for tags 'SAP GUI Scripting Recorder'.
-
Hello community, the SAP GUI for Windows offers an SAP GUI Scripting recorder to record manual activities. Press Alt+F12 to open the Local Layout menu and choose Script recording and playback item to open the recorder. The activities are stored in VBScript language, but it is very easy to use the recording results with AutoIt. It is only necessary to set a $ sign before the session variable and to set a stub in front of the recording results. Here an example for a login: ;-Begin----------------------------------------------------------------- ;-Variables----------------------------------------------------------- Dim $SAPROT, $SapGuiAuto, $application, $connection, $session $SAPROT = ObjCreate("SapROTWr.SAPROTWrapper") If Not IsObj($SAPROT) Then Exit EndIf $SapGuiAuto = $SAPROT.GetROTEntry("SAPGUI") If Not IsObj($SapGuiAuto) Then Exit EndIf $application = $SapGuiAuto.GetScriptingEngine() If Not IsObj($application) Then Exit EndIf $connection = $application.Children(0) If Not IsObj($connection) Then Exit EndIf $session = $connection.Children(0) If Not IsObj($session) Then Exit EndIf ;-SAP GUI Scripting from recorder starts here--------------------------- $session.findById("wnd[0]/usr/txtRSYST-MANDT").text = "099" $session.findById("wnd[0]/usr/txtRSYST-BNAME").text = "Hugo" $session.findById("wnd[0]/usr/pwdRSYST-BCODE").text = "Bambi" $session.findById("wnd[0]/usr/txtRSYST-LANGU").text = "DE" $session.findById("wnd[0]/tbar[0]/btn[0]").press() ;-End------------------------------------------------------------------- The $session.findById code is direct from the SAP GUI Scripting recorder. With a search and replace it is very easy to set a $ in front of session. You find the equivalent posting in the SAP Community Network here. Cheers Stefan