Professional Documents
Culture Documents
4 SAP Script
4 SAP Script
SAP Scripts I
Agenda
About Forms
Header
Page Layout
Windows
Pages
Page Windows
Paragraph Format
Character Format
Documentation
Different Forms
Form 1
Invoice
Form 2
Document
Form 3
Dear
Processing Sequence
SAP DB
Form
Document
Invoice
Application transaction
Print program
Invoice
Composer
SAP Script
A form of the graphical
Form Painter consists of
Header data
Page layout
Paragraph format
Character format
Documentation
SE71
Header
ata
Header
ddata
Administrative data
Administration information
Language attributes
Basicsettings
Set up page
Default values fortext
formatting
Set uppage
Spool
z Page format
z First page
z Orientation
z Font family
Font
maintenance zFont size
Portrait format
Landscape format
z Lines/inch
z Characters/inch
z Default paragraph
z Bold
z Italic
Form
definition
z Underlined
z Spacing
z Thickness
z Intensity
alphanumeric
Form Painter
Header data
graphical
Header data
Windows
Pages
Layout
Page windows
Paragraph formats
Paragraph formats
Character formats
Character formats
Pages
Windows
Window Types
Windows
Sender
Date
Adressee
Window type
:
VAR
Types of windows
Main Window
Window with
body text
Window type
:
MAIN
Variable Window
Footer
Const Window
SAP AG 1999
Window type
: VAR
Page Windows
Topedge
Topedge
Left edge
Left margin
Upper margin
Page window
Window width
Window height
Width
Page
Height
Sender
and
Form:
Page windows
Date
Adressee
Window with
body text
Page 2
Page 1
Footer
Pages
Define at least one page for every form
Designate a "first" page in the form header
Inform the system which page is to be used after
reaching the end of the first page
Pages - Attributes
Mode
INC
Increases the counter by 1
HOLD Counter remains unchanged
START Sets the counter to 1
NUMBERING TYPES
ARABICArabicnumerals
CHAR Fixed character
LETTERLetters
ROMAN Romannumerals
Papertray choice
S
S
D
D
TT
Simplex
Simplex mode
mode
Duplex
Duplex mode
mode
Tumble
Tumble mode
mode
Character formats
Marker
Bar code
Protected
Hidden
Superscript/subscript
Paragraph formats
Attributes
Standard
Font
Tabs
Outline
Paragraph formats
Standard attributes
Description
Left or right margin
Indent first line
Space before and space after
Alignment
Line spacing
No blank lines
Page protection
Next paragraph same page
Alignment:
Alignment:
Standard attributes
Paragraph
HD
Left margin
1.00
CM
Alignment
LEFT
CM
Line spacing
1.00
CM
No blank lines
Space before
CM
Page protection
Space after
Left margin
1.50
Header 1
Description
Right margin
Space before
Window
LN
Space after
Indentation
BLOCK
BLOCK justified
justified
CENTER
CENTERcentered
centered
LEFT
LEFT aligned
alignedleft
left
RIGHT
RIGHT aligned
alignedright
right
Units
Unitsof
of
measurement:
measurement:
LN
LN Lines
Lines
CM
CM Centimeters
Centimeters
MM
MM Millimeters
Millimeters
IN
IN Inches
Inches
PT
PT Points
Points
TW
TW Twips
Twips
Paragraph formats
Font attributes - attributes such as font family, size, bold, italic etc.
Right margin
Left margin
Dear Mr.
. Smythe
,
Space after
Space before
Indent
Window
Page
FIRST
Address page
WINDOW1*
WINDOW2*
Window Graphic
Window
ADDRESS
Description Address
Main window Administrative window
Default paragraph
1,60
CM
CM
CM
Left margin
Design / Text
CM
Options
MAIN*
Design window
Editor
Enter longtexts
List ofallwindows
WINDOW_1
MAIN
...
Day 4
SAP Scripts II
Agenda
Text Elements
Control Commands
Symbols System, Program, Standard, Text
Function Modules
Text Elements
Text elements are defined for each window. On the
Form: choose Edit Text elements.
In the layout of a text element, we can use the paragraph
and character formats defined in the form.
Example
/E ITEM_LINE
IL &VBDPA-POSNR&,,&VBDPA-MATNR
/
&'Customerarticlenumber 'VBDPA-IDNKD'
/: CHANGING &VAR2&
/: ENDPERFORM
ADDRESS Command
Formatting Addresses
/: ADDRESS [DELIVERY] [TYPE t] [PARAGRAPH a]
[PRIORITY p] [LINES l]
/: TITLE title
.
/: STREET street name HOUSE house number
.
/: ENDADDRESS
System Symbols
DATE
DAY
NAME_OF_DAY
MONTH
NAME_OF_MONTH
YEAR
TIME
HOURS
MINUTES
SECONDS
PAGE
NEXTPAGE
DEVICE
SPACE
ULINE
VLINE
Date
Day
Name of day
Month
Name of month
Year
Time
Hours
Minutes
Seconds
Page number
Number of next page
Output device
Blank space
Underline
Vertical line
Standard Symbols
Table TTDTG
Text Symbols
DEFINE &symbol& =
value
Program Symbols
KNA1
ABAP
TABLES KNA1.
DATA:
COUNTRY LIKE ...
* Data selection
...
* Start of form printing
...
Form
&KNA1 - NAME1&
&KNA1 - STRAS&
&KNA1 - PSTLZ&&KNA1 - ORT01&
&COUNTRY&
NAME1
Jane Smith
PSTLZ
80801
ORT01
Capital City, CA
STRAS
81 Third Ave
Jane Smith
81 Third Ave.
Capital City, CA 80801
USA
Program symbols
.....
SPFLI
SFLIGHT
CRTX
Programm symbols
Program
Symbolsymbols
definition
.....
Symbol definition
Print programfor form
Print
for formDescription
Printprograms
programm
Print report
RIPRAT01
RIPRAT01
.....
DDIC fields
Short description
.....
.....
Global data
Symbol definition
REPORT riprat01.
TABLES: spfli, sflight, ...
DATA: sums LIKE ...
.....
Form:
RVINVOICE01
Window: FOOTER
Example :
/: SET TIME MASK = HH : MM
/: SET DATE MASK = DD.MMMM YYYY
/: SET COUNTRY US
Form
Window1
[/ : POSITION WINDOW]
[/ : SIZE WIDTH 2 CMHEIGHT +40 TW]
/ : BOX FRAME 10 TW
Window2
Window2
/ : BOX INTENSITY 10
Window3
Window3
/ : BOX HEIGHT 0 CMFRAME 20 TW
/ : BOX WIDTH 0 CMFRAME 20 TW
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
WRITE_FORM
CLOSE_FORM
START_FORM
Database
READ_TEXT
Print program
report jh_form_01.
Application
DB
data
Form
ABAP
program
tables: scustom.
select * from scustom...
......
call function 'OPEN_FORM'
......
call function 'START_FORM'
......
call function 'WRITE_FORM'
......
J. Smith
7 Second Ave.
47110 XYZ City
Composer
Place, Date
Invoice No.4
123-45-556-678
Art.No.
00345
00379
02378
00458
Total
Price
200.150.50.300.700.XYZ Bank
Acct. No.: 0815 4711
Bank No.: 000000000
Retrieves data
Opens form
printing
Closes form
printing
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' ...
Changes to
another form
Prints output
on form
Main Windows
TOP
BODY
MAIN
BOTTOM
Art.No.
00345
MAIN
Price
200.-
WRITE_FORM
element = 'ITEM_LINE'
window= 'MAIN'
/E ITEM_HEADER
Art.No.,,Price
/E ITEM_LINE
&vbdpa-matnr&,,
&vbdpa-netpr&
Art.No.
00345
00379
MAIN
Price
200.150.-
Output heading to
current page
Write heading in
TOParea
Art.No.
00345
00379
02378
00458
Total
INFO
INFO
INFOTEXT1
INFOTEXT1
INFOTEXT2
Price
200.150.50.300.700.-
WRITE_FORM
element = 'INFOTEXT2'
function = 'APPEND'
window = 'INFO'
Art.No.
00345
00379
02378
00458
Total
Price
200.150.50.300.700.-
. . . . +. . . . 1. . . . +. . . . 2. . . . +. . . . 3. . . . +. . . . 4. . . . +. . . . 5. . . . +. . . . 6. . . . +
CU This is an outline:
G1 First level
G2 Second level
G3 Third level
F.... Description
G3
Outline level 3
AS Standard paragraph
B
Bold
----------MYSTYLE---------System-------------Lines
1 - 1/ 1 ----------CU Italic, underlined
F4
G1
Outline level 1
G2
Outline level 2
G3
Outline level 3
This is an outline:
=> First level
=> Second level
=> Third level
Thank You