Show TOC
New Functions for SAPscript Symbols as of
3.0
Description
General information:
- Symbol names can have a maximum of 130 characters. However, only the first
32 characters are taken into account for distinguishing the symbols
(previously 22 characters).
- In the editor, symbols can be selected from a list via the function
'Include' -> 'Symbols'. By selecting an symbol name, possible symbol
options can be entered in a subsequent dialog box.
- In the table TTXPS, the tables or structures to whose fields you can refer
from the text in question can be stored for each text ID. Via the function
'Include' -> 'Symbols' -> 'Program' the list of these tables is
displayed in the editor. With selection, you reach the field list for the
respective table from which the required program symbol can then be chosen.
You can always refer to fields of the structures SYST and USR03 and
SAPSCRIPT.
- Program symbols take their value from the corresponding TABLES work areas
which are defined in the calling program. Since several call levels can now
exist until the SAPscript program interface is reached, it must be determined
which one of these should be used for the replacement of program symbols.
Normally it is the program called up first. In the OPEN_FORM, a specific
program could alternatively be entered (field TDPROGRAM in the reference
structure ITCPO of the parameter OPTIONS). This specification applied to the
entire output editing up to the CLOSE_FORM. As of 3.0 the program name for
program symbol replacement can also be specified for the function module
START_FORM .
New symbols:
- Counter variable SAPSCRIPT-COUNTERx (x = 0..9). These symbols can be used
for counting. With the option '+' or '-' their value can be increased or
reduced by 1 before output. With the control command DEFINE the value of these
counting symbols can be filled with an initial value.
New editing options:
- 'T' suppresses the output of the thousands sign for numbers
- 'Z' now also works for leading zeros in CHAR fields
- 'Z' suppresses leading zeros in the month/day field of date fields even if
no date mask is entered.
- '+' increments the value of a SAPscript counter variable
- '-' decrements the value of a SAPscript counter
Control commands
- When defining a symbol value via the control command DEFINE, symbols which
occurred in the value were not immediately replaced by their value but only at
the time of output of the target symbol. If instead of the '=' character for
the DEFINE command the ':=' character is used, all symbols occurring in the
value to be assigned are immediately replaced by their current value. Only
after all occurring symbols are replaced, is the character string now
available assigned to the target symbol. However, the value length is limited
in this case to a maximum of 80 characters. As before, the target symbol must
be a text symbol.
Total number of pages
Description
From Release 3.0 it is possible to output the total number of pages on any
page:
2 new system symbols have been implemented for this (uppercase!):
- &SAPSCRIPT-FORMPAGES&
Total number of pages relating to the current output form
- &SAPSCRIPT-JOBPAGES&
Total number of pages relating to all output forms generated with the function
modules OPEN_FORM, START_FORM .. ENDFORM, START_FORM .. END_FORM, ...
CLOSE_FORM
Examples:
Page &PAGE& of &SAPSCRIPT-FORMPAGES(C)&
Outputs the current page number and the total number of pages. The addition
(C) outputs the symbol in compressed form, i.e., leading blanks in the default
4-character output are not displayed.
Number of output pages: &SAPSCRIPT-JOBPAGE(C)&
Outputs the total number of pages. Caution: When you use this symbol, all
output pages must be held in main storage in order that the total number of
pages can be set at the end of the output. With large output this may impair
performance.