Show TOC

 Creation of HTML Templates

Use

This function is used to create HTML Business templates.

Integration

HTML Business templates are used by the Internet Transaction Server (ITS) to display application data from an SAP system in a web browser when an ITS service is accessed. Each HTML Business template contains standard HTML source text and HTML Business statements.

See also: ITS File Types

The main template in the HTML Customer Overview is SAPLEWHV_100.html.

Libraries used are loaded into this template and debug functions are made available here. The HTML template for layout <VIEWNAME>.html has been inserted dynamically in this HTML template.

Prerequisites

You want to display data in the HTML Customer Overview that has not been defined in the ISM_ALL HTML data selection. You have created a separate HTML data selection and must now create the associated HTML Business templates for this data selection.

Note Note

You can also modify the ISMAM_ORDER.HTML (M/AM orders) and/or ISMAM_COMPLAINT.HTML (M/AM complaints) HTML Business templates that are provided by SAP.

End of the note.

Features

Creation of HTMLBusinesstemplates

If you are using SAP Media, Release 4.61, you should create the HTML templates in the SAP@Web Studio . If you are using SAP Media, Release 4.62, you should create the HTML templates in the Object Navigator .

See also: Manual Creation of HTML Templates in the SAP@Web Studio See also: Creation of HTML Templates Using the Template Wizard in the SAP@Web Studio See also: Creation of HTML Templates in the Object Navigator

HTML Business templates can also be created by copying existing HTML Business templates. If you want to display an additional telephone number in the HTML Customer Overview , you can copy the HTML Business template for the address data, add the additional telephone number and delete any attributes that are not to be displayed.

Note Note

If you are using the SAP@Web Stu dio , you do not need to check the HTML template into the SAP System because it is only used from the ITS server. If you try to check the HTML template into the SAP System, the system displays an error message because its name does not comply with the SAP naming conventions. If it becomes necessary to check an HTML template into the SAP System, you must name it using the naming conventions (starting with Z instead of SAP). Do not however advertise the HTML template under this name (starting with Z) on the ITS server because the service only recognizes HTML templates that correspond to the SAPLEWHV_<viewname>.hmtl naming convention.

End of the note.
Error analysis

The ewhv_debug and ewhv_debugfunction HTML templates are provided in the ISU_GLOBAL service to check the HTML Business syntax in the HTML templates.

Use of these debug functions is recommended during creation of separate HTML templates, since this allows you to test why certain data objects and attributes are not displayed in the HTML customer overview even though they were selected in the HTML data selection.

Two debugging modes are available in the HTML templates for the HTML Customer Overview . These modi are activated using the debug=1 or debug=2 parameters by attaching the URL with &.

  • An overview of the data objects displayed with their (hierarchical) dependencies and descriptions of object types and classes is displayed in mode 1.

  • An overview of the data objects and attributes transported (contents) is displayed in mode 2.

    Note Note

    To activate the debugging function, add the & debug= 2 parameter to your URL.

    End of the note.
ewhv_functions

A range of specific HTML Business functions are provided in the ewhv_functions HTML template in the ISU_GLOBAL service. These are used to access data in the HTML Business templates. HTML Business functions are used to access attribute values and to navigate between data objects.

If you intend to use the HTML Business functions, you must use an include ("ewhv_functions") to incorporate SAPLEWHV_100.html in the main customer overview template .

Use of the HTML Business functions is shown in the examples provided in the EXAMPLE1 and EXAMPLE2 templates that are found in the EWHV service.

If you want to create your own HTML templates, you should also be familiar with the following HTML Business functions.

Function

Description

object = root()

Returns the start object with which the Cluster Builder commences. This is the business partner object for the HTML Customer Overview

Example: partner = root();

value = attrib( obj, attr )

Returns the value value of the attribute attr for the object obj .

Example: value=attrib(partner,"DESCRIPTION")

object = child( obj, ind )

Returns the sub-object with the index ind for an object obj .

Example: child1 = child(partner, 1)

num = child_dim( obj )

Returns the number num of sub-objects for an object obj .

Example: num = child_dim(partner)

object = childoftype( obj, typeid, ind )

Returns the sub-object object with the type typeid and the index ind for an object obj .

Example: acct = childoftype(partner, "ACCOUNT", 1 )

num = childoftype_dim( obj, typeid )

Returns the number num of sub-objects of the type typeid for an object obj .

object = father( obj )

Returns the parent object for the object obj .

id = typeid( obj )

Returns the type ID typeid for an object obj .

clsid = classid( obj )

Returns the class ID clsid for an object obj .

cls = class( obj )

Returns the class cls for an object obj .

object = ObjectOfClass( clsid, ind )

Returns the object with the index ind for a class clsid .

num = ObjectOfClass_Dim( clsid )

Returns the number of objects in a class.

name = attrib_name( cls, ind )

Returns the name of the attribute with the index ind for a class cls . (Only works if the metainfo parameter is selected.)

text = attrib_text( cls, ind )

Returns the text of an attribute with the index ind for a class cls . (Only works if the metainfo parameter is selected.)

num = attrib_dim( cls )

Returns the number of attributes in a class cls . (Only works if the metainfo parameter is selected.)

key_atr =class_key( cls, ind )

Returns the key attributes with the index ind for a class cls. (Only works if the metainfo parameter is selected.)

num = class_key_dim( cls )

Returns the number of key attributes in a class cls . (Only works if the metainfo parameter is selected.)