Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  Data Interfaces and Communication Interfaces →  ABAP and XML →  Transformations for XML →  ST - Simple Transformations →  ST - Reusing ST Programs 

ST - tt:include, Include Transformations

Other versions: 7.31 | 7.40 | 7.54


<tt:include name="trafo" [templates="tmpl1 tmpl2 ..."] />


In an ST program, the statement tt:include can be used to include a different ST program trafo, as follows: This statement makes the templates and type definitions of the included program usable in the current ST program. The ST program trafo must exist in the repository. trafo is not case-sensitive.

The ST command tt:include can be executed in an ST program only outside of templates. In the default setting, it includes all named templates of transformation trafo at transformation level (unnamed main templates are not included). Make sure that no namespace conflicts occur; a transformation is not allowed to include itself.

If the attribute templates is specified, only the templates tmpl1 tmpl2 specified there and the templates called by them using tt:apply are included.


Only those transformations can be included (in another transformation) whose named templates are not in conflict with the existing named templates. tt:apply can be used to use the included named templates as subtemplates in "including" templates.


The ST program below corresponds to the example from Subtemplates Without Their Own Data Roots, except that the subtemplate of an included ST program is used.

<tt:transform template="TEMP_MAIN"

  <tt:root name="ROOT"/>
  <tt:template name="TEMP_MAIN">
      <day1 tt:ref="ROOT.DAY1">
        <tt:apply name="TEMP_SUB" />
      <day2 tt:ref="ROOT.DAY2">
        <tt:apply name="TEMP_SUB" />
  <tt:include name="..." />

The statement tt:include could also be placed before the main template. The included ST program can be implemented as follows:

  <tt:template name="TEMP_SUB">
      <tt:value ref="$" />
      <tt:value ref="$" />