Start of Content Area

Process documentationUsing the SAP HTML Viewer  Locate the document in its SAP Library structure

This section lists the functions that are specific to the SAP HTML Viewer.

Prerequisites

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.

Process Flow

Note

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

  1. Create a reference variable for the SAP HTML Viewer.
  2. DATA html_viewer TYPE REF TO cl_gui_html_viewer.

  3. Create an instance of the SAP HTML Viewer:
  4. CREATE OBJECT html_viewer

    EXPORTING parent  = container.

    Register the Events

  5. Register the required events of the SAP HTML Viewer. It supports the following events:
  6. Event name

    Meaning

    SAPEVENT

    Click on a special HTML link that triggers an SAP event

    NAVIGATE_COMPLETE

    HTML page fully loaded

    Using the SAP HTML Viewer

    Load HTML pages or parts of HTML pages.

  7. Display the loaded objects.
  8. Navigate forwards and backwards in the stack of your HTML browser from the application program, or return to the homepage.
  9. Update the HTML page from your application program.
  10. Find out the address of the current page.
  11. 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:

  12. Destroy the SAP HTML Viewer at the frontend. If you no longer need the control container, release it as well:
  13. CALL METHOD html_viewer->free.

  14. Delete the reference variable to the SAP HTML Viewer and, if necessary, the reference to the control container as well:

FREE html_viewer.

Example

The program SAPHTML_EVENTS_DEMO shows how you can use the SAP HTML Viewer.