Purpose Read data from an HTML viewer control Certain SAP transactions embed an HTML control into the SAP GUI screen to display data. In an InputScript you can read these data into GuiXT variables. We here describe two methods to read the data from the HTML control: Method 1 Use connectHTML Method 2 Use CallJS with suitable JavaScript functions Method 1 has the advantage that it does not require JavaScript programming, but it is somewhat limited and may not be powerful enough for complex HTML pages. Method 2 requires the GuiXT Controls component and is based on JavaScript and the "DOM" model of the HTML page. It has no limitations concerning the manipulation (reading, writing and event handling) of the HTML page. We explain both methods using the SAP standard test program "SAPHTML_EVENTS_DEMO" that you can start with transacrtion SE38: Method 1 connectHTML When developing the HTML access in your InputScript, start with a tiny InputScript ConnectHTML -showNames Return This adds a tooltip to all elements of the HTML page which are accessible via ConnectHTML: Use the name shown in the tooltip for an "HTML variable" HTML[...]:
ConnectHTML Return
ConnectHTML
CallJS
Result:
CallJS
|
Components |