Performs a click on the specified SapGui button control.
SapGui.bdh
SapGuiPressButton( in sControlId : string allownull, in sTimer : string optional ) : boolean;
Parameter | Description |
---|---|
sControlId | The uniquely identifying id of a button control. |
sTimer | Timer name used for measurements. |
transaction TMain
var
sId : string;
begin
// Connecting to SAP
sId := SapGuiOpenConnection(" /SAP_CODEPAGE=1100 /FULLMENU lab77 00 /3");
SapGuiSetActiveConnection(sId);
SapGuiSetActiveSession("ses[0]");
// SAP
SapGuiSetActiveWindow("wnd[0]", "SAP", SAPGUI_MATCH_Exact);
SapGuiWindowResize(117, 28, false);
// Logon to SAP System
// Before running a test you have to customize the password parameter!
ThinkTime(5.3);
SapGuiLogon("bcuser", "*******", "000", "");
// Copyright
SapGuiSetActiveWindow("wnd[1]", "Copyright", SAPGUI_MATCH_Exact);
// Continue (Enter)
SapGuiPressButton("tbar[0]/btn[0]", "Continue (Enter)");
// SAP Easy Access
SapGuiSetActiveWindow("wnd[0]", "SAP Easy Access", SAPGUI_MATCH_Exact);
// Other menu
SapGuiPressButton("tbar[1]/btn[17]", " Other menu");
// Restrict Values
SapGuiSetActiveWindow("wnd[1]", "Restrict Values", SAPGUI_MATCH_Exact);
// Cancel (F12)
SapGuiPressButton("tbar[0]/btn[12]", "Cancel (F12)");
// SAP Easy Access
SapGuiSetActiveWindow("wnd[0]", "SAP Easy Access", SAPGUI_MATCH_Exact);
// Log off (Shift+F3)
SapGuiPressButton("tbar[0]/btn[15]", "Log off (Shift+F3)");
// Log Off
SapGuiSetActiveWindow("wnd[1]", "Log Off", SAPGUI_MATCH_Exact);
// Yes
SapGuiPressButton("usr/btnSPOP-OPTION1", "Yes");
end TMain;