Example: sapgui_logonConnection and Session Functions

Logs on to a SAP server.

int sapgui_logon( const char *user_name, const char *password, const char *client_num, const char *language, [args,] LAST );
user_nameThe name of the user in the session
password The password of the user in the session
client_num The identification number of the client
language The language of the SAP session
argsOptional Arguments
LAST A marker indicating the end of the argument list. Not required if Optional Arguments are used.

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.


You can parameterize all string (char type) arguments.