Académique Documents
Professionnel Documents
Culture Documents
Jul 2012
Sawyer Peng
In SAP script, a layout set describes the layout of individual print pages &
uses text elements to supply definable output blocks, which the print program
can call.
A layout set can be defined as a page design for a document
In
fo
sy
s Usually a SAPscript form consists of the following objects:
Te Header Data
ch
no Paragraph and Character Formats
lo Windows and Text Elements
gi
Pages
es
Li Page Windows
mi
te
d
Layout Set
Header Data
Header data is used for information and control of SAP printing. The header data comprises of 2
parts
Device Independent
Start page Tells the print program which page should be printed first.
Default paragraph Tells the print program, the default paragraph to be selected if no
paragraph is mentioned in text elements.
Language Attributes Displays the original language, current language and the list of
languages into which the form can be translated.
In Tab Stop A grid set to a specified interval in window. This works for paragraphs for which
fo tabs are not specified.
sy
s Device Dependent
Te Page format Specifies format in which the form needs to be printed. E.g. Dina4, US Letter
ch etc. The page format is determined from spool administration table with transaction SPAD.
no
Orientation Depends on the page format selected. E.g.. Landscape and Portrait.
lo
gi Lines per inch
es Characters per inch
Li Font attributes Default font for the form
mi
te
d
Layout Set
Paragraph and Character Formats
Paragraphs are formatted using formats and their corresponding attributes.
Tabs
The tab feed in a paragraph is controlled by tab positions. The tab
positions defined can have MM, CM, LN etc as unit of measure.
You can define as many tab positions as you require for each
In
fo
paragraph format. Text can be aligned in different ways.
sy CENTER, LEFT or RIGHT.
s
Te
ch
no Character formats
lo
gi
Character formats allow to format entire blocks of text within a
es paragraph.
Li
mi
te
d
Layout Set
Windows
Windows are individual text areas (header address, date, footer) in a page
To combine the information contained in a document into certain groups & make each
group appear on the printed page in an individual area, such a group known as window.
To refer to windows via programming interface, each window must have a unique name.
Window types
1. MAIN Window
In Window in which the continuous text is printed. This window can extend over many
fo pages. If the text fills one page, the output continues in the window of next and
sy subsequent pages, as long as MAIN has been defined for these pages.
s 2. VAR Window
Te Window with the variable contents. The text content can vary on each page in which
ch the window is positioned. Variable windows are formatted for each page.
no
lo 3. CONST Window
gi Window with constant contents which is formatted only once.
es 4. GRAPH Window - Grid Screen.
Li
mi
te
d
Layout Set
Text Elements
You can define text elements (window texts) for each window. The print
program accesses the text elements by name, then formats them & prints
them in the respective window. The paragraph and the character formats
used must be defined in the form.
Using Boxes, Lines, and Shading
SAP script provides text commands for using boxes (or frames), lines,
In Print attributes
fo
sy Resource name : You specify that paper for this page should be taken from particular
s paper tray at the printer. Eg TRY01 ( select paper from first tray)
Te Print Mode : You can specify single /double side printing for a page.
ch Page Counter
no
lo Mode Specify the mode in which page numbering needs to be done.
gi 1. INC - Increments by 1
es 2. HOLD Counter remains unchanged
Li
mi 3. START Sets the counter to 1
te Numbering Type The format in which page numbering is to be done.
d ARABIC , ROMAN or LETTER
Layout Set
Page Windows
While defining windows and pages, you do not determine the position
and spacing of the texts to be output.
In FORM Painter
fo
sy - Form Painter is used to design layout of your forms,
s
Te
- To switch to graphical form painter , Go To Menu bar, select
ch settings.
no PC Editor
lo
gi - PC Editor is used to edit and create text in SAP scripts.
es
Li
mi
te
d
Control Commands
The purpose of Control Commands is to allow the control of output formatting. These
Control commands are not interpreted by the SAP script editor, but are passed through to the
SAP script Composer for processing. This includes, for example, line and page formatting,
the formatting of text according to the paragraph & character formats specified.
Syntax for control commands
Enter /: in the paragraph format
Enter the command in the text line. The command entered should occupy only one line.
In
fo
sy
s
Te
ch
no Source: Screen Shot from SAP ECC 6.0
lo
gi
es
Li
mi
te
d
FORM Control
The selection of the data for the document is done through print
program.
The print program call either all or some of the form control functions
to execute the script
OPEN_FORM (Mandatory) Opens the layout set output
In
fo START_FORM (Optional) Starts a new layout set
sy
s
Te WRITE_FORM (Mandatory) Calls a layout set element
ch
no
lo END_FORM (Optional) Ends the current layout set
gi
es
Li
mi
te
d
Translation for Layout Set
To create layout set in different languages use transaction
SE63.
In
fo
sy
s
Te
Syntax for calling the standard text from the script
ch
no
lo
gi
es
Li Source: Screen Shot from SAP ECC 6.0
mi
te
d
Copying Scripts across clients
Unlike programs, changes done to SAP script in one client will not be
reflected in other clients
In For copying script from one client to another, go to SE71 and use
fo Copy from Client option available under Utilities menu or import the
sy
s
transport request, in which the script is saved, from the original client
Te using the transaction SCC1 (SCC1 is a transaction used to copy
ch transport request, having client dependent objects, from one client to
no another)
lo
gi
es
Li
mi
te
d
Transporting Scripts
In the task add an entry with R3TR for Program ID, FORM
for Object Type and Script Name for Object name
In
fo
sy The script is now included in a transport request, which
s
Te can be later used for transporting into other environments
ch
no
lo
gi
es
Li
mi
te
d
Debug SAP Script
You can debug a SAP Script: Use Tools -> Word Processing -> Layout Set.
Enter name of layout set & then Utilities - Activate Debugger.
It is of no consequence that which layout set you enter when selecting the
SAP script debugger. (Menu path: Tools->Word processing -> Forms,
Utilities -> Activate Debugger) The next layout set called will invoke
debugger. This is quite handy when verifying which layout set is being called
(Verifying the customizing settings).
In
fo
sy Another way to set the SAP Script debugger is to run the program
s RSTXDBUG.
Te
ch
no Transaction SE71
lo
gi
es (Screenshot in next slide)
Li
mi
te
d
Debug SAP Script
In
fo
sy
s
Te
ch
no
lo
gi
es
Li
mi Source: Screen Shot from SAP ECC 6.0
te
d
Things to remember while changing SAP Script
s
Te
ch
no
lo
gi
es
Li
mi
te
d
Demo
Its demo time Over to R/3
In
fo
sy
s
Te
ch
no
lo
gi
es
Li
mi
te
d
In
fo
sy
s
Te
ch
no
lo
Thank You.
gi
es
Li
mi
te
d