Skip to Content
avatar image
Former Member

Connect to already active SAPgui instance C#

I've written a C# program to automate some processes.  Currently, the only way that the program can be run is if a user is not already logged into the SAP environment, or if they terminate any existing connections.

With C#, am I able to detect an already running instance of the gui and create a new session from the already existing connection?

Thanks,
Steve

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Oct 19, 2013 at 10:19 AM

    I dont know much about C# but this is possible in VB. You can use GuiApplication.Connections.Count to check for existing connections. If it is zero then create a new Connection. If it is only one, then GuiConnection = GuiApplication.Children(0).

    Add comment
    10|10000 characters needed characters exceeded