Invoking Control Methods

Methods on SAP controls can be invoked using SapGuiInvokeMethod. The basic information about methods that are offered by controls can be viewed in the COM type library. OLEView32 is a tool that comes with Microsoft Visual Studio that can be used for this purpose.

To press a button, you can either use the high-level SapGuiPressButton method or you can invoke the pressButton method on the button control, like this:
SapGuiInvokeMethod("BUTTONCTRLID", "pressButton");

When a method call returns another SAPGUI object or SAPGUI collection, the returned object is stored internally and can be accessed with the constant value SAPGUI_ACTIVEOBJECT for any SAPGUI API call for the control ID parameter.