Sapscript Formatting Options Available in Sapscript
Sapscript Formatting Options Available in Sapscript
Enclose the text that you want to prevent page-break in PROTECT... ENDPROTECT SAPscript will ensure that each line of this text is printed together on the same page. Ie.If SAPscript finds that the text cannot be printed on that page completely a implicit page break occurs and the text is printed on the next page
/: * * * /: PROTECT Text Within The same page ENDPROTECT
&symbol(N)&
&symbol(Z)&
&symbol(S)&
&symbol(<)&
Display leading sign to the Left (you may also use /: SET SIGN LEFT)
forum: Ignored if the domain has "sign" option disabled (sign is never printed in that case)
&symbol(>)&
Display leading sign to the right (you may also use /: SET SIGN RIGHT)
forum: Ignored if the domain has "sign" option disabled (sign is never printed in that case)
&symbol(C)&
Compress spaces
&symbol(.N)&
Do not use a field related to a currency code or unit of measure (as these last define the number of decimals), otherwise you'll get error SSFCOMPOSER602 (Field &2: Incorrect formatting option "&1") while outputting the form
&symbol(T)&
&symbol(R)&
Right justified
&symbol(I)&
&symbol(K)&
Ignore conversion
forum: "K option works only for Character-like variables (char, date, time,
routine
numc), string and Integer. It doesn't work for packed, float and other types (see routine CONVERT_SYMBOLVALUE in include LSTXVFCD)"
You may combine options, for example: &symbol(8R)& which means right-aligned inside 8 characters
&DAY&
Day
&MONTH&
Month
&YEAR&
Year
&TIME&
&HOURS&
Hours
&MINUTES&
Minutes
&SECONDS&
Seconds
&PAGE&
Page
&NEXTPAGE&
&SPACE&
Blank
&ULINE&
Underline
&VLINE&
Vertical line
&NAME_OF_MONTH&
&SAPSCRIPT-JOBPAGES&
SAP Library - SAPscript - System Symbols SAP Library - SAPscript - General SAPscript Fields
This displays the date as : September 26, 07 The following are the codes that can be used in the date mask: YY Year (2 digits)
YYYY
Year (4 Digits)
MM
Month (2 Digits)
MMM
DD
DDD
DDDD
Day name
Using the SET DATE MASK causes the subsequent date fields to be displayed using the same formatting. To return to the default formatting use the following command:
/: SET DATE MASK = ' '
For more information, see SAP Library - SAPscript - Formatting Date Fields: SET DATE MASK
This displays the time as : 11 hrs 43 min 37 sec' The following are the codes that can be used in the time mask: HH Hours
MM Minutes
SS
Seconds
For more information, see SAP Library - SAPscript - Formatting Date Fields: SET TIME MASK
What is the difference between the SAPscript texts, 'Customer &KNA1-KUNNR&' and '&Customer KNA1-KUNNR&'?
In the first case of 'Customer : &KNA1-KUNNR&', the text 'Customer : ' is displayed regardless of the variable KNA1KUNNR even if it has initial value In the second case of '&Customer : KNA1-KUNNR&', the text 'Customer :' and KNA1-KUNNR is displayed only when the variable KNA1-KUNNR has non-initial value
For more information, see SAP Library - SAPscript - Formatting options - Preceding and Subsequent Texts (Pre-Text / Post-Text)
Similarly the SIZE command sets the width and height parameters.
/: SIZE WIDTH '10' TW HEIGHT '10' TW
Control commands
How to Use the New-Window Command?
You can use the NEW-WINDOW command to call the other main window explicitly in the form, even if the current main window is not full. We can create upto 99 Main Windows. This Main windows are generally used to create labels or to write Addresses.Need to write this in the Main window.
/: NEW-WINDOW
You can explicitly trigger a page not in sequence by specifying the name pf page with the command NEW-PAGE
/: NEW-PAGE <pagename>
How can I set the header and footer in the main window?
The TOP...ENDTOP and BOTTOM...ENDBOTTOM commands are used to set the header and footer texts in the main window respectively. These texts will be displayed on the start and end of every new page in the output. To disable these texts enclose empty commands between the commands. Eg.:
/: TOP /: ENDTOP
http://help.sap.com/saphelp_nw70ehp2/helpdata/en/d1/8032d9454211d189710000e8322d00/fra meset.htm
Offset Output Length Omitting the Leading Sign Leading Sign to the Left and Right Omitting Leading Zeros Space Compression
Number of Decimal Places Omitting the Separator for Thousands Specifying an Exponent for Floating Point Numbers Right-Justified Output Fill Characters Suppressing Output of Initial Values Ignoring Conversion Routines Local Dates (Currently Only for Japan) Changing the Value of a Counter
&symbol(.N)& &symbol(T)& &symbol(EN)& &symbol(R)& &symbol(F f )& &symbol(I)& &symbol(K)& &symbol(L)& &SAPSCRIPT-COUNTER_x(+)& - Increase counter by 1 &SAPSCRIPT-COUNTER_x(-)& - Decrease counter by 1
Preceding and Subsequent Texts (Pre-Text / &'pre-text'symbol'post-text'& Post-Text) Country-Dependent Formatting Date Mask Time Mask /: SET COUNTRY country_key /: SET DATE MASK = 'date_mask' /: SET TIME MASK = 'time_mask'