Share this page

# sapgui_select_active_window

General Object Functions

Sets the specified window as the active window.

    int sapgui_select_active_window( const char *window_id );

window_id | The identification number of the SAP window

During recording, a sapgui_select_active_window statement is automatically generated whenever you perform an operation on a control that belongs to a window different from the previous active window. All subsequent actions are performed on this window until the next sapgui_select_active_window statement is called.

## 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_window to select the first open window of the first session of the My Connection channel to the R/3 server.

Copy code

    // Connect to R/3 server, and log on
    sapgui_open_connection("My Connection", "con[0]");
    sapgui_select_active_session("ses[0]");
    // logging on as MyUserName
    sapgui_logon("MyUserName", "MyPassword",
        "800", "EN", LAST );
    sapgui_select_active_window("wnd[0]");

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: