on 2023 Jun 27 9:57 AM
Hi,
I'm currently searching how I could use a script to launch SAP and display the logon screen using a script.
I've written the code below for VBA, but after the last line, it connect directly because SSO is activated.
What I would like is to display the logon screen dispite SSO, to be able to change the connexion language or to log with another account than my main one as display in the capture below when you right click on the system you want to connect to and select Logon without Single Sign-On.
Thanks for your help.
Sub SAP_Connect()
Dim SapGuiAuto, SapApp, oShell
SAP_SYSTEM_NAME = "blahblahblah"
'Close all running SAP instance
oShell.Run "taskkill /f /im Saplogon.exe", , True
'Launch SAP Logon
CreateObject("wscript.shell").Run ("saplogon.exe")
Application.Wait Now + TimeValue("0:00:02")
Set SapGuiAuto = Nothing
Set SapApp = Nothing
Do While SapApp Is Nothing
On Error Resume Next
Set SapGuiAuto = GetObject("SAPGUI")
Set SapApp = SapGuiAuto.GetScriptingEngine
On Error GoTo 0
Loop
Application.Wait Now + TimeValue("0:00:02")
'Display logon screen
Set connection = SapApp.OpenConnection(SAP_SYSTEM_NAME, True)
End Sub
User | Count |
---|---|
69 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.