Creating a Document Generation Template

The Document Generation Templates page displays a list of all document templates in the system, letting you manage, create and delete templates and translate their names. Here, you can manage the format and language settings that apply to all existing and new templates:

  • Select Language - select the language in which template names and descriptions are displayed. If a template name or description has no specified value in the selected system dictionary, the values are retrieved from the default dictionary instead. To translate a template name or description, click , select the target language and enter the new value.
    To see the translated template names and descriptions from the user side, after a translation is entered here, the user should choose the language for which the translations were added in the Default Dictionary on the User Page. Following that, template names and descriptions display in the selected language for that user (given that translations are available).
  • Default Output Format - select the format in which all documents are generated by default. If format permissions are enabled for a user type, the pertaining user has the possibility to choose in which format a document will be generated. You can only choose between DOC, DOCX and PDF files here because Microsoft Excel templates are always generated as XLSX files.
  • Users can choose customer’s language when creating documents - if selected, users can select the language in which the document is generated in the Customer’s language dropdown menu when selecting a template for a specific quote. The selected language is applied to the generated document, the email sent to the customer, and the proposal page which customers access by clicking the proposal link in the email. After selecting a language, it is also necessary to include the appropriate tags in the document for the translations to display.

On this page, you can create simple, multi-section and section templates. All templates that exist on the tenant are organized in the Output Templates and Section Templates lists. In addition to the template name and type, the lists display other relevant details (visibility permissions, dates when the templates were last modified and the names of administrators who last modified them, and so on).

In the Output Templates list, administrators can organize in which order templates appear when they are presented to the user. When users are selecting the template for their documents, only output templates (both simple and multi-section) are available on the user side.

Depending on the type of template that you are creating, you have access to different tabs when editing a template. For simple templates, Sections is disabled, and for multi-section templates, Additional Files is disabled. Additionally, when creating section templates, you cannot manage the Sections and Format Permissions tabs.

The Filename column is always blank for multi-section templates. The Master Section column indicates which section controls the header and the footer of the document. Moreover, the Contained Sections column lists all the sections in a multi-section template.

The initial steps are the same for creating any type of template:

  1. In Document Generation Templates, click Add New Template.
    In Output Templates, you create simple and multi-section templates, and in Section Templates, you create sections that will be included in multi-section templates.
    A pop-up displays.
  2. Enter the template name.
  3. Click Save.
    A new page displays with multiple tabs.
    The Template Definition tab opens by default.

If you upload a Microsoft Word template, you can generate a DOC, DOCX or PDF document. However, if you upload a Microsoft Excel file (either an XLSX or XLS file) in the new document generation engine, you can only generate an XLSX file.

Template Definition

This page displays the template name, the name of the users who created and modified the template and the respective dates.

The Template Creation Tool button gives you access to a tool which creates a document template so you do not have to manually add tags.

Depending on the template type that you are creating, one of the following types is selected by default:

  • Output template - templates offered to the user on the user side.
    • Simple template (no sections) - simple documents without any sections.
      Selecting this option disables the Sections and Format Permissions tabs.
    • Multi-sections template - complex documents with multiple sections.
      Selecting this option disables the Template Creation Tool, the file revisions table and the Additional Files tab.
  • Section template - a section to be included in a multi-section document.
    Selecting this option disables the Sections and Format Permissions tabs.

If you add sections to a template and then make it a Simple Template, the sections will become unavailable. However, they are not deleted (even if you click Save) - you can make them available again by choosing Multi-sections template in Template Definition.
Similarly, the file revisions table is disabled when Multi-sections template is selected, but file revisions are not deleted when you click Save.

In Override Document Processing Engine for this template, select one of these options:

  • Use Global setting from application parameters page - default value, follows the selection on the Application Parameter page.
  • Use Old Engine - overrides the global setting to the old engine.
  • Use New Engine - overrides the global setting to the new engine.

After you have defined the general template details for a simple or a section template, you need to select the DOCX template based on which the document will be generated. Click Add New Document and browse for the document.

Uploading documents for multi-section templates is not available in the Template Definition tab. Instead, you need to separately upload a document for each pertaining section that is listed in the Sections tab of that multi-section template.

When simple or section templates are selected, files and file revisions are listed in the table below. The template name and the revision number are displayed in a row. Furthermore, clicking the icons in the table lets you preview, download and delete the document.

