Show TOC

Object documentationSAP MII Report (IRPT) Locate this document in the navigation structure

 

An IRPT page, also referred to as an SAP MII report, is a web page that uses the SAP MII .irpt file extension rather than the standard .html file extension. IRPT pages facilitate the dynamic generation of web pages through server-side processing. The web server sends the .irpt page to a specialized servlet, ReportServlet, for processing.

The ReportServlet provides the ability to:

  • Pass session properties between pages

  • Capture parameters passed to a web page through a URL request

  • Embed placeholders in web pages for dynamic content insertion

  • Leverage XSL stylesheets to control output formatting

  • Create printable reports with or without embedded images

  • Localize pages for a particular user language

 

When a request is made in the browser for a web page that ends with the .irpt file extension, the page is routed to the ReportServlet, which goes through the HTML code, line-by-line, replaces the placeholders with dynamically created content, and then returns the page to the browser for viewing by the user.

By combining standard HTML with the SAP MII dynamic content, extensive control is provided over page layout, formatting, and inclusion of application-specific headers, logos, and other information. In addition, the XML/XSL capabilities of the SAP MII can be used to provide very fine-grained control over the appearance of dynamic data generated from an SAP MII query.

Structure

The following sections explain how to create reports as well as how to pass parameters to SAP MII reports for truly interactive and dynamic information:

Creating SAP MII Reports

You can create SAP MII reports virtually using any HTML or text editor.

Passing Parameters to a Report

There are two basic techniques for passing parameter values to a report:

  1. Using SAP MII session properties

  2. Using name/value pairs included in the URL used to load the report.

A special embedded value syntax is used to substitute the values of the SAP MII report system at execution time with the values provided using either of the above two techniques.

For additional information on queries and parameters, refer to the Query Template and Query Parameter sections.

Embedded Values

