NewServerConnectionEx 

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

id

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

hostname

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.

router

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.

server

A server from a list of defined Servers in the system.

flags

Same as defined in OpenConnection or Connect.

Return Value

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

Comments

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