Skip to Content
0

Why I do not manage to run @Stefan Schnell scrip without error?

Nov 14, 2016 at 07:16 PM

54

avatar image
Former Member

This is the script:

'-Begin-----------------------------------------------------------------

'-Directives----------------------------------------------------------

Option Explicit

'-Variables-----------------------------------------------------------

Dim WSHShell, SAPGUIPath, SID, InstanceNo, WinTitle

'-Main----------------------------------------------------------------

Set WSHShell = WScript.CreateObject("WScript.Shell")

If IsObject(WSHShell) Then

'-Set the path to the SAP GUI directory---------------------------

SAPGUIPath = "C:\Program Files (x86)\SAP\FrontEnd\SAPgui\"

'-Set the SAP system ID-------------------------------------------

SID = "NSP"

'-Set the instance number of the SAP system-----------------------

InstanceNo = "00"

'-Starts the SAP GUI----------------------------------------------

WSHShell.Exec SAPGUIPath & "sapgui.exe " & SID & " " & _

InstanceNo

'-Set the title of the SAP GUI window here------------------------

WinTitle = "SAP"

While Not WSHShell.AppActivate(WinTitle)

WScript.Sleep 250

Wend

Set WSHShell = Nothing

End If

MsgBox "Here now your script..."

'-End-------------------------------------------------------------------

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

avatar image
Former Member Nov 14, 2016 at 07:25 PM
0

I am attaching two screenshots: the error window as well as the SAP Logon Window. The SID I have to use is CS1. Hope you can help me.

@Stefan Schnell is the author of the script I want to use.


Share
10 |10000 characters needed characters left characters exceeded