BOOL NewServerConnectionEx(LPCTSTR Id, LPCTSTR HostName, LPCTSTR Router, LPCTSTR Server, long Flags);


SAP System ID that identifies the SAP System. The list of SAP Systems is retrieved from the file SAPMSG.INI.


Hostname of the message server. This message server will provide a list of the currently available application servers that are running on the selected system. Each SAP System provides one Message Server. This information is stored in the file SAPMSG.INI.


Destination router used to connect to the message server as well as to the listed application servers. The list of available SAP routers is retrieved from the file SAPROUTE.INI.


The IP address of server to connect to.


Flags to control various aspects of the connection operation.

The same flags are used in all of the connection methods.

Each of the flags is based on a GUI Library connection flag.

Return Value

Returns the handle to an SAP Automation GUI session if successful, otherwise returns FALSE.


Allows you to connect to a specific R/3 application server.