Connecting to R/3 Application Server 
Use
To use any functionality of the R/3 application server, you must first acquire a connection handle.
Procedure
This establishes a connection to the R/3 application server, returns a connection handle, and starts single SAP session.
You can optionally specify that the standard SAPGUI is to be displayed. In this case, a SAPGUI and one Front are invoked.
See the
sample program SAMPLE.C for an example of using these functions.You can handle up to six sessions in every connection. See the details in the topic
Using Multiple Sessions.Result
The
It_NewConnection returns this connection handle. The It_NewConnection opens a network connection to the application server and based on the flags passed to it, it starts SapGui-FRONT.GUILib and SapGui-FRONT are connected via standard port number 3200, through which all information is passed back and forth.
A separate thread is created for each connection, in order to read data from the R/3 application server. When SapGui-FRONT is used, a separate thread is used to read SapGui-FRONT.