Show TOC

Creating HTML TemplatesLocate this document in the navigation structure

Use

For screen-based Web applications you can select the transaction screens for which an HTML template should be explicitly generated. Generating templates explicitly is useful if the SAP GUI features are insufficient for your needs and you would need to adapt the standard generated template anyway and you would like to improve the layout. This is the case for example when you want to insert hyperlinks.

Recommendation

Standard template generation from the SAP GUI should be sufficient for most transactions. The SAP GUI for HTML can display the screen elements of a simple transaction (text fields, input/output fields, checkboxes, radio buttons, tab controls, table controls, subscreens, and so on) without you having to go to the effort of creating a template.

Note

In general, it is necessary to make manual changes to the templates that are created by this process. For example, it may not be possible to use these templates in an IAC immediately after they have been created. Furthermore, it is not possible to create completely executable templates for some transactions as this would require functionality that is only available with the SAP GUI for HTML (WebGUI). In general, the generation of HTML templates should be regarded as a basic structure that you can build on in order to develop your application. However, in general using SAP GUI for HTML should be preferred, because it provides more functionality than generated templates.

Prerequisites

You must already have created the corresponding Internet service.

Procedure

To create an HTML template from the tree display in the object list:

  1. Right-click the name of the service.

  2. From the context menu, choose Start of the navigation path Create Next navigation step Template End of the navigation path.

    The system displays the Web Application Builder: Copy HTML Template dialog box.

  3. Enter the theme for the service and define the other options.

    The other definitions depend on the type of Internet service. For more information, see Creating an Internet Service.

    For a screen-based Web application choose Generate HTML from screen and specify the screen number for which the HTML template should be generated using the F4 key. During generation, the static screen information is analyzed and an appropriate HTMLBusiness function is displayed for each screen element.

    You can change the appearance of the generated HTML page by selecting a generation style.

    Generation style

    Meaning

    Classical

    The template is generated by using HTML tags. The screen fields (values, labels, ...) are referenced using the field labels with the same names and their attributes with the assistance of HTMLBusiness expressions and statements. The screen elements are positioned with HTML <p> tags and not with absolute specifications. See Example.

    HTML business

    The template is generated by using HTML tags and HTMLBusiness functions. The layout of the screen elements is analogous to the ITS WebGUI. However, the screen elements are always positioned using <p> tags. See Example.

    WebGUI

    The template is generated by using HTML tags and HTMLBusiness functions. Both the layout and the positioning of the screen elements is analogous to the ITS WebGUI. Positioning is defined using absolute values. See Example.

    ITSmobile

    You may create the new generation style ZMYGENMOBILE with the class CL_ITS_GENERATE_HTML_MOBILE as a template for the generator. You then use this new style instead of the default generation style Mobile Devices to address your own generator when creating templates. See Example.

  4. Choose Confirm to save.

    The system then displays the Create Object Directory Entry dialog box.

  5. Assign a Package to the template and choose Save.

Result

The generated template appears in the object list under Templates. The generated contents of the template are displayed in the Editor.