Creating ITS Web Templates 

Use

To display BW contents in HTML pages, data from BW is embedded into stored HTML pages. These HTML pages are called Web templates.

You save the Web templates in the following places:

The Web templates are stored exclusively on the BW server. When you call the corresponding URL, the Web template is loaded, and analyzed line by line. If the BW system finds specific BW commands, it replaces them with normal HTML. These BW commands do not describe the data itself, rather they describe how the data are received.

With tables, the BW command for the table is only a few lines long, and contains all the necessary parameters. The result that is generated, however, might be several pages long.

The Web templates are stored as text files on the ITS. If you use a URL to choose an ITS Web template, a specific SAP component that analyzes the ITS Web template is started on the ITS.

You are able to

Prerequisites

In the BEx Analyzer, you have saved a query view that you are going to use as the basis for the ITS Web template.

Procedure

  1. Choose Tools ® Publish to Web from the BEx toolbar.
  1. Under Options ® Path and ITS Settings, check that the ITS server is selected as the Template location in the ITS Settings tabstrip. This ensures that the BW commands generated by the Web Publisher have the appropriate syntax.

See also:

Determining Path and ITS Settings

  1. Choose a view from the Views field.

Creating new items

  1. Choose New item..., highlight the item that you want to use, and click on the Choose button.
  2. Give the item a name, and choose OK.
  3. The attributes for the item you have chosen are displayed in the Properties of the current item field. You use the Change attribute... function, or double-click on the relevant attribute, to determine the attribute value.

See also:

Items and Attributes

The item is generated, and connected to the corresponding view. When the BW command that represents this item is generated, the name of the item and the view are transferred as parameters.

Creating ITS Web Templates

Choose your preferred HTML editor, and create an ITS Web template according to the following pattern:

<html>

<head>

<meta http-equiv="expires" content="0">
<title>BW Web Reporting Example</title>

`bwstylesheet="/sap/its/mimes/webrfc/bw/bwreports.css"`
<link rel="stylesheet" href="`bwstylesheet`" type="text/css">

<!-- load necessary include files -->

`include(~service="bwinclude", ~name="bwmain.html", ~theme="")`

</head>

<body onload="BWEndSession(bwstateless)">

`

if( STATELESS == "X" )

BWRenderStateless("1");

else

BWRenderStateless("0");

end;

`

<!-- here goes the tag from the web publisher -->

</body>

</html>

The HTML command link tells the Web Browser that receives the Web template, that there is a stylesheet file stored on the Web server, under the specified path. This file contains information on how particular items in BW Web reporting are displayed graphically. It is possible to replace this file with your own, company-specific displays.

The HTML command include tells the ITS that the Web template file bwmain.html needs to be loaded from the bwinclude service directory. All the BW-specific HTMLBusiness functions are declared here.

STATELESS parameter: If you call the URL, and the Web report is started, you have the option of transferring parameters, for example, STATELESS = "X". This calls the BWRenderStateless function.

Note that the include line has to be included within the body tag.

A simplified way of carrying out this step is to choose New file (New ITS Web Template) in the Web Publisher. Give the new ITS Web template a name, and choose OK: The Web template is opened in the HTML editor.

Copying Items into the ITS Web Template

You use the clipboard function (CTRL+C ® CTRL+V) to copy the item into the ITS Web template.

If you are using the simplified method, select the item in the Item field, and drag it in to the place marked with a symbol in the ITS Web template.

Result using the items navigation block, table, and chart as an example:

<html>

<head>

<meta http-equiv="expires" content="0">
<title>BW Web Report</title>

`bwstylesheet="/sap/its/mimes/webrfc/bw/bwreports.css"`
<link rel="stylesheet" href="`bwstylesheet`" type="text/css">

<!-- load necessary include files -->
`include(~service="bwinclude", ~name="bwmain.html", ~theme="")`

</head>

<body onload="BWEndSession(bwstateless)">

`

if( STATELESS == "X" )

BWRenderStateless("1");

else

BWRenderStateless("0");

end;

`

<!-- here goes the tag from the web publisher -->

`BWRenderItem(
dataproviderpara=

BWxPara("DATA_PROVIDER_WBID" ,"3EOEX567IAZWMAA1AY011EPZJ" ) &
BWxPara("DATA_PROVIDER","forxy") &
BWxPara("VIEWID","forxy"),

itempara= BWxPara("ITEMWBID","3EOEX567IAZWMAA1AY011EPZJ") &

BWxPara("ITEM","nav1") &
BWxPara("ITEMID","nav1")

)`

`BWRenderItem(
dataproviderpara=

BWxPara("DATA_PROVIDER_WBID" ,"3EOEX567IAZWMAA1AY011EPZJ" ) &
BWxPara("DATA_PROVIDER","forxy") &
BWxPara("VIEWID","forxy"),

itempara= BWxPara("ITEMWBID","3EOEX567IAZWMAA1AY011EPZJ") &

BWxPara("ITEM","tab1") &
BWxPara("ITEMID","tab1")

)`
`BWRenderChart(
dataproviderpara=

BWxPara("DATA_PROVIDER_WBID" ,"3EOEX567IAZWMAA1AY011EPZJ" ) &
BWxPara("DATA_PROVIDER","forxy") &
BWxPara("VIEWID","forxy"),

itempara= BWxPara("ITEMWBID","3EOEX567IAZWMAA1AY011EPZJ") &

BWxPara("ITEM","charthier") &
BWxPara("ITEMID","charthier") &
BWxPara("HEIGHT", "300") &
BWxPara("WIDTH", "900"),

rendererpara= BWxPara("WITHMAP","1") &

BWxPara("WITHCONTEXTMENU","0") &
BWxPara("FILTERSERIES","0")

)`

</body>

</html>

The HTMLBusiness function BWRenderChartS that is defined in the include-file bwmain.html, is carried out by the ITS during the analysis, and generates the corresponding HTML (in this instance, an interactive chart).

An SAP HTMLBusiness function is generated instead of the object tags recognized by the WebRFC.

It is possible to change the following parameters for interactive charts:

WITHMAP

0 or 1

0 ® Chart is not interactive

1 ® Chart is interactive

WITHCONTEXTMENU

0 or 1

0 ® There is an interactive context menu

1 ® There is no interactive context menu

FILTERSERIES

0 or 1

You use 0 or 1 to swap the series.

Example of switching between series

FILTERSERIES = 0

FILTERSERIES = 1

Saving ITS Web Templates

Save the completed ITS Web template in the HTML editor.

Check in ITS Web Template

Choose Check in (Check in ITS Web template) from the Web Publisher toolbar. Select the ITS Web template, and choose Open.

Publish to ITS

  1. Choose Publish to ITS from the Web Publisher toolbar.
  2. Choose the ITS Web template.
  3. Choose the corresponding ITS, or the Publish to all ITS in the list function.
  4. Choose Publish.

Display Web Report in the Browser

Choose Display Web template in Browser from the Web Publisher toolbar, and specify the name of the ITS Web template.

Result

The Web report (in this case, with the interactive chart) is started, and displayed in the Web Browser.