When in the preview mode, enter the quote composite number to preview the generated document for the selected quote.

Although a template can have multiple revisions, only one revision can be active at a time. When multiple documents are uploaded, click [activate] next to the document you wish to activate. If there is only one document, that file is active by default.

Styling Microsoft Word Templates

Before you add tags to a Microsoft Word template, first adjust the header and footer in Microsoft Word. All the styling of the template should be done in Microsoft Word so you can later only add tags without any styles. The styles that are applied to the tags in the template are also applied to the retrieved values in the generated document (for example, if you make a tag bold, the value that it retrieves is also bold in the generated document). This is applicable for all standard Microsoft Word formatting (bold, italic, underline, font sizes, text effects, text color, text background, text highlighting, text alignment, paragraph settings with spacing before and after, table formatting with all previous mentioned variations in cells, and so on). Text effects are not applied correctly to the tag output if the document is generated in the DOC file format.

Texts effects are available only for the DOCX file format, which is available in Microsoft Word 2007 and later versions.


Avoid copying and pasting tags and the text in templates in order to achieve the best performance of the Document Generation tool. Otherwise, if you must copy something in your template, make sure to first remove all styling and formatting. Visit the Document Generation Tips and Tricks page to read about the most frequent styling issues and possible workarounds.

Sections

This tab is enabled only when administering multi-section templates. Here you can select the section templates that will be included in the document.

Other than selecting section templates, on this tab you can set up the following settings:

  • User can sort sections - enables users to sort sections before generating the document. Once users sort the sections, the order remains unchanged the next time users generate documents from the same quote, regardless of the default order of sections set up in the Setup.
  • User can upload their own sections - lets users upload their own DOCX section templates when customizing the template on user side.
  • Sections will inherit formatting (header,footer etc.) from first section in the template - enables format inheritance from the first (master) section to all subsequent sections. If the checkbox is not selected, each section maintains its own formatting. This checkbox is selected by default for new documents.

If the application parameter Heading style used in generated documents is set to Keep source formatting and the checkbox Sections will inherit formatting (header,footer etc.) from first section in the template is selected, the sections of the output document inherit the header and footer from the first section of the template, but the heading style is kept for each individual section.

Adding a Section in a Multi-section Template

Prerequisites:

  • Create the section template
  • Add the corresponding DOCX document to that section template
  • Define the permissions
  1. In Sections, click Add Section.
    A pop-up with a list of existing section templates displays.
  2. Select the template you wish to add and click Add.
    The Add Section window pops up.
  3. (Optional) Rename the template.
  4. (Optional) In Template File, click Change File.
    You are redirected to the settings page of the section template where you can change the DOCX source template.
  5. Select these checkboxes, as needed:
    1. Required in document - users cannot exclude required sections from the document when customizing the document.
    2. User can download it - users can download the section while customizing the document.
    3. User can replace it - users can replace the section with another section while customizing the document.
    4. Selected by default - the section is selected by default when users customize the document.
  6. The same checkboxes are available in the list of section templates in Sections.
  7. Click Save.
    The section is added to the list of included sections.

The list displays the name of the section template and the name of the respective DOCX file. To delete and edit the template, click and , respectively.

The Sort column shows the order of section templates as they will be generated in a document. The order defined here is default and users can override it if the User can sort sections checkbox is selected. To change the order of sections, enter the numbers in the Sort column in ascending order, starting from the section that should be generated first, and click Re-Sort.

Visibility Permissions

The Visibility Permissions tab lets you define who can see the template. For example, you can allow users to access specific templates when quotes are in a certain status. When setting the visibility of a section template, you allow/disallow access to that section only, not to the entire multi-section template in which the section is included. Visibility is controlled via permission groups. To limit the visibility, unselect the Visible to all permission groups checkbox that is selected by default, and move the permission groups that should have access to the template to the Selected Permission Groups column. The logic between multiple permission groups is OR. In Step 2, click , and create a condition under which the template is visible to the selected permission groups. By default, 1 displays in the condition box, meaning that the template is visible under all conditions.

Format Permissions

