Example: sapgui_open_connection_ex

The following example uses sapgui_open_connection_ex to initialize the channel to the R/3 server.

Action() {
// Connect to R/3 server, and log on
sapgui_open_connection_ex (
    ConnectionString="/SAP_CODEPAGE=1100 /FULLMENU myServer 00 /3", 
     Description="MYSERVER", 
     ConnectionID="con[0]")
sapgui_select_active_connection("con[0]"); 
sapgui_select_active_session("ses[0]"); 
sapgui_select_active_window("wnd[0]");
// logging on as MyUserName
sapgui_logon("MyUserName", "MyPassword", "800", "EN", LAST );
lr_think_time(4);
// Now you can work
...
return 0;
}