Hi I am totally new to SAP. So please bear with me and my missing skills. I have tried to record a session to log into SAP. And open the first session i need.
It works good. But i normally work with more than one session. I tried to record this but it only create 2 new sessions. Below is my recorded script.
I need to open 2 more with the name fbl5n and udm_bp. My script below open the first session and then it just create 2 blank sessions.
Please try help with this. I have of course in below script removed my password.
Sincerely
Abjac
If Not IsObject(application) Then
Set SapGuiAuto = GetObject("SAPGUI")
Set application = SapGuiAuto.GetScriptingEngine
End If
If Not IsObject(connection) Then
Set connection = application.Children(0)
End If
If Not IsObject(session) Then
Set session = connection.Children(0)
End If
If IsObject(WScript) Then
WScript.ConnectObject session, "on"
WScript.ConnectObject application, "on"
End If
session.findById("wnd[0]").maximize
session.findById("wnd[0]/usr/txtRSYST-BNAME").text = "Y99DEW838"
session.findById("wnd[0]/usr/pwdRSYST-BCODE").text = "***********"
session.findById("wnd[0]/usr/pwdRSYST-BCODE").setFocus
session.findById("wnd[0]/usr/pwdRSYST-BCODE").caretPosition = 11
session.findById("wnd[0]").sendVKey 0
session.findById("wnd[0]/tbar[0]/okcd").text = "/n/hoag/akon "
session.findById("wnd[0]/tbar[0]/btn[0]").press
session.findById("wnd[0]/tbar[1]/btn[17]").press
session.findById("wnd[1]/usr/cntlALV_CONTAINER_1/shellcont/shell").selectedRows = "0"
session.findById("wnd[1]/usr/cntlALV_CONTAINER_1/shellcont/shell").doubleClickCurrentCell
session.findById("wnd[0]/tbar[1]/btn[8]").press
session.createSession
session.createSession