Creating HTML Templates


If you want to implement a Web application that is based on flow logic (such as a MiniApp), you must create HTML templates.

For screen-based Web applications you can select the transaction screens for which an HTML template should be explicitly generated. These templates that you created explicitly are identical to the HTML documents that are generated automatically by the SAP GUI for HTML.
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.


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.


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 it not currently available with the SAP GUI for HTML (WebGUI) (complex Office integration, additional non-standard controls and so on). 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.


You must already have created the corresponding Internet service.


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 Create ® Template.

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



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.


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.

You should select the option Name of the template for Web applications that are based on flow logic (such as MiniApps) and then define a name for the new template.

       4.      Choose  Save.

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

       5.      Assign a Package to the template and choose .


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

See also:

·        Extending HTML-Templates

·        Inserting MIME Objects