The syntax for embedding externally-provided values in a report is to use a placeholder name surrounded by curly brackets, as in {LotNumber} or {StartDate}. The syntax to provide a placeholder in Self Service Composition Environment for localization in an irpt page is [##Token]. When the report is executed, SAP MII first checks to see if a parameter has been passed as a session property, and then checks if a parameter has been passed in the URL. Values passed through the URL always take precedence over session properties. In the case where a placeholder is used but no value is provided, a default value of an empty string is used to replace the placeholder.

Note Note

Placeholders are replaced with the exact text of the passed-in value.

End of the note.

The following example demonstrates a simple batch report, with the parameters BatchNo, BatchStart, and BatchEnd being passed to the report. In this example, the passed-in batch number is used to control filtering of data, as well as the title of the dynamically-generated GIF chart.

Syntax Syntax

  1. <html>
    <head> 
    <title>Batch Detail Report</title>
    <meta http-equiv="Pragma" content="no-cache"> 
    </head>
    <body> 
    <H2>Batch Report</H2>
    <H3>HiPerf Plastics Corporation - Slattsburg Plant</H3>
    <p> 
    <SERVLET NAME="Illuminator"> 
    <PARAM NAME="QueryTemplate" VALUE="Demo/Process/BatchListQuery"> 
    <PARAM NAME="FilterExpr" VALUE="PlasticBottleBatchData.BatchID='{BatchNo}'"> 
    <PARAM NAME="Content-Type" VALUE="text/xml"> 
    <PARAM NAME="StyleSheet" VALUE="/XMII/CM/Sample/WEB/Stylesheets/IllumRowsetTable.xsl">
    </SERVLET> 
    </p> 
    <p> 
    <SERVLET NAME="ChartServlet"> 
    <PARAM NAME="QueryTemplate" VALUE="Demo/Process/BatchTrendQuery"> 
    <PARAM NAME="DisplayTemplate" VALUE="Demo/Process/BatchTrendChart"> 
    <PARAM NAME="FilterExpr" VALUE="PlasticBottleTrendData.BatchNo='{BatchNo}'"> 
    <PARAM NAME="StartDate" VALUE="{BatchStart}"> 
    <PARAM NAME="EndDate" VALUE="{BatchEnd}"> 
    <PARAM NAME="Width" VALUE="370"> 
    <PARAM NAME="Height" VALUE="280"> 
    <PARAM NAME="Title" VALUE="Profile For Batch {BatchNo}"> 
    <PARAM NAME="ShowChart" VALUE="1"> 
    <PARAM NAME="XAxisFontSize" VALUE="9"> 
    <PARAM NAME="YAxisFontSize" VALUE="10"> 
    <PARAM NAME="LegendFontSize" VALUE="10"> 
    <PARAM NAME="HTMLPage" VALUE="true"> 
    </SERVLET> 
    </p> 
    <p> 
    <SERVLET NAME="Illuminator"> 
    <PARAM NAME="QueryTemplate" VALUE="Demo/Process/BatchTrendQuery"> 
    <PARAM NAME="DisplayTemplate" VALUE="Demo/Process/BatchTrendChart"> 
    <PARAM NAME="FilterExpr" VALUE="PlasticBottleTrendData.BatchNo='{BatchNo}'"> 
    <PARAM NAME="Content-Type" VALUE="text/xml"> 
    <PARAM NAME="StyleSheet" VALUE="/XMII/CM/Sample/WEB/Stylesheets/IllumRowsetTable.xsl">
    </SERVLET> 
    </p> 
    </body> 
    </html>
    
End of the code.

Note Note

Placeholder can be used multiple times within the report.

End of the note.

The sample report above uses three separate <SERVLET> tags to include some general batch information, a chart of process conditions during the batch production, and a detailed list of key process parameters during batch execution. This sample above shows the use of XSL stylesheets to format output and how to suppress standard HTML tags when embedding output from an SAP MII query in a report.

Additional Report Ideas

Two of the advantages of SAP MII reporting capabilities are that Web page development time and time spent on maintaining Web pages is cut. The ability to use parameters for simple things like page titles means that the number of Web pages can be reduced and the process of expanding a Website becomes simple as changing a parameter value in an href call.

In the head section of the sample report above, a parameter could be used to make the title of the page dynamic as follows:

Syntax Syntax

  1. <title>Batch {BatchNo} Detail Report</title?
End of the code.

The sample page above includes static text for the company name as well as the specific plant location, but a single page could be used for multiple plant locations as follows:

Syntax Syntax

  1. <H3>XYZ Corporation - {PlantLocation} Plant</H3>
End of the code.
Passing Parameters through the URL Request

In the previous example, the parameter values can be passed directly through the URL used to generate the report. Parameters passed in a URL request can also be retrieved using placeholders, as long as the page requested uses the .irpt file extension.

For example, if Batch report was in a file called BatchReport.irpt then the URL will be as follows:

Syntax Syntax

  1. http://<servername>:<port>/XMII/CM/Reports/BatchReport.irpt?BatchNo=X123&BatchStart=9/15/2000 10:04:10&BatchEnd=9/15/200010:56:43
End of the code.

Note Note

The URL parameters must correspond exactly to the names of the embedded value placeholders. A question mark (?) follows the report file name, and an ampersand sign (&) separates each name/value pair.

End of the note.
Advanced Reporting Techniques

You can create various techniques for reporting in your application with a little bit of creativity and by harnessing the depth of functionality included in the SAP MII product.

Dynamic Format Control for Multiple Output Devices

Virtually any aspect of the report and the underlying queries that generate the report can be controlled dynamically. Thus, not only can data selection behavior be passed in dynamically, but formatting information, such as stylesheets, can be also be passed in as placeholders. This provides a powerful means for delivering device-specific formatting, allowing a single report to target any one of the following:

  • Printer

  • Web Browser

  • Microbrowser on a PDA

Creating Automatically Self-Updating or "Live" Reports

Since an SAP MII report is nothing more than a standard HTML page with a specific file extension and a set of special tags, you can create "living" reports using various techniques to cause the page to automatically refresh itself, such as the META refresh tag.

Leveraging XSL Stylesheets for Total Formatting Control

You can combine the new XSL formatting capabilities of SAP MII with the reporting subsystem for a complete control over the output of SAP MII data into virtually any desired appearance. To do so:

  1. Set the Content-Type parameter to text/xml through a <PARAM> tag inside the <SERVLET> tag.

  2. Provide the Stylesheet parameter through another <PARAM> tag

  3. Set the media-type parameter in the XSL stylesheet to text/html.

This will generate a stream of HTML output that can be included in the report.

Embedding an Image in a Report

The ChartServlet and SPCChartServlet enable server-side generation of iCharts and iSPCCharts as images, in either .png or .jpg format. This is important because:

  • Applets do not work on browser-capable small screen devices, since they do not have full support for Java. Thus, you can create an image of an iChart or SPCChart to show a chart image to users of these devices.

  • You may want to embed an image as part of a comprehensive report.

  • You may want to email a snapshot of an iChart or iSPCChart to a user or group of users.