In this tab, you select the permission groups that can select the output format of the generated template. By default, all permission groups are able to generate templates only in the format selected in Default Output Format in the Document Generation Templates page. Users that belong to the permission groups selected in Format Permissions will also have other template formats available for selection. The logic between multiple permission groups is OR. In Step 2, click , and create a condition under which format selection is available to the selected permission groups. By default, 1 displays in the condition box, meaning that format selection is available under all conditions.

Related Fields

The Related Fields tab specifies the quote custom fields that are related to the entire template or to the section, in case of a section template. Users are prompted to fill out related fields when customizing a document that is being generated. Depending on the template type you are editing, the fields will be related to a section (in case of a section template) or to the entire output document (in which case, they are displayed in the Template Details panel in the Customize tab on the user side). In the screenshot below, you can see an example of each case: Quote Expiration Date and Terms are related to the Introduction section and Additional Comments and Customer Comments are related to the document in general.

A list of available custom quote fields opens upon clicking Add New Quote Field. Select a field and click Add. The selected fields are listed in the Related Fields tab and you can rearrange and delete them by clicking the respective icons.

If Required is selected next to a field, users first need to populate the field before they can proceed with generating the document. Otherwise, if the checkbox is not selected, the fields are under the Customize tab for users to populate.

Additional Files

This tab is for selecting the files that will be attached to the generated document (for example, descriptions of quote items, data sheets, terms and conditions, and so on). Before you can add files to the template, you need to upload them in the Manage Content Documents section.

The additional files are included in the generated document only if the following tags are in the template:

<<INCLUDE_DOCUMENTS>>
<<INCLUDE_DOCUMENTS_END>>

Files are included in the same order in which they are displayed to the user. If the checkbox Don’t include same file more than once is selected on the user side, SAP CPQ does not include duplicate files. Otherwise, duplicate files are included if found.

To add files to the template, specify the following settings:

  • Image settings - specify the way image files are inserted into generated documents. You can choose between Default settings (format: PNG, resolution: 300, quality: 100) and Custom settings. Selecting Custom settings allows you to choose between two formats:
    • PNG (choosing PNG allows you to further specify Image resolution)
    • JPG (choosing JPG allows you to further specify Image resolution and Image quality)
      Configuring image settings allows you to control the size of the output document. Namely, PNG is a high-quality image format and choosing it results in large output documents. On the other hand, choosing JPG results in documents of a smaller size and lower quality.
  • Include file(s) for each quote item - select the checkbox to attach files to each quote item in the generated document, not to the quote globally.
  • Included File(s) - add the name of the file that you wish to attach to the generated document. File names must contain the file extension (for example, ABCCaseStudy.docx). The system supports DOC, DOCX, PDF, PNG and JPG files. Alternatively, click to create a formula that dynamically retrieves file names from a custom table.
  • File Description - enter a description of the file manually, or define a formula that retrieves the description dynamically.
  • Add More Files - click it to add another Included File(s) and File Description fields so that you can add more than one file to the template.
  • File Selection - select Check Boxes to let users select multiple files to attach to the generated document. Alternatively, select Radio Buttons and users will be allowed to select only one file.
  • Separate files with page break - select this checkbox for the system to separate additional files with a page break.

Files found for the first quote item are displayed first (in the same order as defined in Setup), followed by the files found for the second item, and so on.

Delegation of Authority for Document Templates

Users in the permission groups that you select in this tab are able to manage templates on the user side of SAP CPQ. For example, if a regional SAP CPQ administrator responsible for several markets wishes to authorize certain users in a specific market to create document templates, this feature can make that possible.

Alternatively, if you select Visible to all permission groups, all users can manage the template locally.

In Step 2, click , and create a condition under which the template is available locally to the selected permission groups. By default, 1 displays in the condition box, meaning that the template is available locally to the selected permission groups under all conditions.

When users are given the authority for managing a document generation template, the template becomes available in the Manage Global Document Templates section of the User Menu. Just like the administrators, users can select the language in which the template names and descriptions are displayed. The selection of languages on the administrator and user side is codependent (the language selected in one page is automatically selected in the other).

Templates which users can manage are organized into Output Templates and Section Templates sections. When users open a simple template, they can manage the details in Template Definition, Related Fields and Additional Files tabs.


More Information

You are here: SAP Sales Cloud CPQ Online HelpAdmin Page HelpQuotes AdministrationDocument GenerationCreating a Document Generation Template