De plus si vous pouviez réaliser un petit test:
Sub SapConn()
Dim Appl As Object
Dim Connection As Object
Dim session As Object
Dim WshShell As Object
Dim SapGui As Object
Shell "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe"
Set WshShell = CreateObject("WScript.Shell")
Do Until WshShell.AppActivate("SAP Logon ")
Application.Wait Now + TimeValue("0:00:01")
Loop
Set WshShell = Nothing
Set SapGui = GetObject("SAPGUI")
Set Appl = SapGui.GetScriptingEngine
Set Connection = Appl.Openconnection("PLP", True)
Set session = Connection.Children(0)
F[Mandant] = "200"
F[Utilisateur] = "Test"
End if
Lancer ce première code et si vous pouviez me donner le résultat
Puis essayer avec celui ci
Sub SapConn()
Dim Appl As Object
Dim Connection As Object
Dim session As Object
Dim WshShell As Object
Dim SapGui As Object
Shell "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\saplogon.exe"
Set WshShell = CreateObject("WScript.Shell")
Do Until WshShell.AppActivate("SAP Logon ")
Application.Wait Now + TimeValue("0:00:01")
Loop
Set WshShell = Nothing
Set SapGui = GetObject("SAPGUI")
Set Appl = SapGui.GetScriptingEngine
Set Connection = Appl.Openconnection("PLP", True)
Set session = Connection.Children(0)
session.findById("wnd[0]/usr/txtRSYST-MANDT").Text = "200"
session.findById("wnd[0]/usr/txtRSYST-BNAME").Text = "Identifiant"
End sub