
This section lists the functions that are specific to the SAP HTML Viewer.
The process described here is an extension of the general process for using controls that is specific to the SAP HTML Viewer. It does not contain all of the steps required to produce a valid instance of the control.
The program extracts are examples that do not necessarily illustrate all of the features of the control. For precise information, refer to the reference section of this documentation.
Creating the Instance
Create a reference variable for the SAP HTML Viewer.
DATA html_viewer TYPE REF TO cl_gui_html_viewer.
Create an instance of the SAP HTML Viewer:
CREATE OBJECT html_viewer
EXPORTING parent = container.
Register the Events
Register the required events of the SAP HTML Viewer. It supports the following events:
|
Event name |
Meaning |
|---|---|
|
SAPEVENT |
Click on a special HTML link that triggers an SAP event |
|
NAVIGATE_COMPLETE |
HTML page fully loaded |
Destroying the Control
The lifetime management is normally responsible for destroying any controls you use. However, the following two steps allow you to destroy the control yourself:
Destroy the SAP HTML Viewer at the frontend. If you no longer need the control container, release it as well:
CALL METHOD html_viewer->free.
Delete the reference variable to the SAP HTML Viewer and, if necessary, the reference to the control container as well:
FREE html_viewer.
The program SAPHTML_EVENTS_DEMO shows how you can use the SAP HTML Viewer.