Show TOC

Object documentationCommon Document Formatting Properties Locate this document in the navigation structure

 

This section lists document formatting properties to create a document form definition. You need to know the following general information about defining document forms:

  • Most of these commands begin with a period. This is a convention that indicates to the system that the information following the period must undergo some form of processing. The only exception is when straight copy is specified (no variables or conditions required); straight copy does not need to be preceded by a period.

  • If headers or footers are specified, they are not printed unless the document also contains body content.

  • Configuring a document supports the functionality of the following components and is a prerequisite for the successful configuration of features: Validation Rules, Terminal Operations, and User-Defined Functions.

Common Document Formatting Properties

Function

Description

To name a document section or form

The section within an overall document is called a document form. A document form contains instructions for a single event or element in the overall print or display plan. This example shows the name of a document section in this format:

.returnreceipt

To print straight text

Straight text is information that is printed or displayed at the POS terminal regardless of the details of the transaction. An example of how this is used is to repeat a promotional message on every receipt. Type the text to be printed directly on a line in the document definition. No special code is required to convey straight text. For example, to have the text string: You have saved this much printed, enter the text string on a new line in the document form as it appears. For more information on how to print variable information, see the formatting property — To specify a variable. To print straight text that is non— ASCII, use:

/u_ _ _ _, where _ _ _ _ represents hex digits.

To print special characters

To print special characters, use the following:

^_:x^

where “_” is the special character, and “x” is the number of times to print. Other examples include:

  • To print a Caret:

    ^^:x^

  • To print a Percent Sign:

    %%

  • To print a Dollar Sign:

    $$

To print a period or decimal point, use. anywhere except in the first column. For a period or decimal point in the first column:

^.:x^

To specify a variable

Each event in the system provides a specific set of variables. These variables can be used to draw information into the document form. To specify a variable, type its name preceded and followed by the percent sign in a line within a document form.

The variable tender is referenced in the document form as: %tender%

The POS outputs whatever the value of the tender variable is for that specific transaction or event in the print or display form. For a list of supported variables and the transaction elements, see Functions for Variables.

To specify conditions for printing functions

Conditions produce different output results depending on the variables applied to a transaction. A condition can be specified as follows:

.formname,onfail=linkeddocument

formname refers to the name of the specified document form, and onfail denotes alternate action to be executed when the original condition cannot be met. In this example, it refers to being given all variables listed in the form. You substitute linkeddocument with the name of the alternate document the system must reference if the formname document does not match the specified criteria.

You can define a document to print only certain elements when specified conditions are met, or specify another form or action when a condition fails. You can also reference a form from another document or section definition in response to a condition as follows:

  • Implicit condition — the condition is met when all variables referenced in the form are found. As long as a value exists, it is rendered

  • Explicit condition — the value of the variable must exactly match the condition, for example count=1

Condition results can be expressed in any of the following formats: Text value (variable=value), Numeric value (variable=value), or Length tests (variable>Ln), where “n” is the length.

The following comparison signs can be used to express conditions: <, <=, =, >=, >, <>.

You can format a form that is designed to convey the total number of items in a transaction and build it on an explicit condition as:

.total,count=1,onfail=totalmore

TOTAL||%total%

%count% ITEM

.totalmore

TOTAL||%total%

%count% ITEMS

In the first form, the condition calls for a value of 1 in the variable count. If that condition is met, then the POS terminal prints the value of the variable as 1, followed by the straight text ITEM below the left-aligned text TOTAL. If the value is not 1, the system must look to the form totalmore, to print the value of the variable to (anything other than 1), followed by the straight text ITEMS below the left-aligned text TOTAL

To insert another document or section into the current document

Insert a different document or section of a document into the current form using the following command:

.insert documentname,sectionname

You can also insert a different section from within the same document into the current form using the following format:

.insert sectionname

To align text

