Entering content frame

This graphic is explained in the accompanying text XML Web Item: Data Provider Information Locate the document in its SAP Library structure

For clarity we are providing a short example of using the Web item Data Provider Information. In order to make good use of the XML Web item, you will need JavaScript or XSLT knowledge. In this example, the internal values of a data provider will be read and displayed in a message box using the Web item Data Provider - Information).

 

<HTML>

<!-- BW data source object tags -->

<object>

         <param name="OWNER" value="SAP_BW"/>

         <param name="CMD" value="SET_DATA_PROVIDER"/>

         <param name="NAME" value="DATAPROVIDER_1"/>

         DATA_PROVIDER:             DATAPROVIDER_1

</object>

 

<object>

         <param name="OWNER" value="SAP_BW"/>

         <param name="CMD" value="SET_PROPERTIES"/>

         <param name="TEMPLATE_ID" value="XML_EASY_EXAMPLE"/>

         TEMPLATE PROPERTIES

</object>

 

<HEAD>

<META NAME="GENERATOR" Content="Microsoft DHTML Editing Control">

<TITLE>BW Web Application</TITLE>

      <link href= "/sap/bw/Mime/BEx/StyleSheets/BWReports.css" type="text/css" rel="stylesheet"/>

<script type="text/javascript">

<!--

  function alert_internal_values() {

  startnode = document.getElementById('XMLQUERYVIEWDATA_1');

/* Parse DOM until item_node for cell_data is reached */

  item_node = startnode.firstChild.firstChild.nextSibling.nextSibling.nextSibling.firstChild.firstChild.firstChild;

  myalert = 'The internal values are: ';

  while (item_node!= null) {

/* The internal value is the second Child element of the item_node */

       myalert = myalert + ' ' + item_node.firstChild.nextSibling.firstChild.nodeValue;

       item_node = item_node.nextSibling;   /* nextr item_node */

  }

  alert(myalert);

}

-->

</script>

</HEAD>

<BODY>

<P><object>

         <param name="OWNER" value="SAP_BW"/>

         <param name="CMD" value="GET_ITEM"/>

         <param name="NAME" value="TABLE_1"/>

         <param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_GRID"/>

         <param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>

         ITEM:            TABLE_1

</object></P>

<P><object>

         <param name="OWNER" value="SAP_BW"/>

         <param name="CMD" value="GET_ITEM"/>

         <param name="NAME" value="XMLQUERYVIEWDATA_1"/>

         <param name="ITEM_CLASS" value="CL_RSR_WWW_ITEM_XML_QUERYVIEW"/>

         <param name="DATA_PROVIDER" value="DATAPROVIDER_1"/>

         <param name="GENERATE_LINKS" value=""/>

         <param name="GENERATE_CAPTION" value=""/>

         <param name="NAVIGATIONAL_STATE" value=""/>

         <param name="RESULT_SET" value="X"/>

         ITEM:            XMLQUERYVIEWDATA_1

</object></P>

<A href="javascript: alert_internal_values();">Click here to see the internal values of the table </a>

</BODY>

</HTML>

 

The generated XML is provided here to explain the JavaScript function alert_internal_values:

 

<xml id="XMLQUERYVIEWDATA_1">

<queryview status="DataAvailable">

<?xml version="1.0" encoding="iso-8859-1"?>

<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">

<asx:values...</asx:values></asx:abap>

<?xml version="1.0" encoding="iso-8859-1"?>

<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">

<asx:values>

<CELL_DATA>

<item><CELL_ORDINAL>000000</CELL_ORDINAL><VALUE>1931710.04800</VALUE><FORMATTED_VALUE>$ 1.931.710,05</FORMATTED_VALUE>...</item>

<item><CELL_ORDINAL>000001</CELL_ORDINAL><VALUE>153849431</VALUE><FORMATTED_VALUE>153.849.431 PC</FORMATTED_VALUE>...</item>

...

</CELL_DATA>

</asx:values>

</asx:abap>

</queryview>

</xml

 

With  startnode = document.getElementById('XMLQUERYVIEWDATA_1');

you get the start node <xml id="XMLQUERYVIEWDATA_1">.

The first lower level node of the start node is the tag <queryview>. The first lower level node of this node is the control statement <?xml >. The second lower level node of the <queryview> tag is <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">. Since only the cell data are of interest for this scenario, the fourth lower level node of the <queryview> tag is relevant. The first lower level node of this tag is <asx:values>. The lower level node of this node is then <CELL_DATA>. Within the <CELL_DATA>, there are individual <item> tags.

 

In order to get to the internal value (tag <VALUE>) within the <item> tags, the second lower level node has to be considered. The content of the <VALUE> tag is an (implicit) text node, thus it is a lower level node of the <VALUE> tag.

 

Leaving content frame