Professional Documents
Culture Documents
02-Sep-09 Kaavian
Systems
Purpose
Sap script has two parts: one print program and another layout
set.
02-Sep-09 Kaavian 2
Systems
Components
Components
Editor
Composer
Database
02-Sep-09 Kaavian 3
Systems
Components
Components
Involved
02-Sep-09 Kaavian 4
Systems
Process of Script
Process
Printer
FAX
On Screen
02-Sep-09 Kaavian 5
Systems
FORM Management
FORM Painter
A graphical tool to manage form Design and layout set
(SE71)
PC editor
A text based tool to manage business contents (SO10)
02-Sep-09 Kaavian 6
Systems
Components of FORM
FORM Component
Header
Paragraph format
Character format
Page layout
Documentation
02-Sep-09 Kaavian 7
Systems
Header details
Header :
Consists of Administrative
Data and Basic Settings.
Administrative Data :
02-Sep-09 Kaavian 8
Systems
Header details
Header
Basic Settings :
02-Sep-09 Kaavian 9
Systems
Format details
Paragraph Format :
definitions.
02-Sep-09 Kaavian 1
Systems 0
Paragraph Format
02-Sep-09 Kaavian 1
Systems 1
Character Details
Character format:
To define formats to words and characters such as Bold,
Italic, Underlined, Barcode format, Font Name and Size etc.
02-Sep-09 Kaavian 1
Systems 2
Layout
Page layout
Page size is defined in the Basic Settings of Header.
02-Sep-09 Kaavian 1
Systems 3
Types of windows
Main window
Variable window
Constant window
02-Sep-09 Kaavian 1
Systems 4
Windows
Recipient Information
Address Variable Windows
MAIN
WINDOW
MAIN Variable
Main Windows
Windows
WINDOW
02-Sep-09 Kaavian 1
Systems 5
Components of script
Documentation
Store Technical Details relating to the Script.
If copy of standard forms are modified, make sure that the changes
are properly documented.
02-Sep-09 Kaavian 1
Systems 6
Editor in script
PC Editor
02-Sep-09 Kaavian 1
Systems 7
Text Elements
Text elements
The /E in the tag column is used to identify the text as a text element
02-Sep-09 Kaavian 1
Systems 8
Types of Symbols
Symbols
These are Placeholders which represents data, replaced
with their output values.
System symbol
SAPScript supplies values for the system symbols
ex : date, time etc
Program symbol
Data is supplied by the program
Standard symbol
values are defined in the TTDTG table
Text symbol
values From control commands in text editor
02-Sep-09
Types of Symbols
System Symbols
Examples
&DATE&
&ULINE&
&TIME&
02-Sep-09 Kaavian 2
Systems 0
Types of Symbols
Program Symbols
02-Sep-09 Kaavian 2
Systems 1
Types of Symbols
Standard Symbols
Standard symbols are defined in the TTDTG table
Text Symbols
You define the value of a text symbol yourself in the text module
02-Sep-09 Kaavian 2
Systems 2
Commands in Scripts
How to Define Commands ?
Following tags are used in Editor to designate the commands
Tag Meaning
/E - Element Name
/: - Command Line
= - Extended Line
/ - Line Feed
/= - Line feed with Extended Line
* - Default Paragraph
/* - Comment Line
along with other paragraph formats defined.
02-Sep-09 Kaavian 2
Systems 3
Commands in Scripts
SAP Script Commands SAPscript Description
Commands
SAPscript Description
commands Perform, Call ABAP subroutines
Endperform
Address, Formatting of address
Endaddress Insert print control
Print-control character
Bottom, Define footer text in
Endbottom window Protect,
Endprotect Protect from page break
Box, Position, Boxes, Lines and
Size Shading Reset Initialize outline
paragraph
Case, Endcase Case distinction
Set country Country-specific
Value assignment to text formatting
Define symbols Set date Formatting of date fields
mask
Hex, Endhex Hexadecimal values
Set sign Position + / - sign
If, Endif Conditional text output Set time
mask Formatting of time fields
Include Include other texts
Style Change style
New-page Explicit form feed Summing Summing variables
New-window New window main Top Set header text in main
window
02-Sep-09
Commands in Scripts
SAPscript Command : Address … ENDAddress
The command formats an address according to the postal
standards of the destination country defined in the parameter
COUNTRY. The reference fields are described in the structure
ADRS. Both constants and symbols can be assigned to the
parameters.
Syntax
1. /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME]
[INTENSITY]
2. /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]
3. /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]
02-Sep-09
Commands in Scripts
02-Sep-09 Kaavian 2
Systems 7
Structure of Scripts
program rstxexp1.
Retrieves data tables: scustom, sbook, ...
select * from ...
...
Opens layout set call function 'OPEN_FORM'
printing exporting form = ...
... Changes to
call function 'START_FORM' ... another layout set
...
call function 'WRITE_FORM' Prints output on the
exporting element = ... layout set
window = ...
...
call function 'END_FORM' ...
...
call function 'START_FORM' ...
...
call function 'END_FORM' ...
Closes layout set ... R
SAP AG
02-Sep-09 Kaavian 2
Systems 8
Function modules for Scripts
Form Functions
Write_form_lines - Prints text lines from table into specified form window.
End_form - Ends the currently open form and Executes the required
termination processing
02-Sep-09
Function modules for Scripts
SAP AG
02-Sep-09 Kaavian 3
Systems 0
Function modules for Scripts
SAP AG
02-Sep-09 Kaavian 3
Systems 1
Function modules for Scripts
CALL FUNCTION 'WRITE_FORM'
EXPORTING
ELEMENT =
WINDOW =
FUNCTION =
TYPE =
IMPORTING
PENDING_LINES =
EXCEPTIONS
ELEMENT =
FUNCTION =
TYPE =
UNOPENED =
UNSTARTED =
WINDOW =
02-Sep-09 Kaavian 3
Systems 2
Standard SAP Scripts
Invoice RVINVOICE01
02-Sep-09 Kaavian 3
Systems 3
THANK YOU
02-Sep-09 Kaavian
Systems