25 Kaavian SAP Script
25 Kaavian SAP Script
25 Kaavian SAP Script
Kaavian Systems
What is SAPscript ?
SAPscript is the integrated text management system of R/3. It is similar to other word processing systems. SAPscript simplifies the process of designing forms. It supplies the layout and content for your business forms. Used To print, distribute, or display the business forms
Kaavian Systems
Components
Editor Form Layouts and Styles Composer Print Program (Driver) Database
Kaavian Systems
Process
Kaavian Systems
FORM Management Tools FORM Painter (SE71) A graphical tool to manage form design and layout
PC Editor (SO10)
A text based tool to manage business contents
Kaavian Systems
FORM Components:
Kaavian Systems
Header :
Consists of Administrative Data and Basic Settings.
Administrative Data :
Displays the name of the form, its description, form class and the status.
Kaavian Systems
Header
Basic Settings : Default settings for the entire document is
given here. It consists of page size, Orientation,
Kaavian Systems
Paragraph Format
Used to define several paragraph formats to be used with Texts in Forms. Some of the Attributes are Margins, Alignment, Font Name & Size, Tab settings and Outline definitions. At least 1 format to be specified and it has to be defined as default paragraph in Basic settings.
Kaavian Systems
Paragraph Format :
Kaavian Systems
Character Format:
To define formats to words and characters such as Bold, Italic, Underlined, Barcode format, Font Name and Size etc.
Page Layout:
Page size is defined in the Basic Settings of Header. Within the Page, we can place any number of Windows in any
size.
Using Graphical Editor, placing and sizing windows on form is
Kaavian Systems
Windows:
There are 3 Types of Windows 1. Main Window.
It controls the page break. It contains the body text that may cover several pages. It allows to fix text elements at the upper and lower margins of the allocated page window (for example, for column headings).
2. Variable Window.
Window with variable contents. The text can vary on each page in which the window is positioned. Variable windows are formatted for each page.
3. Constant Window.
Window with constant contents that is formatted only once
Kaavian Systems
Window Types :
LOGO
Constant Windows
HEADER WINDOW
Recipient Address
Information
Variable Windows
MAIN WINDOW
MAIN WINDOW
FOOTER WINDOW
Variable Windows
FOOTER WINDOW
Documentation:
If copy of standard forms are modified, make sure that the changes are
properly documented.
Kaavian Systems
Manipulation of the layout of a form can be subdivided into the following operations:
Renaming a window
Changing the position of a window Changing the size of a window
Removing a window
Aligning a window
Kaavian Systems
PC Editor :
PC Editor can be invoked using Transaction SO10. When working with Form Painter Layout, Select the Window to Edit, right click and Select Edit Text. The Graphical Editor displayed can be changed to Line Editor using the menu path GOTO Change Editor. Displays the Text Editor for the Window. You can Enter the Text Elements, Symbols etc.
Kaavian Systems
Text Elements:
Text elements are defined for each window. They are accessed using their name by a print program,
text element
Text is assigned to window(s) as text elements.
Types :
Named Text Element Un-named Text Element
Kaavian Systems
Symbols:
These are Placeholders which represents data, replaced with their output values.
1. System symbol SAP Script supplies values for the system symbols
2. Program symbol
Data is supplied by the program. 3. Standard symbol
System Symbols
Sap script supplies values for System symbols. Fixed name for system symbols.
Examples
&DATE& &ULINE& &TIME&
Program Symbols
SAP Scripts cannot directly retrieve data from DB tables calls
Kaavian Systems
Standard Symbols
Standard symbols are defined in the TTDTG table. This table contains both the name of each symbol and its value. The value, which is language-dependent, can contain up to 60 chars. This table is delivered complete with standard entries supplied by SAP. It may be extended with customer-specific symbols
Text Symbols
All symbols which do not correspond to one of the three types of
symbol described above are text symbols. You define the value of a text symbol yourself in the text module. There are two ways of doing this:
Use the menu entries in the text editor Use the control command DEFINE Kaavian Systems
Tag
/E /: = ( / /= /( * /* -
Meaning
Element Name Command Line Continuous Text (Left Blank) Extended Line Raw Line Line Feed Line feed with Extended Line Life feed with Raw Line Default Paragraph Comment Line along with other paragraph formats defined.
SAPscript Commands :
SAPscript commands Address, Endaddress Bottom, Endbottom Box, Position, Size Case, Endcase Define Hex, Endhex If, Endif Include New-page Description Formatting of address Define footer text in window Boxes, Lines and Shading Case distinction Value assignment to text symbols Hexadecimal values Conditional text output Include other texts Explicit form feed SAPscript Commands Perform, Endperform Print-control Protect, Endprotect Reset Set country Set date mask Set sign Set time mask Style Summing Top Description
Call ABAP subroutines Insert print control character Protect from page break Initialize outline paragraph Country-specific formatting Formatting of date fields Position + / - sign Formatting of time fields Change style Summing variables
New-window
Kaavian Systems
Kaavian Systems
HEADER TEXT :
FOOTER TEXT :
PROTECT
Number of decimals
Offset Omitting leading zeros Omitting the leading sign Omitting the separator for Thousands
Kaavian Systems
SAPscript Formatting:
&SYMBOL& &SYMBOL+4& &SYMBOL(5)& &SYMBOL(I)& &SYMBOL(Z)& Symbol value is output Offset (Value returned from Offset) Width of the value Suppress Initial Value Suppress Leading Zeros
&SYMBOL(C)&
&SYMBOL(R)& &SYMBOL(*)&
&SYMBOL(9.2)& -
&text1 SYMBOL text2& - Outputs Value preceded by text1 and succeeded by text2.
Kaavian Systems
PRINT PROGRAM :
The Structure of a Print Program
Retrieves data program rstxexp1. tables: scustom, sbook, ... select * from ... ... call function 'OPEN_FORM' exporting form = ... ... call function 'START_FORM' ... ... call function 'WRITE_FORM' exporting element = ... window = ... ... call function 'END_FORM' ... ... call function 'START_FORM' ... ... call function 'END_FORM' ... ... call function 'CLOSE_FORM' ...
Kaavian Systems
Form Functions
Open_form
Close_form Write_form Write_form_lines Start_form End_form
CALL FUNCTION OPEN_FORM EXPORTING FORM = LANGUAGE = DEVICE = OPTIONS = DIALOG = IMPORTING LANGUAGE = EXCEPTIONS ... =
. . . . .
. . . . .
. . . . .
... ...
.. .. .. .. ..
... ...
CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = WINDOW = FUNCTION = TYPE = IMPORTING PENDING_LINES = EXCEPTIONS ELEMENT = FUNCTION = TYPE = UNOPENED = UNSTARTED = WINDOW =
Kaavian Systems
Source of SAPscript Forms: SAP provides you with two different sources for SAPscript forms: Standard SAPscript forms: Standard SAPscript forms are delivered with the SAP standard client (usually referred to as client 000). Preconfigured SAPscript forms: Developed for the U.S. and Canadian markets, the preconfigured SAPscript forms are delivered with the Preconfigured Client (PCC).
Kaavian Systems
Kaavian Systems
YPCC_CHECK_NUM
Discussion