1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| 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
Set Session = Connection.Children(0)
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 = TextNG
Session.findById("wnd[0]/usr/pwdRSYST-BCODE").Text = TextPGI
Session.findById("wnd[0]/usr/txtRSYST-LANGU").Text = "FR"
Session.findById("wnd[0]/usr/txtRSYST-LANGU").SetFocus
Session.findById("wnd[0]/usr/txtRSYST-LANGU").caretPosition = 2
Session.findById("wnd[0]").sendVKey 0
' Ouvrir ZPGA18D
Session.findById("wnd[0]/tbar[0]/okcd").Text = "/nzpga18D"
Session.findById("wnd[0]/tbar[0]/btn[0]").press |
Partager