Академический Документы
Профессиональный Документы
Культура Документы
SAP Script has two parts: one print program and another
layout set.
SAP
Document
Layout set
Form
Template
(Output)
Print
Read Data
Define
SAP Script
Program(ABAP)
Sap Document
Creating Forms
Output
Program(ABAP)
Layout set
Form
Sap Document
Output
SAP Document
Layout set
Form
Program
Printer/Font Configuration
Output program:
Layout set:
Resource
Output Program
ABAP resource
Layout set
ABAP resource
Output determination
configuration
Functional resource
Printer configuration
(Impact,Thermal,Laser)
Basis/ABAP
Font configuration
Testing
Basis/ABAP
End-user/Functional/ABAP resource.
Header
Paragraphs
Character strings
Windows
Pages
Page windows.
S.O#
P.O#
P.O#
Date
Date
Ship-to
Sold-to
Item
Material#
Price
10
Part A
$500
20
Part B
$350
30
Part C
$800
Item
Material#
Price
40
Part D
$250
50
Part E
$400
60
Part F
$350
70
Part G
$150
Total
$2,800
Header
Paragraph
Character strings
Windows
Pages
Page windows
Pages
W indows
Types of windows:
- Main-Special
-VAR Variable
-CONST-Constant
Shows list of all windows defined
for the layout set.
A window can contain hard-coded
texts and the Variables to be
printed in the window.
Template
Fly & Smile
4 Truckee Way
Durango, CO 85650
07/15/98
Turnaround Inc.
145 Apple Valley Ln.
Ithaca, NY 14850
Date
07/20/98
11/11/98
07/21/98
07/28/98
Depart Price
13:15 799.00
6:55 1644.00
6:07 387.80
6:07 398.80
Page 1
USD
USD
USD
USD
W indows
Sender
Date
Adressee
W indow with
body text
Page 2
Page 1
Footer
Window Types
W indow s
Sender
D ate
Ad ressee
W indow w ith
bod y text
Footer
W indow type: V AR
W indow type: V AR
Main Window
7/15/98
Turnaround Inc.
145 Apple Valley Ln.
Ithaca, NY 14850
Flight
Date
Depart
Price
----------------------------------LH 0400 07/28/98
6:07
398.80 USD
LH 0003 08/16/98
15:06
990.00 USD
Yours faithfully
...
Date
07/20/98
11/11/98
12/21/98
12/28/98
Depart
Price
13:15
799.00
6:55 1644.00
21:55
799.00
6:07
398.80
USD
USD
USD
USD
Page 2
Page 1
Pages: Attributes
A ttrib u te s P a ge
P a ge
FIR S T
P age attributes
D e s c rip tio n A d d re s s p a g e
Page
Page 1
NEXT
Next page
D e s c rip tio n A d d re s s P a ge
P a g e c o u n te r
Next page
Page 2
M
Po
ad
ge
e c ou n te r
Mitia
o d lize
e
In
c o u n te r
In
itia
lize
In c re as e ccoouunnteter r
o ru n
te rh a n ge d
KIn
e ecprecas
o uencte
unc
N o n -c h a n g in g c ou n te r
N u m b e rin g
N um b e rin g
NNuummbberin
e rin ggtyp
e
type
OOuutp
g th
tpuut tlelenng
th
NNUUM
P ES
MBBEERRIN
INGG TTYYP
ES
AARRAABBIC
A
ra
b
ic
n
u
m
e
IC A ra b ic n u m era
rals
ls
CCHHAR
Fix
AR
F ixeedd ccha
harac
racte
terr
LE
TEERR Lette
L ETTT
L e tters
rs
RROOM
m aann nnuum
MAANN RRoom
meera
rals
ls
FFoorr eexxaam
mpple
le::
O
u
tp
u
t
le
n
g
th
O
utp
u
t
le
n
gth
4->
O
Ouutpu
tp utt le
lennggth
th->
4
P
a
g
e
1
:
0
00
1
->
P
a
g
e
1
:
0
00
1
P
a
g
e
1
:
0
00
1
-> P a g e 1 : 0 00 1
PPaappeerr tra
trayy cchhooic
icee
UUppppeerc
ee
r as
c as
P rinPtrin
a ttrib
ute u
s te s
t a ttrib
R e s o u rce n a m e
R e s o u rce n a m e
P rin t m o de
P rin t m o d e
OOnne
e -s
le -s
-side
id edd oorr ddoouubble
-side
idedd
pprin
e fa
rintin
tingg dde
fauultlt
SS
SSim
impple
lexx m
moode
de
DD
DDuupple
x
m
o
d
e
le x m o de
TT
TTuum
m bble
le m
moode
de
Forms - Pages
Page format
format
Page
format
Page
Static page
page
sequence
Static
page
sequence
Static
sequence
Page 1
DIN A4
Page 2
LETTER
Next
page
Horizontal
DIN A5
Next page
Top edge
Left edge
Page window
W idth
Page
Height
Alignm
Alignment:
ent:
Standard attributes
Paragraph
HD
Left m argin
1.00
CM
Alignm ent
LEFT
Right m argin
Indent 1st line
1.50
CM
Line spacing
1.00
2.00
CM
No blank lines
Space before
1.50
CM
Page protection
Space after
Left m argin
Header 1
Description
Right m argin
Space before
W indow
LN
Space after
Indentation
BLOCK
BLOCK justified
justified
CENTER
CENTER centered
centered
LEFT
aligned
LEFT
aligned left
left
RIGHT
aligned
right
RIGHT
aligned right
Units
Units of
of
m
easurem
m easurement:
ent:
LN
LN
CM
CM
MM
MM
IN
IN
PT
PT
TW
TW
Lines
Lines
Centim
Centimeters
eters
Millim
eters
Millim eters
Inches
Inches
Points
Points
Tw
Twips
ips
If no font is specified, default font from the layout set set header
will be used.
07/15/98
4 Truckee Way
Durango, CO 85650
Type
Turnaround Inc.
145 Apple Valley Ln.
Ithaca, NY 14850
Depart Price
13:15 799.00 USD
6:55 1644.00 USD
Paragraphs
Standardattributes
String
BF
Boldface
Description
Marker
Barcode
Sym
a
Symbolicnam
bolicnameof
eofa
barcodefrom
barcodefromSA
SAPscript
Pscript
font
fontm
maintenance
aintenance
Protected
Hidden
Superscript
Subscript
On Off Retain A
Adopt
doptheader
header
data
dataor
orparagraph
paragraph
form
format
atsettings
settings
O
Override
verrideheader
header
data
dataor
orparagraph
paragraph
form
format
atsettings
settings
Administrative info
Default settings
Page format: different for different
countries/applications
Never change Lines per inch&
character/inch
Form ...
P age
FIR S T
Address page
W IN D O W 1*
W IN D O W 2*
W indow G raphic
W indow
AD D R E S S
D escription Address
1,60
CM
U pper m argin
1,60
CM
W indow w idth
9,00
CM
CM
D esign / T ext
O ptions
M AIN *
D esign w indow
Layout Set
Test Print
Layout Set
Activating Layout set
Types of Symbols
Depending on the source, the value of a symbol
comes from, they can be categorized as below.
System symbols
Standard symbols
Program symbols
Text symbols
SYSTEM symbols are supplied by SAP scripts. They can be used in all texts.
Following are list of frequently used system symbols.
PROGRAM symbols are place holders for values which come from
the program that calls the layout set. The symbol has to be defined
in the Data dictionary and filled with values by the output program.
Example:&kna1-name1& in the layout set will output the
customers name.
Example:
/: IF &VBRK-VKORG(2)& EQ HG.
/: DEFINE &PREFIX& = Mr..
/: ELSE.
/: DEFINE &PREFIX& = Mrs..
/: ENDIF.
Example:
/: CASE &VBDKL-VKORG(2)&
/: WHEN HG
/: Case# &934 vbdpl-sortkri&
/: WHEN OTHERS
/: Case # &999 vbdpl-sortkri&
/: ENDCASE
The parameter LINES are available for formatting the address. Possible
values are from 1 to n.If it is not possible to format all address data due to
a lack of lines, the data which is entered in the parameter PRIORITY is
omitted.
Syntax:
/:BOTTOM
/:TEXT TEXT
/:TEXT TEXT
/:ENDBOTTOM.
Syntax:
1./: BOX[XPOS][YPOS][WIDTH][HEIGHT][FRAME][INTENSITY]
2/: POSITION[XORIGIN][YORIGIN][WINDOW][PAGE]
3/:SIZE[WIDTH][HEIGHT][WINDOW][PAGE]
/:BOX[XPOS][YPOS][WIDTH][HEIGHT][FRAME][INTENSITY]
This command draws a box of the specified size at the specified position. For
each parameter(XPOS,YPOS,WIDTH,HEIGHT ,and FRAME), both a
measurement and a unit of measure must be specified. The INTENSITY
parameter should be entered as a percentage between 0 and 100.
XPOS,YPOS specify the upper left corner of the box, relative to POSITION
command values.
Default is the values specified in the POSITION command.
Window1
Form
Window1
[/ : POSITION WINDOW ]
[/ : SIZE WIDTH 2 CM HEIGHT +40 TW]
/ : BOX FRAME 10 TW
Window2
Window2
/ : BOX INTENSITY 10
Window3
Window3
/ : BOX HEIGHT 0 CM FRAME 20 TW
/ : BOX WIDTH 0 CM FRAME 20 TW
Form
/: PERFORM <form> IN PROGRAM <prog>
/: USING &invar1&
/: USING &invar2&
.
/: CHANGING &outvar1&
..
/: ENDPERFORM
IN_TAB
structure ITCSY
NAME
VALUE
invar1
...
invar2
...
REPORT <prog>.
FORM <form> TABLES in_tab STRUCTURE itcsy
out_tab STRUCTURE itcsy.
. . .
ENDFORM.
ABAP
report
ABAP
Dictionary
Example:
INCLUDE&VBDPL-TDNAME& OBJECT VBBP ID 0001
PARAGRAPH IT
INCLUDE SD_TEXT OBJECT TEXT ID SDVD PARAGRAPH HT
There are two different types of text handled in SAP script. One is
APPLICATION TEXT and other one is STANDARD TEXT.
TEXT ID
0002
Sales document header note 1.
0003
Sales document header note 2.
Output Program
Overview(Se38 Transaction)
Program retrieves the data to be printed in a Layout
set.
Structure of Programs
- Stand alone
-Transaction Triggered
Communication in between program and layout set is
done via execution of function calls and communication
structures.
Execution sequence of function calls
A layout set must be opened before being able to
output data.
Data can be transfer as often as required.
At end layout set has to be closed.
Retrieves data
O pens form
printing
Closes form
printing
program rstxexp1.
tables: scustom , sbook, ...
select * from ...
...
call function 'O PEN_FO RM'
exporting form = ...
...
call function 'START_FO RM ' ...
...
call function 'W RITE_FO RM '
exporting elem ent = ...
w indow = ...
...
call function 'END_FO RM ' ...
...
call function 'START_FO RM ' ...
...
call function 'END_FO RM ' ...
...
call function 'CLO SE_FO RM ' ...
Changes to
another form
Prints output
on form
ITEM_LINE
Barcode Printing
Logo Printing
1. Built a Logo. This file can be a bit map or windows meta file.
2. Convert the Logo to a TIFF (extension TIF) file.
3. Use program RSTXLDMC to convert the TIF file to a standard
text.
4. Print this statement text via SAP script INCUDE command.
e.g. /: INCLUDE ZHEX-IBMLOGO-PCL OBJECT TEXT ID ST