Professional Documents
Culture Documents
Agenda
Chapter 1: Introduction
Chapter 2: Layout Set
Chapter 3: Output Program
Chapter 4: Configuration
Chapter 5: Printing
Chapter 6: SAP Script Utilities
WM Picking list
Packing list
Labels
Introduction
How SAP Script Works (Big Picture)
Creating Reports
Output
SAP
SAP Report
Program
Document
Document (ABAP)
Creating Forms
Output
SAP
SAP Program Layout set Form
Document
Document (ABAP)
Introduction
Components of SAP Script
Output determination configuration
Component Resource
Menu:
Tools > Word processing > Layout set
• Header
• Paragraphs
• Character strings
• Windows
• Pages
• Page windows
IMG
Layout Set Elements
Components
S.O. # S.O. #
P.O. # P.O. #
Date Date
•Contains all
information needed to
format a paragraph of
text
•Font
•Tabs
Layout Set Elements
Paragraphs
Font
Layout Set Elements
Character Strings
•A default character
style is specified at the
paragraph level.
•Can be used within
paragraph to override
the default settings for a
few words within the
paragraph.
Layout Set Elements
Header
•Administrative info
•Default settings
•Page format: different
for different countries /
applications
•Never change ‘Lines
per inch’ &
‘Characters/inch’
Layout Set
•Menu: Utility > Test
Test Print
print
•Shows the layout
design of the layout set.
•Test printing does not
trigger the output
program to interface
with the layout set.
•It simply shows the
maximum length of
each of the fields being
Layout Set
•Menu: Layout set >
Activating Layout Set
Activate
•Must activate the
layout set any time a
change has been made
Layout Set
Symbol
• Symbols are placeholders for values during print
formatting.
Examples :
&VBDPR-MATNR+2(4)&
&VBDKL-BRGEW(I13)&
&’Currency : ’VBDKA-WAERK&
&’Case # &PREFIX&’VBDPR-BSTNK+2(8)’00’&
Layout Set
Commands
Example :
/: IF &VBRK-VKORG(2)& EQ ‘HG’.
/: DEFINE &PREFIX& = ‘Mr.’.
/: ELSE.
/: DEFINE &PREFIX& = ‘Mrs.’.
/: ENDIF.
.
/ &PREFIX&
Layout Set
Commands
• CASE ..ENDCASE command can also be used in the
layout set to control the flow of logic.
Example :
/: CASE &VBDKL-VKORG(2)&
/: WHEN ‘HG’
/ Case # &‘934’VBDPL-SORTKRI&
/: WHEN OTHERS
/ Case # &‘999’VBDPL-SORTKRI&
/: ENDCASE
Layout Set
Commands
Syntax :
/: PROTECT
/: ENDPROTECT
Layout Set
Commands
Syntax :
DD Day
MM Month in figures
MMMM Month in words
YY Year (2 digits)
YYYY Year (4 digits)
HH Hours
MM Minutes
SS Seconds
Syntax :
Example :
• There are two different types of text handled in SAPscript. One is APPLICATION TEXT and other one is
STANDARD TEXT.
Layout Set
Commands
• The ‘name’ in the include command is always the document no for APPLICATION TEXT and the name of standard text for STANDARD TEXT.
• Example : vbdka-tdname, vbdkl-tdname, vbdkr-tdname.
• The text ‘object’ specifies the environment to which a text belongs.
TEXT NAME TEXT ORIGIN
VBBK Sales document Header Text
KNVV Customer Master SD Text
VBKA Contacts General Text
VTTK Shipment Header Text
The ‘object’ is always ‘TEXT’ for STANDARD TEXT.
Layout Set
Commands
EXPORTING FORM = ..
LANGUAGE = ..
DEVICE = ..
OPTIONS = ..
DIALOG = ..
APPLICATION = ..
IMPORTING LANGUAGE = ..
EXCEPTIONS …..
Output Program
Function Call
•OPEN_FORM opens layout set for Printing .
•Parameters
• LANGUAGE defines the layout set language version .
• Possible Exceptions :
EXPORTING ELEMENT = ..
TYPE = ..
FUNCTION = ..
WINDOW = ..
EXCEPTIONS …..
Output Program
Function Call
•WRITE_FORM transfer the data to layout.
•Parameters
• Explicitly specify ELEMENT and WINDOW name to
output data from a specific ELEMENT.
• OTHER window
• SET = Delete old contents and output new text.
• APPEND = Append to preceding output.
• DELETE = Delete the specified text element.
• Default is SET
Output Program
Function Call
• Possible Exceptions :
• Layout set must be closed before being able to output the data
on the screen or printer.
• Possible exceptions :
• Possible exceptions :
EXPORTING OBJECT = ..
NAME = ..
ID = ..
LANGUAGE = ..
IMPORTING HEADER = ..
TABLES LINES = ..
EXCEPTIONS …..
Output Program
Function Call
•An application text can be read from text file. HEADER
and LINES contain header and text information after
successful execution.
•Work area for header must be defined as a field string.
DATA BEGIN OF HEADER
INCLUDE STRUCTURE THEAD
DATA END OF HEADER
FORM EntryA FORM EntryB FORM EntryC •Helps to consolidate logic variation in one program
If Internt’l = X
….
elseif Interco = X
…
elseif Internal = X
….
Endif
Configuration
•Purchasing Menu: MM > Purchasing > Messages > Output
Linking Layout set to Program: MM
control > Output Module
control > Define output control for the purchase
order
•Inventory Management Menu: MM > IM > Output
determination > Assign layout sets and programs
•Warehouse Management Menu: MM > WM > Activities > Define
print control
Configuration
Linking Layout set to Program: FI Module
•Finance Menu: FI > AR & AP > Customer (Vendor)
accounts > Line items > Correspondence > Carry out
check or correspondence settings >Define form names
for printing correspondence
•Check Printing Menu: FI > AR & AP > Business
transaction > Outgoing payments > Automatic outgoing
payments > Payment method / Bank selection >
Configure payment program > Payment method > In
company code > “Double click on the country” >
“Double click on check” > Environment > Form data
Printing SAP Script Forms
What? Where? When? How?
• Where should it be printed?
• How many copied should be printed?
• When should it be printed?
• What medium should it be “printed” on?
• What types of status should be captured?
Printing SAP Script Forms
Output Type
•Menu: Sales order >
Header > Output
•Output Type defines
“when” and to “where”
to print the form.
•“When” -
Communication method
•“Where” - Further data
•“How” - Medium
Printing SAP Script Forms
Output Type - “When”
– 3 Explicit request
• On demand
– 4 Immediately
• After an update
Printing SAP Script Forms
Output Type - “Where”