Reference Information: Definition and Initialization of Logical Documents To initialize communication between the HTML document and the SAP 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 |
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 SAP 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:
NAME="_bfw_document_“
CONTENT="value of the 'ID' attribute from the XML 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 |
... <DOCUMENT id="10000000000004711"> .... </DOCUMENT> ... |
... <META NAME=“_bfw_document_“> <xsl:attribute name=“CONTENT“> <xsl:value-of select=“/@id“/> </xsl:attribute></META> <SCRIPT LANGUAGE=“JavaScript“ SRC=“SAPR3-WR-BFW_INC_TOP.JS“></SCRIPT> |
... <META NAME=“_bfw_document_“ CONTENT=“100000000000004711“>. <SCRIPT LANGUAGE=“JavaScript“ SRC=“SAPR3-WR-BFW_INC_TOP.JS“></SCRIPT> |
Explanation of the XSL definition:
The
NAME="_bfw_document_"
attribute in the META tag specifies that the document with the document ID to be added is to be identified as the logical document.
The
<xsl:attribute name=“CONTENT“>
tag specifies that an attribute with the name "CONTENT" is to be added to the META tag in the HTML document.
The
<xsl:value-of select=“/@id“/>
tag determines that the value of the "id" attribute is to be selected from the XML document and word for word inserted as the value of the "CONTENT" attribute in the HTML document
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 ERP 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 SAP 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.