- SAP Scripts Tutorial
- SAP Scripts - Home
- SAP Scripts - Overview
- SAP Scripts - Smart Forms
- SAP Scripts - Form Painter
- SAP Scripts - Layout Set
- SAP Scripts - Print Program
- SAP Scripts - Creating a Window
- SAP Scripts - Output Area
- SAP Scripts - Text Module
- SAP Scripts - Grouping Text
- SAP Scripts - Format Options
- SAP Scripts - Output Types
- SAP Scripts - Control Print Output
- SAP Scripts - Data Formats
- SAP Scripts - Export
- SAP Scripts - Import
- SAP Scripts - Control Tables
- SAP Scripts - Text & Graphics
- SAP Scripts - Control Commands
- SAP Scripts - Copy Scripts
- SAP Scripts - Standard Text
- SAP Scripts - Word Processing
- SAP Scripts - Create a Document
- SAP Scripts - Update a Document
- SAP Scripts - Find a Document
- SAP Scripts - Save a Document
- SAP Scripts - Delete a Document
- Print Preview of a Document
- SAP Scripts - Format Conversion
- SAP Scripts - Raw Data Interface
- SAP Scripts - Output Mode Spool
- SAP Scripts - Output Mode IDOC
- Create a Script in the System
- SAP Scripts Useful Resources
- SAP Scripts - Quick Guide
- SAP Scripts - Useful Resources
- SAP Scripts - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
SAP Scripts - Format Options
In SAPscript, the text output format is controlled by paragraph formats or you can combine text with styles. In the output format, you can use placeholders to create flexible data. In SAPscript, the placeholders are called symbols and they are used to show the data that is not added to the text until a later point.
These are used to format the output and all the symbols in the text gets replaced with the actual current values. This replacement is done only in the output of the text module and the original text module remains the same.
There are four kinds of symbols in SAPscript −
System Symbols − Different type of system symbols can be retrieved from tables - SAPSCRIPT, SYST, TTSXY. They are global variables and are retrieved from system tables.
Standard Symbols − They are predefined and maintained in TTDTG table. They are based on language settings of script.
Program Symbols − This represents the data from a database table or an internal table. Print programs are used to provide necessary data for these symbols.
Text Symbols − They are defined locally and is used to define recurring terms or text fragments in the document.
Placeholder / Symbol Structure
Each symbol is presented with a name and call to a symbol is made in a line of text that also contains the other text. These symbols are differentiated from the normal text, and the call is performed so that it identifies a call to a symbol or to other section of the module.
Following rules should be used while using symbols −
You shouldn’t use blank characters in the name of a symbol.
Always use ampersand ‘&’ immediately before and after the symbol.
You shouldn’t use editor line break occurs between the symbols.
Note that the symbol names are not case-sensitive and contains a maximum of 130 characters and only the first 32 characters are used to identify the symbol.
Examples of Valid Symbols
Examples of Invalid Symbols
&mysymbol − It doesn’t contain the closing character
&symbol(Z& − No closing parentheses
&my symbol& − In this, symbol name contains a space
&mysymbol)& − In this, name contains an invalid character
Common Symbols Used in SAPScript
|Current Day Number||&DAY&|
|Current Month Number||&MONTH&|
|Current Year Number||&YEAR&|
|Minutes Component of Current Time||&MINUTES&|
|Seconds Component of Current Time||&SECONDS&|
|Current Page Number||&PAGE&|
|Omitting the Leading Sign||&symbol(S)&|
|Leading Sign to the Left||&symbol(<)&|
|Leading Sign to the Right||&symbol(>)&|
|Omitting Leading Zeros||&symbol(Z)&|
|Number of Decimal Places||&symbol(.N)&|
|Omitting the Separator for ‘Thousands’||&symbol(T)&|
|Specifying an Exponent for Floating Point Numbers||&symbol(EN)&|