sapgui_select_active_session

Connection and Session Functions

Activates a session.

int sapgui_select_active_session( const char *sessionID);
sessionID The number of the session

sapgui_select_active_session chooses the current working session from the collection of open sessions.

The sessionID of the first session is "ses[0]", the second is "ses[1]", etc. The first session is opened by the initial login sequence. Unless sapgui_create_new_session is called, or a new session is started from the menu, sessionID is generally "ses[0]".

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_session to activate the first active session on the connection.

// Open the 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 );