Share this page

# sapgui_select_active_connection

Connection and Session Functions

Sets the specified connection as the active connection.

    int sapgui_select_active_connection( const char *connectionID);

connectionID | The connection name.

sapgui_select_active_connection specifies an open connection to a server as the working connection.

The connectionID is retrieved by sapgui_open_connection_ex and sapui_open_connection. The id of the first connection opened from the client is "con[0]", the second is "con[1]", etc.

## Return Values

This function returns LR_PASS (0) on success or LR_FAIL (1) on failure.

## Parameterization

You can parameterize all string (char type) arguments.

## Example

The following example uses sapgui_select_active_connection select the first connection.

Copy code

    // Open a connection to the server as the first active connection
    sapgui_open_connection_ex(
    " /SAP_CODEPAGE=1100 /FULLMENU MyServer 00 /3",
        "MyServer",
        "con[0]");
    // Activate the first connection
    sapgui_select_active_connection("con[0]");
    // Activate the first session
    sapgui_select_active_session("ses[0]");
    // Activate the first window (SAP Logon)
    sapgui_select_active_window("wnd[0]");
    // Log on
    sapgui_logon("MyUser",
        "MyPassword",
        "800",
        "EN", LAST );

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: