Hello! I am creating a scritp to start SAP application via Windows Prompt, log into it and then start using a transaction. The steps are:
However, I am having trouble when doing step 2. Could someone help me please?
Below is my code. I am using the following command do run the .vbs file: C:\Users\*******\AppData\Roaming\SAP\SAP GUI\Scripts>cscript ScriptName.vbs
Dim WSHShell, SAPGUIPath, Name, SID, InstanceNo, objapp, WinTitle
Set WSHShell = WScript.CreateObject("WScript.Shell")
If IsObject(WSHShell) Then
SAPGUIPath = "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\"
Name = """SAP ECC - PRD"""
SID = "EP0"
InstanceNo = "00"
Set objapp = WSHShell.Exec SAPGUIPath & "saplgpad.exe " & Name & " " & InstanceNo
WinTitle = "SAP"
While Not WSHShell.AppActivate(WinTitle)
WScript.Sleep 250
Wend
Set WSHShell = Nothing
End If
session.findById("wnd[0]").maximize
On Error Resume Next
session.findById("wnd[0]/usr/txtRSYST-MANDT").Text = "100"
On Error Resume Next
session.findById("wnd[0]/usr/txtRSYST-BNAME").text = "*******"
On Error Resume Next
session.findById("wnd[0]/usr/pwdRSYST-BCODE").text = "*********"
On Error Resume Next
session.findById("wnd[0]/usr/txtRSYST-LANGU").Text = "PT"
On Error Resume Next
session.findById("wnd[0]").sendVKey 0<br>
Request clarification before answering.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.