Share this page

# sapgui_open_connection

Example: sapgui_open_connection | Connection and Session Functions

Opens a connection to the specified SAP server.

    int sapgui_open_connection( const char *connection_name, const char *connection_id, [args,] LAST );

connection_name | A name for the connection, defined in the SAP client installation
connection_id | An output parameter that uniquely identifies the connection
args | Optional Arguments
LAST | A marker indicating the end of the argument list. Not required if Optional Arguments are used.

The sapgui_open_connection function opens a connection defined by connection_name. If connection_name is not found within the existing definition of the SAP client, then the function attempts to connect to a server of that name.

The function sets the output parameter connection_id. This parameter is used in sapgui_select_active_connection.

sapgui_open_connection should be followed by sapgui_logon.

## Return Values

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

Note: If a logon or connection in a script fails, the script replay is aborted. You can allow the script replay to continue despite a failed logon or connection by enabling the following setting in the runtime settings: SAPGUI > General > Advanced > Disable abort on logon/connection.

## Parameterization

You can parameterize all string (char type) arguments.

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