Skip to Content

How to Logon on SAP with SSO via VBS?

Apr 26 at 06:15 PM


avatar image
Former Member

I'm triyng to write a VBScritp that opens a SAP session, with Single-Sign On capability.

I've already found some information about this topic, or similar ones, here and on other sites, but none of them suit my requirement..

This is what I have so far, taken from link:

But an error happens (please see attached file).error.png.

Can anybody help me?

Option Explicit     
Dim WSHShell, SAPGUIPath, SID, InstanceNo, WinTitle     
Set WSHShell = WScript.CreateObject("WScript.Shell")     
If IsObject(WSHShell) Then      
     SAPGUIPath = "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\"      
     SID = "PRD"      
     InstanceNo = "00"      
     WSHShell.Exec SAPGUIPath & "sapgui.exe " & SID & " " & _           
     WinTitle = "SAP"
     While Not WSHShell.AppActivate(WinTitle)           
        WScript.Sleep 250      
     Set WSHShell = Nothing 
End If
error.png (60.1 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers