Show TOC

Creating a New Template Generator or Adapting an Existing Template GeneratorLocate this document in the navigation structure

Use

If you need to change the same parts in a large number of templates, you can:

  • Write a completely new template generator

  • Adapt an existing template generator

Procedure

Writing a New Template Generator

To write a new generator, you require an ABAP class that implements the interface IF_ITS_GENERATE_TEMPLATE. You need to enter this class in table W3GENSTYLES. When doing so, make the following specifications:

  • ID for the generator (STYLE field)

  • Implementing class (ABAP_CLASS field)

  • Information text that acts only as a description in the table.

The interface IF_ITS_GENERATE_TEMPLATE has two methods:

  • The method DESCRIPTION_TEXT provides a description text with which the user can select a generator.

  • The method GENERATE returns the generated HTML text.

The import parameters PI_SCREEN_HEADER and PI_SCREEN_ELEMENTS provide the screen elements for this.

The structure ITS_ELEMEN_2006 was derived from the older structure ITS_ELEMEN, which was used for older, non-class-based generators (classical, HTMLBusiness, SAP GUI for HTML). If you are uncertain about the fields, we recommend that you use the newer fields.

Creating a Template Generator by Adapting an Existing Template Generator

The class CL_ITS_GENERATE_HTML_MOBILE provides a template for a generator. This class is derived from the CL_ITS_GENERATE_TEMPLATE class. The new class attempts to implement general functions in the abstract parent class and specific functions in the child class. Both classes can also be derived directly to create a generator by making adaptations. More information about class CL_ITS_GENERATE_TEMPLATE: Concepts of the CL_ITS_GENERATE_TEMPLATE.

Example

For a detailed example of creating a template generator by making adaptations, see Example: Creating a Generation Style.