This shows you the differences between two versions of the page.

adminhelp:quotesadministration:documentgenerationtemplates:creatingwordquotetemplates [2013/01/21 04:36]
adminhelp:quotesadministration:documentgenerationtemplates:creatingwordquotetemplates [2018/11/05 07:32] (current)
Line 1: Line 1:
 +====== Creating Word Quote Templates ======
 +To begin you must create a Word or Excel quote template for the system to render for the user.  If you’ve already created a template, then you can skip to the Document Generation Template Administrative Section to learn more about uploading new templates to the system and managing existing templates. \\  
 +<note>The examples and discussions in this chapter will only discuss Word quote templates.  Excel templates can use the same tags but there are a few limitations as to how they can be laid out.  For more information on Excel templates see the section in [[adminhelp:appendixa:productmodelobjecttags:attributedatatags|Appendix A]].</note>
 +There are three word quote templates that come with a new installation of SAP CPQ:  Reseller Quote with Terms.doc, Simple Quote with Cover and Discount.doc, and Simple Quote.doc.  These are standard templates that you can customize for your company’s needs. \\ 
 +As these standard templates show, you can include any information into the quote template. Most common is to include the customer information, such as Bill To, Ship To, or End User fields. In addition, the template will also include the items from the cart.  This, along with any other information, can be included through the use of SAP CPQ quote template tags. \\ 
 +**Quote Template Tags** are used to transfer information from SAP CPQ into the Word document.  This is done by adding these Tags into the document using normal text.  For example, you could include the following in the Word document:  "Total price of the quote is: <<Q_QUOTE(TOTAL)>>". The tag being used here is a quote template tag which retrieves the total price of the cart when the quotation is generated. \\ 
 +Expressions are entered into a Word document in the places or order that they will be displayed. Virtually every piece of information existing in SAP CPQ is available to be placed into a Word document.  Each tag has a prefix character(s) that represent how the tag is used.  The Q tags represent information that will be pulled from the Quote.  C tags are Cart tags and can only be used within a C2 repeatable quote tag, which is discussed in the examples below.  ST tags are Special Tags that may fall outside the Cart or Quote tags.  The Q and ST tags can be used anywhere in the document without being restricted to the C2 repeatable quote tags.  \\ 
 +===== EXAMPLE 1 =====
 +            <<C2>>
 +            <<MAIN>>
 +            This configuration includes <<C_PATTR(<*Value(Software)*>)>>
 +            <<C_STOP>>
 +            <<MAIN_END>>
 +            <<C_END>>
 +This code can be used quite often.  The <<C2>> is a repeatable tag that pulls information from the product or products that have been added to the cart.  There are a series of repeatable C tags that can be used.  In this case, the C2 tag being used references all the main items that have been added to the cart.  Using different C2 tags, you can distinguish by product type, main item, or line item which information to display.  In this example, only the main items of each product will be displayed because we are using the <<MAIN>> tag. \\ 
 +There are other tags that are preceded by a C that can only be used within a repeatable C2 tag. <<C_PATTR(…)>> is one of those.  It can call any standard SAP CPQ tag that is not a quote template tag.  In this example, it calls the tag <***Value(Software Description)***>.  This tag returns the display value of the selected attribute value for the attribute. This means that the selected attribute display value for Software will be printed. \\ 
 +Output will look like this: \\ 
 +This configuration includes Photo Shop 12 \\ 
 +If more than one product that has been added to the cart includes the Software attribute, then the output will include the selected attribute value for both products.  In this case, the output would look like this: \\ 
 +This configuration includes Photo Shop 12 \\ 
 +This configuration includes Office 2003 Professional \\ 
 +Similarily in Excel we can create complex structure by using the following example:\\
 +            <<C2(10x6)>>
 +            <<HEADER(2x6)>>
 +            This is header
 +            that is using 2 rows
 +            <<MAIN(1x6)>>
 +            This configuration includes <<C_PATTR(<*Value(Software)*>)>>
 +            <<LI(1x6)>>
 +            This configuration includes <<C_PATTR(<*Value(Software)*>)>>
 +            <<FOOTER(1x6)>>
 +            This is footer
 +10x6 indicates that this C2 (including C2 row) is spanning 10 rows and 6 columns
 +2x6 and 10x1 indicates that content of HEADER or MAIN is spanning 2 rows (or 1 rows) and 6 columns.
 +This is necessary to be presented like this because excel is one large table in it self and this way we define range which contains the section relevant for our processing.\\
 +===== EXAMPLE 2 =====
 +Tags can also be used to display the entire cart.  This is generally done using a table.  Though it is not necessary, tables do offer a good representation of the cart itself.  The best way to do this is by using one of the repeatable C2 tags.  If you are going to use a table to display cart information, you must use specific repeatable C2 tag for table.  These are the CT2 tags.  Like the C2 tags, you can also distinguish by product type, main items, or line items which information to display. \\ 
 +{{ Wiki::creatingwordquotetemplatesb2.png }}
 +;#;//Figure A - Quote Template Tags//;#;
 + \\ 
 +As shown in Figure A, each tag displays a different piece of information. The headings, such as Item, Part Number, Description, etc., have been "hard-coded", which means they will not change when the system renders the tags and inserts the cart information.  When using CT2 tags it is necessary to follow a certain format so that the system can render  the table correctly: 
 +  * First row includes the headers
 +  * Second row must have <<CT2>> in the first column 
 +  * Third row can include tags for the Main Items.  This row can be empty if you do not want to display the main items.
 +  * Fourth row can include tags for the Line Items.  This row can also be empty if you do not want to display the line items.
 +  * There must be a fifth row.  It can be empty, but it will usually include the total of the quote.  This row needs to be there, though, or else the table will not render properly.
 +{{ Wiki::creatingwordquotetemplatesb3.png }}   
 +;#;//Figure B - Parsed Quote Template Tags//;#; \\ 
 +When the system renders the table, it runs through each row for each item, main item or line item, that has been added to the cart.  The result, as shown in Figure B, is a table that has been filled with all the information from the cart. \\ 
 +===== EXAMPLE 3 =====
 +Word Tags can also be used to insert a document within another document. Both documents can be dynamically created and filled with information. This may be useful if a document needed to be included that had some general information, such as terms and conditions, or had information specific to a configuration.  Using this method, we are also able to dynamically determine which files should be included in the document. For example, we may want the user to pick and choose the documents that will be included when the quote is generated.  A good way to do this is to create custom fields in the cart area where the user can choose the documents to include. These quote properties can then be accessed in the quote template. \\ 
 +{{ Wiki::creatingwordquotetemplatesb4.png }} 
 +;#;//Figure C - Custom Fields//;#;
 + \\ 
 +As shown in Figure C, users can select what documents they would like included in the generated quote by selecting custom fields in the cart. These custom fields are attached to the same attribute that has only two values, Yes and No.  Figure D shows how these fields can be used in the quote template. \\ 
 +{{ Wiki::creatingwordquotetemplatesb5.png }}  
 +;#;//Figure D - Custom Fields Tags//;#;
 +The tag <<Q_QP(//custom field//)>> pulls the value for the specified field.  This value is used within a CONDITION tag.  If the field equals Yes then we will insert the file.  To insert the file, we’re using the tag <<Q_FILE(//filename//)>>.  This tag inserts the specified file.  Alternatively, if you would like the included file to be chosen based on the configuration of the product, you can use the <<C_PATTR_FILE//(CPQ Tag//)>> tag.  This tag can call any standard SAP CPQ tag and assumes that the returned value is a filename and inserts that file.  Using this method, you can create an attribute with filenames as attribute values in the configuration of the product.  These values will be selected based on the selections of the user.  Then you would insert the file using this tag: <<C_PATTR_FILE(<***Value(//attribute name//)***>)>>. \\ 
 +Any file inserted into a quote template needs to be included in the /quotation/user_templates folder.  Files can be uploaded there through the Additional Documents field in the Quote Templates administration, which is explained later.  The include files can include tags themselves and will be rendered along with the document that is including the file. \\ 
 +===== See Also =====
 +[[adminhelp:quotesadministration:documentgenerationtemplates:documentgenerationtemplates|Document Generation Templates]] \\
 +[[adminhelp:quotesadministration:documentgenerationtemplates:managingquotetemplates|Managing Quote Templates]]\\  [[adminhelp:quotesadministration:documentgenerationtemplates:generatedocuments|Generate Documents]]\\  [[adminhelp:quotesadministration:documentgenerationtemplates:documentgenerationusingword2007format|Document Generation Using Word 2007]]\\
 +[[adminhelp:appendixa:quotegenerationtags:quotegenerationtags|Quote Generation Tags]]   
You are here: SAP Sales Cloud CPQ Online HelpAdmin Page HelpQuotes AdministrationDocument Generation TemplatesCreating Word Quote Templates