Reference Information: Definition and Initialization of Logical Documents 
Runtime Environment
To initialize communication between the HTML document and the R/3 System, the document must be registered at runtime. You can do so by including the following JavaScript in the header tag of the HTML document:
<SCRIPT LANGUAGE="JavaScript" SRC="SAPR3-WR-BFW_INC_TOP.JS"></SCRIPT>
The runtime environment automatically reserves the following JavaScript event handlers. You cannot use these events for your own functions.
Object |
Event |
window |
onload, onunload |
window.document |
onhelp, oncontextmenu, onkeypress, onclick |
Initializing the Logical Document
Each PI sheet and cockpit can consist of a hierarchical nesting of several HTML documents. In addition, a PI sheet can call up one or more cockpits, which in turn can use several other cockpits and thus HTML documents. At runtime, the R/3 System must know which of these HTML documents it is to use as main documents and with which logical document they correspond.
A logical document is identified by the following attributes in the META tag of the HTML document:
The document ID is identical to the PI sheet number or cockpit name. The generated XML document provides this document ID as the attribute of the DOCUMENT tag. In the HTML document, the document ID must be declared by a META tag that must be written before the JavaScript include SAPR3-WR-BFW_INC_TOP.JS.
You could include the following statement for a META tag in the DOCUMENT tag in the XSL style sheet, for example:
Example for an XSL definition
XML Document |
XSL Document |
HTML Document |
... |
... <SCRIPT LANGUAGE="JavaScript" SRC="SAPR3-WR-BFW_INC_TOP.JS"> </SCRIPT> |
... <SCRIPT LANGUAGE="JavaScript" SRC="SAPR3-WR-BFW_INC_TOP.JS"></SCRIPT> |
Explanation of the XSL definition:
HTML documents that do not declare a logical document are assigned to the higher-level logical document. For this, the system performs a bottom-up search of the browser's frame hierarchy. You can use this mechanism, for example, to link further HTML documents with iFrames that may contain hyperlinks to files in the R/3 System or buttons for menu functions (see Reference Information: Definition of Commands). The runtime environment can only access HTML documents that are loaded from the R/3 System.
At runtime, the document ID must be unique for all loaded documents. The runtime environment guarantees that this requirement is met. If an error occurs, the system creates a message in the log. If the same document ID comes up more than once, only the first instance is initialized.