The pipe character, or vertical bar |, specifies text alignment. A single bar, or | specifies left and center alignment (any text preceding the single pipe is left-aligned, and text following the pipe is centered). A double pipe or || specifies right alignment. When no alignment is specified, the default is left alignment.

Specify the text alignment using this format:

|Thank you for shopping at

||SAP

Here the first line of text is centered; the second line is right-aligned

To print text in reverse

Emphasize the printed text on a receipt by printing white text on a black background using this format:

~reverse~

To print in color

There are two ways to use color. If your printer does not support the new specifications, the document uses the single alternate. The first example uses a single alternate color X, if available.

In the second example, RRR is a three digit number from 000 to 255 that represents the red component, GGG represents the green component, and BBB represents the blue component:

~color~X

~rgb~RRRGGGBBB

To add a blank line in a series of blank lines

Insert as many blank lines as required anywhere in the document form as follows:

.blank

To specify more than one consecutive blank line, add a numeric value after the blank format. In this example, six blank lines are added within the document form using this format:

.blank6

To specify horizontal spacing (padding space) and alignment

The semicolon defines space alignment. The caret symbol or ^ either forces a series of blank vertical spaces after specified output, or it can fit the output into a predefined character width. This is useful for keeping consecutive rows of amounts lined up in a document form.

In an on-screen display, when a total value must be displayed for a series of items, you can use vertical alignment to keep items that contain tax group characters in line with others that do not. Note the space between the caret symbol and the colon.

  • ^ :2^ — the character after the caret is the character, and the 2 is the number of those characters to print. If you use x instead of a number, it extends the character across the receipt width

  • %code:12% — makes the output stretch to a predefined character length. Here the value of the variable code stretches across a 12 character width. You can also specify the alignment for space-defined output. The letter r denotes that the value of the taxes variable, which should fit into two character spaces, should align to the right. Center alignment is specified by the letter c. If no alignment is specified, it is assumed as left, or alternately, you can directly specify left alignment by the letter l

  • %taxes:r2% — pads numbers with preceding zeroes instead of empty spaces by using the zero character when specifying the vertical alignment

  • %variable:r03% — pads zeroes into any remaining preceding space in three- and five-character widths after the value of the variables are relayed: store, register, and transaction. You can create a store reference number for a receipt based on an overall number that contains the store number, register number, and transaction number with zero spaces in between the numbers. For example,

    %store:r03%%register:r03%%transaction:r05 produces 00100300065 when the store number is 1, the register number is 3, and the transaction number is 65

To format style of text

A formatting code changes the appearance of your print output. Any data following the formatting code is affected until the end of the line or until specified otherwise. The following attributes affect the appearance of the text. The attribute normalattribute suppresses or removes specified appearance attributes (bold, underline, or italic) and applies the default values:

~bold~

~underline~

~italic~

~normalattribute~

The attribute normalsize suppresses or removes any specified dimension attributes (doublewide, doublehigh, or doublewidehigh) and applies the default values:

~doublewide~

~doublehigh~

~doublewidehigh~

~normalsize~

To repeat a string of characters across a document

The caret character, ^, surrounds the command to repeat a string of the specified character a number of times. The command consists of the repeating character, followed by a colon and the value representing the number of times the character must be repeated. For example, to print a series of 15 dashes across a receipt form, you enter the command:

^-:15^

To repeat the character across the width of the physical form for a print output, or across the width of the device for a display output, use X as the specifying value

To insert a masking rule

Hide or camouflage all or part of a number such as a credit card number, on-screen or on a printed form, by applying a variable in the following format:

~mask(%variable%, Masking Rule ID)

To show the rolled-up version of a detail line at the POS

Display the original detail line on the receipt in the following format:

.use rollup

In a price override, it allows you to group a price override line with its parent item line and show only the new price line on the receipt

To display the current total on a remote display

Add the optional form to the continuous document as follows: .currenttotal. It is activated in all continuous documents by the Total key. The form must only be present on the remote display form document