Creating an HTML Template: Special Information 

Use

You can add special elements to an HTML template, so that further information can be displayed dynamically when the report is executed.

Prerequisites

You have an external HTML-editing tool and/or sufficient knowledge of HTML programming to create and format HTML files without an HTML editing tool.

Procedure

  1. Call up the source code of the HTML file with an editing tool.
  2. Add comment tags at the required positions in the HTML file. When you execute the report, the system will interpret these tags as variables and will replace them with corresponding values. In HTML files, comment tags must always be positioned at the very beginning of the line, before any other tags. This will ensure that they are recognized when the report is executed. The system can interpret the following comments:
  3. Valid comment types:

    Comment

    Meaning

    <!%001>

    Report header

    <!%002>

    Text comment for the report and selection date of the displayed data

    <!%003>

    Values in the general report selections (fiscal year, controlling area etc.)

    <!%004>

    Report footer

    Note that the system replaces the comments with values in the same order as they appear in the HTML code. This means that if you want to display the general report selections first, followed by the comment, for example, you can do so by entering comment <!%003> first and then entering comment <!%002> . For the same reason, it normally makes sense to place comment <!%001> before comment <!%002> .

  4. Save the HTML file.

Result

Once you have integrated the HTML file into the SAP system as an HTML template, and assigned it to a report, the system will replace all comments in the template with current values when you execute the report.

The HTML code might look something like this:

<HTML>

<HEAD>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">

<META NAME="Author" CONTENT="SAP AG">

<META NAME="GENERATOR" CONTENT="Mozilla/4.05 [en] (WinNT; I) [Netscape]">

<TITLE>Demo HTML Template</TITLE>

</HEAD>

<A NAME="top"></A><IMG SRC=" enjoy_small.gif" ALIGN=TEXTTOP>&nbsp;<FONT FACE="Tahoma" SIZE=+1>

</FONT><FONT SIZE=+2>New Reporting Style</FONT></FONT>&nbsp;

<BR>

<HR>

<FONT SIZE=-2> <A HREF="#top">Go to top of page</A></FONT>

 

<hr>

<!%001>

<hr>

<!%002>

<hr>

<!%003>

<hr>

<!%004>

 

</HTML>