This action might not be possible to undo. Are you sure you want to continue?
Text in the SAP system does not usually exist independently of other objects, but often contains a reference to some other stored object. For example, for a letter this could be the address data in the vendor master record or information in the material master record which is to be included in a purchase order text. The solution is to use placeholders for the data rather than entering the actual values into the text. Thus using these placeholders at all points where the text needs to be variable can create flexible text modules. Since much of the data to be inserted in the text reflects the contents of fields in SAP tables, this technique ensures that the current values of these fields are always output with the text module. In SAPscript these placeholders are known as symbols. They represent data, which will not be added to the text until a later point. This is normally the point at which the output is formatted. All symbols occurring in the text are then replaced with their current values. This replacement is performed only in the output text. The original version of the text module is unaffected.
SAPscript recognizes four different kinds of symbols: · System symbols · Standard symbols · Program symbols · Text symbols. The main difference between these is the source of their values. SAPscript provides values for the system symbols. Standard symbols and their values are defined in the TTDTG table. Program symbols represent data, which is supplied by the program that is currently executing. The values for text symbols come either from control commands in the text itself or are supplied dynamically by the Include function in the text editor. SAPscript automatically recognizes the type of a symbol. First of all it checks whether it is a system symbol. If not then it checks whether the symbol name is defined in the data area of the calling program. If it is, then it is a program symbol. Otherwise the TTDTG table is read. If the symbol is found in this table, then it is a standard symbol. If a symbol is neither a system symbol nor a program symbol nor a standard symbol, then it is a text symbol.
The Syntax of Symbols System Symbols
If necessary.Program Symbols Standard Symbols Text Symbols Formatting Options Formatting Conventions The Syntax of Symbols Each symbol has a name that is used when the symbol is called. · If additional formatting options are required. · A SAPscript editor line break should not occur between the symbol delimiters. Therefore it is necessary that symbols can be distinguished from normal text. these should be enclosed in round brackets and inserted immediately after the symbol name. a long line will have to be used in order to avoid this (paragraph format = or /=). none of these may be used in a symbol name either. since the characters '+() are used for defining formatting options. The code letters identifying these options must be given in capitals. and that the call is structured in such a way that it is possible to identify it as a call to a symbol. Moreover. A call to a symbol is normally made in a line of text that also includes other kinds of text. · The delimiter & must be used both immediately before and after the symbol. A string that does not satisfy all the above conditions will not be interpreted as a symbol but will be copied directly into the output text. Examples of valid symbols: &symbol &MY_symbol& &KNA1-NAME1& &DATE& &KNA1-UMSAT(I)& Examples of invalid symbols: &mysymbol closing delimiter missing &my symbol& name contains spaces . · The name of a symbol may not contain spaces.
&mysymbol)& name contains an invalid character &symbol(Z& closing bracket of formatting option missing &KNA1-UMSAT( i)& formatting option not in capitals No distinction is made between capital and lower case letters in symbol names (i. The current value for this symbol is taken from the SY-DATUM field. &MYSYMBOL&. You can adapt this format to your own requirements by specifying a date mask (SET DATE MASK) or by using a countryspecific formatting option (SET COUNTRY). only the first 32 characters are used for unique identification.when the TEXT_SYMBOL_REPLACE function module is called (optional) Current Day Number . they are not case-sensitive). System Symbols System symbols can be used in all kinds of text.when symbols are replaced in the text editor when a text is exported in the ASCII or RTF format .when the output is started (OPEN_FORM. It is formatted according to the specifications found in the user master data.e. Current Date Current Day Number Current Month Number Current Year Number Local Date (currently only for Japan) Current Day Name (Long Form) Current Month Name (long form) Current Time Hours Component of Current Time Minutes Component of Current Time Seconds Component of Current Time Current Page Number Page Number of the Next Page Selected Device Type Spaces Underline Vertical Line Current Date Symbol &DATE& Value The current date is displayed. SAPscript supplies the values for system symbols. The following are all identical symbol names: &mysymbol&. This value is not copied every time that the date is called. PRINT_TEXT). A symbol name can contain a maximum of 130 characters. but only at the following times:. The names of the system symbols are fixed. However. &MYsymbol&.
. The names of the months are stored in the TTDTG table under the Symbol &SPACE& key %%SAPSCRIPT_MMMM_mm. The device. The display includes leading zeros. 0. This &DEVICE& symbol is used to output the type output appropriate text determines the when language used for the output or layout type is passed inlanguage the DEVICE parameter the SAPscript output (OPEN_FORM. Vertical Line Hours SymbolComponent &VLINE& of Current Time Symbol &HOURS& Value You can use this symbol to insert a string of vertical line characters into Value The text. output. Symbol &TIME& Value The current time is output in the form hours: minutes: seconds. The number space characters required must also be passed with the symbol. If it is Currentof Time not. component of the of current time referring to hours is output. The output format as in the case of &PAGE&. If it is not.(c.f.The value for the time field is taken from output text. which is stored in Seconds Component Current Timeinto text modules.. Each of Underline the components for hours. and itdays specifies the device which table the output be %%SAPSCRIPT_DDDD_dd. An example of this is a various applications ofof the SAP system form letter which is to be sent to several customers.Value You Symbol &DAY& can use this symbol to insert into the text the page number that the Value The current page current will have day when number printed.. You can adapt format to your own requirements Value You can use this symbol to insert athis string of underline characters into theby specifying a time mask (SET TIME MASK). The The formatting displayoption includes forleading the page zeros. another program to do this. The integration SAPscript makes it possible to link data. using a Symbol &ULINE& leading zero if necessary. The address information of Symbol &SECONDS& these is in the database and has to be into the letter. . then just one vertical line character will be passed with the symbol. DATE). but has to call on display includes leading zeros.. Symbol &NEXTPAGE& Current Year Number Value This symbol is used to output the number of the following page. then no spaces are output. Value You can use this symbol to generate a string of space characters. Value This symbol is of used toMAIN. minutes and seconds consists of two digits. then just one underline character will be output. This value can be copied over only at particular times with the symbol. 12). Note: on the last page of the output in each Symbolis &YEAR& window which is not type &NEXTPAGE& the digit valuenumber. set language.. If it is not. Possible values are: PRINTER Sunday). The number of underline characters required must also be passed the SY-UZEIT field. where dd is the day number (01= Monday. SCREEN TELEX Current Month Name (long form) TELEFAX Symbol &NAME_OF_MONTH& ABAP (ABAP list display) Value The name of the current month is displayed written out in full. is output. The names of the are stored in thefor TTDTG undershould the key PRINT_TEXT) is started. number can be specified in the layout set for each page type. output the current year ashas a four Current Day Name (Long Form) Selected Device Type &NAME_OF_DAY& Symbol &DEVICE& Value The name of the current day is displayed written outof inthe full. The appropriate text language determines the language used for the output or layout Spaces set language. Minutes Component of Current Time Symbol &MINUTES& Program Symbols Value The component of the current time referring to minutes is output. The data are then copied into work areas declared Current Page Number Symbol &PAGE& . Thebe display the output The number vertical line characters required must also includes leading zeros. Valuecustomers The component of SAP the current time referring toincorporated seconds is output. The SAPscript cannot read this data out of the SAP database itself. 07 = formatted. Current Month Number Symbol Page Number &MONTH& of the Next Page Value The current month number is output. where mm is the month number (01. The display includesof leading zeros.