The SAPGUI scripting interface offers the ability to access all controls on the current window. Each control has different properties that can be accessed with SapGuiGetProperty. As SAPGUI scripting is based on COM technology, there are many COM libraries that implement those COM objects. Those libraries also include type information for each control type.
To get a list of properties and methods of the different control types, you can view those libraries with a tool that allows COM type library inspection. OLEView32 is a tool that comes with Microsoft Visual Studio that can be used for this purpose.
This contains the basic controls (for example, text, button)
This contains extended controls such as trees and grids
SapGuiGetProperty("TXTCTRLID", "text", sTextValue);
SapGuiPressButton(SAP GUI_ACTIVEOBJECT);