Hi,
I am writing a generic scripting tool with has a VBS syntax highlighting editor and runs sapgui scripts.
https://sourceforge.net/projects/lbscript/
But I am missing some functionality I would like it to have
Once a sapgui scripting session is open i would lile to be able to launch a VBS that the scripting recorder can record and attach to this session not a normal sapgui session
A normal recordgin looks like this
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
[etc.]
my script works like this (has a VBscript-like syntax as well ' are comments)
logon("/H/server/S/3201","800","user","password","en")
'send an okcode
'can use also sendokcode() and the text can be either an okcode, menu entry, or sapgui keypresses (ex. "/0" is enter)
send("/$tab")
'pop up a message with the status, in that case all buffers reset should appear
getstatus()
'a huge file containing all objects and children for the active window
dumpscreen("C:\Datos\SAP\Sapgui_Scripting\Test\screen.txt")
' sample user creation
transaction("SU01")
setfield("USR02-BNAME","Text","LESTEBAN3")
OkCode("CREA")
SetField("ADDR3_DATA-NAME_LAST","TEXT","Last name")
SetField("ADDR3_DATA-NAME_FIRST","TEXT","Name")
SetField("SZA5_D0700-SMTP_ADDR","TEXT","lbesteban@gmail.com")
Okcode("LOGO")
SetField("G_PASSWORD1","TEXT","inicial")
SetField("G_PASSWORD2","TEXT","inicial")
Okcode("PROF")
SetField("USPROF-PROFILE","column","SAP_ALL|SAP_NEW|S_A.SYSTEM")
okcode("UPD")
'take a screenshot based on the extension, valid extensions are bmp,jpg,gif and png
screenshot("C:\lbdemo_screen.png","png")
'async shell, launch and keep running
'shell("notepad","C:\log.txt")
'syncronous shell, will wait for it finishes
'waitfor("cmd.exe")
'wait() or msgbox()
wait("Script is done ....")
loadscript("C:\simple_create_user.vbs") (but this does not work well)
but the loadscript part fails, it can not attach to my sapgui session if created manually.
Can anyone help me there ?
Is there any other source of documentation rahter than the chm file in the sapgui setup ?
Thanks.
Luis
Please also, feel free to use the tool as it can help a lot in repetitive tasks, be a base to create stress test meters, etc. etc.
And if you have suggestions or comments please drop me an email.