SlideShare a Scribd company logo
SAP Scripts
Agenda
Chapter 1: Introduction
Chapter 2: Layout Set
Chapter 3: Output Program
Chapter 4: Configuration
Chapter 5: Printing
Chapter 6: SAP Script Utilities
© SAP 2008 / Page 2
Introduction
What is SAP Script ?
• SAP Script is used to print forms.
• Form Vs. Reports
• Forms look “nicer”.
• Forms can have graphic elements.
• Forms can be event-triggered.
• Examples of forms:
SD Inquiry
Order confirmation
Delivery note
Invoice
PU Purchasing req.
Purchase order
Contract
IM Goods receipt
Goods issue
FI Customer statement
Checks
WM Picking list
Packing list
Labels
Introduction
How SAP Script Works (Big Picture)
•SAP documents are printed using forms.
•Forms are defined and formatted using layout sets.
•SAP script is a tool that SAP provides for creating layout sets.
SAP
Document
SAP
Document
Form
(Output)
Layout set
(Template)
Read Data Print
SAP Script
Define• Sales order
• Billing document
• Purchase order
• etc
• Order confirmation
• Invoice
• Purchase order
• etc
Introduction
Creating Report Vs. Form
SAP
Document
SAP
Document
Output
Program
(ABAP)
Output
Program
(ABAP)
Report
SAP
Document
SAP
Document
Output
Program
(ABAP)
Output
Program
(ABAP)
Layout setLayout set Form
Creating Reports
Creating Forms
Introduction
Components of SAP Script
SAP
Document
SAP
Document
Output
Program
Output
Program
Layout setLayout set Form
Output determination configuration
Printer / Font Configuration
• Output program: Extracts data from SAP data dictionary
• Layout set: Formats the extracted data
• Output determination configuration: Configures triggering event,timing/destination
• Printer / Font configuration: Configures impact / laser printer, bar code,logo
Introduction
SAP Script Development
Component Resource
Output program ABAP resource
Layout set ABAP resource
Output determination
configuration
Functional resource
Printer configuration
(Impact, Thermal, Laser)
Basis / ABAP
Font configuraiton Basis / ABAP
Testing End-user / Functional /
ABAP resrouce
Layout Set
Some Facts
•Client specific (client-dependent)
•Language specific
•Note: If the layout set is not available in the client in which the
document is being printed, then the SAPscript checks for the
style or layout set in client 000.
•Recommendation: Keep only one copy of the layout set in one
client.
Layout Set Elements
Initial Screen
• Header
• Paragraphs
• Character strings
• Windows
• Pages
• Page windows
IMG
Menu:
Tools > Word processing > Layout set
Layout Set Elements
Components
•Header: General info and default settings•Paragraphs: Font and tab info•Character strings: Font info within a paragraph•Windows: Description of areas on the pages•Pages: Name of the pages with page flow info•Page windows: Position and size of the windows on the pages
Item Material # Price
Item Material # PriceSold-to Ship-to
S.O. #
P.O. #
Date
S.O. #
P.O. #
Date
10 Part A $500
20 Part B $350
30 Part C $800
40 Part D $250
50 Part E $400
60 Part F $350
70 Part G $150
Total $2,800
Layout Set Elements
Page Windows
•List of all the windows on the page with
coordinates.
•The coordinates are given by the upper left-hand
corner and the width and length.
•Note: A window which should appear on a page
must first be defined under ”Windows” and then
be added to the page windows.
Layout Set Elements
Windows•Type 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.
Layout Set Elements
Windows - Text element•A window can contain hard-coded texts and the variables to be
printed in the window.
•Tag column: Specifies format of the text
•Text line column: Contains the actual content of the window.
•Special characters
– * Default paragraph
– /: Command line
– /* Comment line
– /E Text element
Layout Set Elements
Windows - Text element
•Text element always starts with the line /E and
continues to the next text element (/E).
•It is the output program (not the layout set) that
controls whether or not to print a text element (I.e.
block of texts surrounded by /E) and the order in which
they are printed.
•‘,,’ Tabs in a paragraph
•‘&&’ Variables
Layout Set Elements
Pages
•Shows the page flow
information.
•Must define at least
two pages.
•The first page specifies
the next page.
•The last page
recursively defines the
next page as itself.
Layout Set Elements
Paragraphs
•Contains all
information needed to
format a paragraph of
text
•Font
•Tabs
Layout Set Elements
Paragraphs
•Specify tabs to create columns for line items
•If no font is specified, default font from the layout set
header will be used
Tabs
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
Test Print
•Menu: Utility > Test
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
Activating Layout Set
•Menu: 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.
• Symbols are identified by a name which is included
in ‘&’ characters. Example : &VBAK-VBELN&.
Symbols are case sensitive.
• Depending on the source, the value of a symbol
comes from, they can be categorized as follows:
• SYSTEM symbols
• PROGRAM symbols
• STANDARD symbols
• TEXT symbols
Layout Set
Symbol
• SYSTEM symbols are supplied by SAPscripts. They can be used in all
texts. Following are list of frequently used system symbols.
&DATE& = Current date
&DAY& = Day
&MONTH& = Month
&YEAR& = Year
&TIME& = Time of day
&HOURS& = Hours
&MINUTES& = Minutes
&SECONDS& = Seconds
&PAGE& = Page
&NEXTPAGE& = Page number of next page
&SPACE& = Blanks
&ULINE& = Underline
&VLINE& = Vertical line
&NAME_OF_MONTH& = Name of month
Layout Set
Symbol
• PROGRAM symbols are placeholders 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 Customer’s name.
• STANDARD symbol are maintained centrally in one
table (TTDTG) for all SAPscript users.
• Values of TEXT symbol are created by assignment
via DEFINE statement.
Example : /: DEFINE &CASENUM& = ‘1234’.
Layout Set
Symbol
• FORMATTING of the symbol can be done in following different ways:
&SYMBOL+ 4& = Off set
&SYMBOL(5)& = Length
&SYMBOL(I)& = If the symbol is initial, output nothing
&SYMBOL(Z)& = Suppress leading zeros
&SYMBOL(C)& = Compress blanks
&SYMBOL(R)& = Right-justified output
&SYMBOL(S)& = Suppress +/- sign
&SYMBOL(5,2)& = Decimal place formatting
&SYMBOL(E3)& = Exponential notation
&’text1’SYMBOL’text2’& = Concatenation of symbol and text
Examples :
&VBDPR-MATNR+2(4)&
&VBDKL-BRGEW(I13)&
&’Currency : ’VBDKA-WAERK&
&’Case # &PREFIX&’VBDPR-BSTNK+2(8)’00’&
Layout Set
Commands
• IF..ELSE..ENDIF can be used within the layout set to
control the flow of logic.
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
• Using the command NEW-PAGE, a page -break can
be made in SAPscript at any position before the end
of the page defined in the layout set. The next page
can be specified explicitly.
Syntax: /: NEW-PAGE [PAGE]
• A page break within a paragraph can be prevented
by using this command PROTECT..ENDPROTECT.
Syntax :
/: PROTECT
text text text
/: ENDPROTECT
Layout Set
Commands
• The command ADDRESS…ENDADDRES formats an address according
to the postal standards of the country of destination which is defined
in the parameter COUNTRY.
Syntax :
/: ADDRESS DELIVERY PARAGRAPH paragraph
[ PRIORITY prio LINES lines ]
/: TITLE form of address
/: NAME name1[, name2[, name3[,name4]]]
/: STREET strno
/: POBOX pobox [CODE code]
/: POSTCODE postal code
/: CITY city1[,city2]
/: REGION district
/: COUNTRY recipient country
/: FORMCOUNTRY sender country
/: ENDADDRESS
Layout Set
Commands
• Parameter PRIORITY defines which address lines may
be omitted, if necessary. The possible values are as
follows :
A Form of address
B Mandatory blank line 1
C Mandatory blank line 2
2 Name2
3 Name3
4 Name4
L Country name
S Street line
O City line
• 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.
Layout Set
Commands
• The date can be formatted using the command SET
DATE MASK = ‘…’. After formatting all date fields are
output as specified. The available formats for day,
month and year are following.
DD Day
MM Month in figures
MMMM Month in words
YY Year (2 digits)
YYYY Year (4 digits)
Example : /: SET DATE MASK = ‘MM/DD/YYYY’
• The formatting can be reset at any point of time by
/: SET DATE MASK = ‘’. Formatting is then carried
out as defined by the System.
Layout Set
Commands
• The time can be formatted using the command SET
TIME MASK = ‘…’. After formatting all time fields are
output as specified. The available formats for hours,
minutes and seconds are following.
HH Hours
MM Minutes
SS Seconds
Example /: SET TIME MASK = ‘HH:MM:SS’
• The formatting can be reset at any point of time by
/: SET TIME MASK = ‘’. Formatting is then carried
out as defined by the System.
Layout Set
Commands
• In SAPscript, any text can be included at a certain position in the
document using INCLUDE command.
Syntax :
INCLUDE name OBJECT object ID identifier PARAGRAPH paragraph LANGUAGE language
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 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
• Several different text IDs can belong to one object .
• TEXT ID
0002 Sales document header note1.
0003 Sales document header note2.
Layout Set
Barcode Printing
• To print barcode , follow the steps below :
• Select / Create a barcode font in SAP.
• Create a character string and include the barcode
with it.
• The data need to printed as barcode should be
attributed via the character string.
Layout Set
Logo Printing – using Standard Text
• To print a Logo, follow the steps below :
• Build a Logo. This file can be a bit map or windows
meta file.
• Convert the Logo to a TIFF ( extension TIF ) file.
• Use program RSTXLDMC to convert the TIF file to a
standard text.
Layout Set
Logo Printing – using GRAPHICS
object• To print a logo using a GRAPHICS object (SAP
4.6B onwards)
• Build a Logo. This file can be a bit map.
• Import the logo as a GRAPHICS object using
transaction SE78 (Function key F5).
• Print this GRAPHICS object via SAPscript INCLUDE
command.
• e.g. /: INCLUDE ZHEX-IBMLOGO-BMP OBJECT GRAPHICS ID BCOL
Output Program
Overview
• 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
Output Program
Function Call
• General Function calls:
• CALL FUNCTION ‘ OPEN_FORM ’.
• CALL FUNCTION ‘ WRITE_FORM ’.
• CALL FUNCTION ‘ CLOSE_FORM ’.
• CALL FUNCTION ‘ CONTROL_FORM ’.
• CALL FUNCTION ‘ READ_TEXT ’.
Output Program
Function Call•CALL FUNCTION ‘ OPEN_FORM ’ = ..
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 .
• DEVICE specifies the output device type .
( Example : PRINTER, SCREEN, TELEX, TELEFAX)
• OPTIONS can be used to specify the print preview.
• DIALOG can request a pop-up screen on which user
can enter spool information such as printer name.
Output Program
Function Call
• Possible Exceptions :
• DEVICE = Device type invalid
• FORM = Layout set does not exist
• OPTIONS = Options invalid
• UNCLOSED = A layout set is still active
Output Program
Function Call
• CALL FUNCTION ‘ WRITE_FORM ’
= ..
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.
• No specification of WINDOW name is necessary for
MAIN window.
• TYPE defines area of the MAIN window, where data
need to written. Possible values :
• TOP = MAIN window header.
• BOTTOM = MAIN window footer.
• BODY = MAIN window normal
output area (Default).
Output Program
Function Call
•FUNCTION defines how the data specified in
the text element is to be written in the
respective WINDOW.
• MAIN window
• SET = Append to preceding output.
• APPEND= Identical with SET.
• DELETE = Ineffective.
• 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 :
• ELEMENT = Text does not exist.
• FUNCTION = Function is invalid.
• TYPE = Window area is invalid.
• WINDOW = Window does not exist.
• UNOPENED = Layout set printing not opened.
Output Program
Function Call
• CALL FUNCTION ‘ CLOSE_FORM ’ = ..
EXPORTING RESULT = .. EXCEPTIONS…..
• Layout set opened with function ‘OPEN_FORM’ is closed.
• Layout set must be closed before being able to output the data
on the screen or printer.
• Possible exceptions :
• UNOPENED = No open layout set.
Output Program
Function Call
• CALL FUNCTION ‘ CONTROL_FORM ’ = ..
EXPORTING COMMAND = .. EXCEPTIONS…..
• ‘CONTROL_FORM’ can execute SAPscript control commands.
• Example : PROTECT … ENDPROTECT.
• Parameter COMMAND accept the SAPscript command.
• Possible exceptions :
• UNOPENED = Layout set printing has not
been opened.
• UNSTARTED = No layout set opened
Output Program
Function Call
• CALL FUNCTION ‘ READ_TEXT ’ = ..
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
•Work area for text lines must be defined as an internal
table.
DATA BEGIN OF LINES OCCURS ...
INCLUDE STRUCTURE TLINE
DATA END OF HEADER
Output Program
Function Call
• Possible Exceptions :
• ID = Text ID invalid.
• LANGUAGE = Language invalid.
• NAME = Text name invalid.
• NOT_FOUND = Text not found.
• OBJECT = Text object invalid.
• REFERENCE_CHECK = Reference sequence interrupted.
Output Program
Function Call•Document ( e.g. Sales Order ) generation
programs can also be triggered via business
transaction.
•Sources of data :
Document Header Item
SO VDBKA VBDPA
Delivery Note VDBKL VBDPL
Picking VDLKK VBLKP
Invoice VDBKR VBDPR
Purchase Order EKKO EKPO
Payment REGUH REGUP
Configuration
Output Determination
 Linking a layout set to the printing
program
 Proposing the output type for the
documents
 Output time
 Output device
 Print parameters
Configuration
Linking Layout set to Program: SD Module•SD Menu: SD > Basic functions > Output > Output
determination > Process output and forms > Assign
forms and programs > Allocate to sales documents
•Output type / Medium determines
– Printing program
– Layout set
– Form routine
•Good screen to check initially to see which programs
and the layout sets the standard system uses to print
standard forms
Configuration
Linking Layout set to Program•By using the “FORM Routine” field you can indicate different
“entry point” to the printing program.
•All output type can be associated with the same program /
layout set combination but to different “FORM Routines”.
•Helps to consolidate logic variation in one program
Internt’l = XInternt’l = X Interco = XInterco = X internal = Xinternal = X
FORM EntryA FORM EntryB FORM EntryC
If Internt’l = X
….
elseif Interco = X
…
elseif Internal = X
….
Endif
ProgramProgram Layout setLayout set
Open_FormOpen_FormFORM Entry
Configuration
Linking Layout set to Program: MM Module
•Purchasing Menu: MM > Purchasing > Messages > Output
control > Output 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”
•Click on “Communication method” button
•Send time
– 1 Send with next selection run
• Batch printing using program RSNAST00
– 2 Send with time specification
• Batch printing using program RSNAST00 in the background
job
– 3 Explicit request
• On demand
– 4 Immediately
• After an update
Printing SAP Script Forms
Output Type - “Where”
•Click on “Further data”
button
•Printer name - Physical
output device name
•Number of messages -
Number of copies to be
printed
Printing SAP Script Forms
•Output medium:
– 1 Printout
– 2 Fax
– 3 Teletex
– 4 Telex
– 6 EDI
– 7 SAP Office
– 8 Special function
– 9 Workflow events
– A Distribution (ALE)
– T Workflow: Task
•Processing status:
– 0 Not processed
– 1 Successfully processed
– 2 Incorrectly processed
– 3 Not active
Printing SAP Script Forms
Screen Vs. Printer
•Menu: Issue Output To > Screen
– Works with all timing as long as there
exists an output type
– Ignores the output device specification
– Best for debugging
•Menu: Issue Output To > Printer
– Works only if Send time = 3 (On demand)
Printing SAP Script Forms
Print Preview•On screen display of
print preview
Printing SAP Script Forms
Collective Printing (Send time = 1)•Execute Program RSNAST00 using Transaction SA38.
Transaction OVNN.
•Can define and use variants.
•Only the output types with timing = 1 will be detected
•Only the output type with status = 0 will be detected
unless Send Again field is checked
•Object key = Document number
Printing SAP Script Forms
Repeating Output
1. Enter the document in change mode.
2. Select an output type that has already been
successfully
processed (Status = 1).
3. Click on “Repeat output” button.
4. Select the new entry. (Status = 0) and change
any data if necessary
5. Trigger printing as before.
SAP Script Utilities
Upload/Download
• SAP Scripts are client-dependent objects.
Hence, they may often require to be
downloaded from or uploaded to SAP system
• Following programs can be used to download
from/upload to SAP System
• RSTXR3TR – To EXPORT/IMPORT layout set
(FORM) using a Transport Request (CTS)
SAP Script Utilities
Assignment of Standard text to CTS
• Creation of a SAP Script Standard Text does
not require a CTS
• Standard Text can be assigned to a CTS using
program RSTXTRAN
07 sap scripts

More Related Content

What's hot (20)

PPTX
Sap Purchase Order Workflow
Arghadip Kar
 
PDF
Abap reports
Milind Patil
 
PPT
Chapter 01 user exits
Kranthi Kumar
 
PDF
Enhancement framework the new way to enhance your abap systems
Kranthi Kumar
 
PDF
Session 14 validation_steps_sap
Amitava Saha, PMP®
 
PDF
SAP PS overview
varun maheshwari
 
PDF
Automatic vendor payment advice notes by mail
SURESH BABU MUCHINTHALA
 
PDF
Sap query creation & transcation code creation for sap query
SURESH BABU MUCHINTHALA
 
DOCX
Workbench and customising request
lakshmi rajkumar
 
PPTX
SAP ALE Idoc
Jugul Crasta
 
PPTX
Oracle eBS Overview.pptx
ssuser9dce1e1
 
PPTX
CDS Views.pptx
Suman817957
 
PPT
BATCH DATA COMMUNICATION
Kranthi Kumar
 
PDF
Introducing enhancement framework.doc
Kranthi Kumar
 
PPTX
IBM Maximo Tips & Tricks
johnnyg14
 
PPT
Maximizing SAP ABAP Performance
PeterHBrown
 
PPT
sap script overview
Kranthi Kumar
 
PDF
S4 HANA Business Partner Configuration@Ganesh Tarlana
Ganesh Tarlana
 
PPTX
Combined COPA in SAP
Stridely Solutions
 
PDF
Ps training mannual ( configuration )
Soumya De
 
Sap Purchase Order Workflow
Arghadip Kar
 
Abap reports
Milind Patil
 
Chapter 01 user exits
Kranthi Kumar
 
Enhancement framework the new way to enhance your abap systems
Kranthi Kumar
 
Session 14 validation_steps_sap
Amitava Saha, PMP®
 
SAP PS overview
varun maheshwari
 
Automatic vendor payment advice notes by mail
SURESH BABU MUCHINTHALA
 
Sap query creation & transcation code creation for sap query
SURESH BABU MUCHINTHALA
 
Workbench and customising request
lakshmi rajkumar
 
SAP ALE Idoc
Jugul Crasta
 
Oracle eBS Overview.pptx
ssuser9dce1e1
 
CDS Views.pptx
Suman817957
 
BATCH DATA COMMUNICATION
Kranthi Kumar
 
Introducing enhancement framework.doc
Kranthi Kumar
 
IBM Maximo Tips & Tricks
johnnyg14
 
Maximizing SAP ABAP Performance
PeterHBrown
 
sap script overview
Kranthi Kumar
 
S4 HANA Business Partner Configuration@Ganesh Tarlana
Ganesh Tarlana
 
Combined COPA in SAP
Stridely Solutions
 
Ps training mannual ( configuration )
Soumya De
 

Viewers also liked (8)

PPT
Chapter 04 sap script - output program
Kranthi Kumar
 
PDF
Smartforms interview questions with answers
Uttam Agrawal
 
PDF
Sap sd-user-manual
Renu Bhasin
 
PPT
Abap function module help
Kranthi Kumar
 
PPT
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
Garuda Trainings
 
PDF
SAP SD Study material
Harsha Halyal
 
PDF
SAP SD Training | SAP SD Configuration Guide | SAP SD Study Material
SAP SD Training By Praveen
 
DOC
SAP ABAP Material
renterpserver
 
Chapter 04 sap script - output program
Kranthi Kumar
 
Smartforms interview questions with answers
Uttam Agrawal
 
Sap sd-user-manual
Renu Bhasin
 
Abap function module help
Kranthi Kumar
 
SAP ABAP Latest Interview Questions with Answers by Garuda Trainings
Garuda Trainings
 
SAP SD Study material
Harsha Halyal
 
SAP SD Training | SAP SD Configuration Guide | SAP SD Study Material
SAP SD Training By Praveen
 
SAP ABAP Material
renterpserver
 
Ad

Similar to 07 sap scripts (20)

PPTX
Sap script from the scratch and components. Pptx
sudha12345jefv
 
PPTX
SAP Adobe forms
Jugul Crasta
 
PPTX
15 wordprocessing ml subject - fields and hyperlinks
Shawn Villaron
 
PDF
Sap abap
Sri Nivas
 
PPT
ABAP BASICs learn the basics of ABAP-1.ppt
pagajal493
 
PDF
IT2255 Web Essentials - Unit II Web Designing
pkaviya
 
PPTX
Tableau calculations and experience.pptx
RohithMurthy8
 
DOCX
YearQuarterLocationCarClassRevenueNumCars2017Q1DowntownEcono.docx
odiliagilby
 
PPTX
Sap scripts
Jugul Crasta
 
PPTX
Unit No 2.pptx Basic s of C Programming
Vaibhav Parjane
 
PPTX
Sterling Integrator Map Editor
Jeyhind M
 
PDF
0417 s16 qp_22
Omniya Jay
 
PPT
Assemblers: Ch03
desta_gebre
 
PPTX
SAP Smart forms
Jugul Crasta
 
PPTX
Field properties
Dastan Kamaran
 
PPTX
Field properties
Dastan Kamaran
 
PDF
ABAP for Beginners - www.sapdocs.info
sapdocs. info
 
PDF
SAP ABAP data dictionary
Revanth Nagaraju
 
PPTX
Raptor tool
AbiramiTabiit
 
PPTX
Unit 3 - Transparent tables in the ABAP Dictionary
dubon07
 
Sap script from the scratch and components. Pptx
sudha12345jefv
 
SAP Adobe forms
Jugul Crasta
 
15 wordprocessing ml subject - fields and hyperlinks
Shawn Villaron
 
Sap abap
Sri Nivas
 
ABAP BASICs learn the basics of ABAP-1.ppt
pagajal493
 
IT2255 Web Essentials - Unit II Web Designing
pkaviya
 
Tableau calculations and experience.pptx
RohithMurthy8
 
YearQuarterLocationCarClassRevenueNumCars2017Q1DowntownEcono.docx
odiliagilby
 
Sap scripts
Jugul Crasta
 
Unit No 2.pptx Basic s of C Programming
Vaibhav Parjane
 
Sterling Integrator Map Editor
Jeyhind M
 
0417 s16 qp_22
Omniya Jay
 
Assemblers: Ch03
desta_gebre
 
SAP Smart forms
Jugul Crasta
 
Field properties
Dastan Kamaran
 
Field properties
Dastan Kamaran
 
ABAP for Beginners - www.sapdocs.info
sapdocs. info
 
SAP ABAP data dictionary
Revanth Nagaraju
 
Raptor tool
AbiramiTabiit
 
Unit 3 - Transparent tables in the ABAP Dictionary
dubon07
 
Ad

More from Kranthi Kumar (20)

PDF
Exercise in alv
Kranthi Kumar
 
PDF
Dynamic binding
Kranthi Kumar
 
PDF
Data binding
Kranthi Kumar
 
PDF
Creating simple comp
Kranthi Kumar
 
PDF
Creating messages
Kranthi Kumar
 
PDF
Creating a comp
Kranthi Kumar
 
PDF
Controllers and context programming
Kranthi Kumar
 
PDF
Context at design
Kranthi Kumar
 
PDF
Binding,context mapping,navigation exercise
Kranthi Kumar
 
PDF
Alv for web
Kranthi Kumar
 
PDF
Web(abap introduction)
Kranthi Kumar
 
DOC
Abap faq
Kranthi Kumar
 
PDF
Sap abap material
Kranthi Kumar
 
PDF
Crm technical
Kranthi Kumar
 
PDF
control techniques
Kranthi Kumar
 
PPT
Chapter 07 debugging sap scripts
Kranthi Kumar
 
PPT
Chapter 06 printing sap script forms
Kranthi Kumar
 
PPT
Chapter 05 sap script - configuration
Kranthi Kumar
 
PPT
Batch input session
Kranthi Kumar
 
PPT
Call transaction method
Kranthi Kumar
 
Exercise in alv
Kranthi Kumar
 
Dynamic binding
Kranthi Kumar
 
Data binding
Kranthi Kumar
 
Creating simple comp
Kranthi Kumar
 
Creating messages
Kranthi Kumar
 
Creating a comp
Kranthi Kumar
 
Controllers and context programming
Kranthi Kumar
 
Context at design
Kranthi Kumar
 
Binding,context mapping,navigation exercise
Kranthi Kumar
 
Alv for web
Kranthi Kumar
 
Web(abap introduction)
Kranthi Kumar
 
Abap faq
Kranthi Kumar
 
Sap abap material
Kranthi Kumar
 
Crm technical
Kranthi Kumar
 
control techniques
Kranthi Kumar
 
Chapter 07 debugging sap scripts
Kranthi Kumar
 
Chapter 06 printing sap script forms
Kranthi Kumar
 
Chapter 05 sap script - configuration
Kranthi Kumar
 
Batch input session
Kranthi Kumar
 
Call transaction method
Kranthi Kumar
 

07 sap scripts

  • 2. Agenda Chapter 1: Introduction Chapter 2: Layout Set Chapter 3: Output Program Chapter 4: Configuration Chapter 5: Printing Chapter 6: SAP Script Utilities © SAP 2008 / Page 2
  • 3. Introduction What is SAP Script ? • SAP Script is used to print forms. • Form Vs. Reports • Forms look “nicer”. • Forms can have graphic elements. • Forms can be event-triggered. • Examples of forms: SD Inquiry Order confirmation Delivery note Invoice PU Purchasing req. Purchase order Contract IM Goods receipt Goods issue FI Customer statement Checks WM Picking list Packing list Labels
  • 4. Introduction How SAP Script Works (Big Picture) •SAP documents are printed using forms. •Forms are defined and formatted using layout sets. •SAP script is a tool that SAP provides for creating layout sets. SAP Document SAP Document Form (Output) Layout set (Template) Read Data Print SAP Script Define• Sales order • Billing document • Purchase order • etc • Order confirmation • Invoice • Purchase order • etc
  • 5. Introduction Creating Report Vs. Form SAP Document SAP Document Output Program (ABAP) Output Program (ABAP) Report SAP Document SAP Document Output Program (ABAP) Output Program (ABAP) Layout setLayout set Form Creating Reports Creating Forms
  • 6. Introduction Components of SAP Script SAP Document SAP Document Output Program Output Program Layout setLayout set Form Output determination configuration Printer / Font Configuration • Output program: Extracts data from SAP data dictionary • Layout set: Formats the extracted data • Output determination configuration: Configures triggering event,timing/destination • Printer / Font configuration: Configures impact / laser printer, bar code,logo
  • 7. Introduction SAP Script Development Component Resource Output program ABAP resource Layout set ABAP resource Output determination configuration Functional resource Printer configuration (Impact, Thermal, Laser) Basis / ABAP Font configuraiton Basis / ABAP Testing End-user / Functional / ABAP resrouce
  • 8. Layout Set Some Facts •Client specific (client-dependent) •Language specific •Note: If the layout set is not available in the client in which the document is being printed, then the SAPscript checks for the style or layout set in client 000. •Recommendation: Keep only one copy of the layout set in one client.
  • 9. Layout Set Elements Initial Screen • Header • Paragraphs • Character strings • Windows • Pages • Page windows IMG Menu: Tools > Word processing > Layout set
  • 10. Layout Set Elements Components •Header: General info and default settings•Paragraphs: Font and tab info•Character strings: Font info within a paragraph•Windows: Description of areas on the pages•Pages: Name of the pages with page flow info•Page windows: Position and size of the windows on the pages Item Material # Price Item Material # PriceSold-to Ship-to S.O. # P.O. # Date S.O. # P.O. # Date 10 Part A $500 20 Part B $350 30 Part C $800 40 Part D $250 50 Part E $400 60 Part F $350 70 Part G $150 Total $2,800
  • 11. Layout Set Elements Page Windows •List of all the windows on the page with coordinates. •The coordinates are given by the upper left-hand corner and the width and length. •Note: A window which should appear on a page must first be defined under ”Windows” and then be added to the page windows.
  • 12. Layout Set Elements Windows•Type 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.
  • 13. Layout Set Elements Windows - Text element•A window can contain hard-coded texts and the variables to be printed in the window. •Tag column: Specifies format of the text •Text line column: Contains the actual content of the window. •Special characters – * Default paragraph – /: Command line – /* Comment line – /E Text element
  • 14. Layout Set Elements Windows - Text element •Text element always starts with the line /E and continues to the next text element (/E). •It is the output program (not the layout set) that controls whether or not to print a text element (I.e. block of texts surrounded by /E) and the order in which they are printed. •‘,,’ Tabs in a paragraph •‘&&’ Variables
  • 15. Layout Set Elements Pages •Shows the page flow information. •Must define at least two pages. •The first page specifies the next page. •The last page recursively defines the next page as itself.
  • 16. Layout Set Elements Paragraphs •Contains all information needed to format a paragraph of text •Font •Tabs
  • 17. Layout Set Elements Paragraphs •Specify tabs to create columns for line items •If no font is specified, default font from the layout set header will be used Tabs Font
  • 18. 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.
  • 19. Layout Set Elements Header •Administrative info •Default settings •Page format: different for different countries / applications •Never change ‘Lines per inch’ & ‘Characters/inch’
  • 20. Layout Set Test Print •Menu: Utility > Test 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
  • 21. Layout Set Activating Layout Set •Menu: Layout set > Activate •Must activate the layout set any time a change has been made
  • 22. Layout Set Symbol • Symbols are placeholders for values during print formatting. • Symbols are identified by a name which is included in ‘&’ characters. Example : &VBAK-VBELN&. Symbols are case sensitive. • Depending on the source, the value of a symbol comes from, they can be categorized as follows: • SYSTEM symbols • PROGRAM symbols • STANDARD symbols • TEXT symbols
  • 23. Layout Set Symbol • SYSTEM symbols are supplied by SAPscripts. They can be used in all texts. Following are list of frequently used system symbols. &DATE& = Current date &DAY& = Day &MONTH& = Month &YEAR& = Year &TIME& = Time of day &HOURS& = Hours &MINUTES& = Minutes &SECONDS& = Seconds &PAGE& = Page &NEXTPAGE& = Page number of next page &SPACE& = Blanks &ULINE& = Underline &VLINE& = Vertical line &NAME_OF_MONTH& = Name of month
  • 24. Layout Set Symbol • PROGRAM symbols are placeholders 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 Customer’s name. • STANDARD symbol are maintained centrally in one table (TTDTG) for all SAPscript users. • Values of TEXT symbol are created by assignment via DEFINE statement. Example : /: DEFINE &CASENUM& = ‘1234’.
  • 25. Layout Set Symbol • FORMATTING of the symbol can be done in following different ways: &SYMBOL+ 4& = Off set &SYMBOL(5)& = Length &SYMBOL(I)& = If the symbol is initial, output nothing &SYMBOL(Z)& = Suppress leading zeros &SYMBOL(C)& = Compress blanks &SYMBOL(R)& = Right-justified output &SYMBOL(S)& = Suppress +/- sign &SYMBOL(5,2)& = Decimal place formatting &SYMBOL(E3)& = Exponential notation &’text1’SYMBOL’text2’& = Concatenation of symbol and text Examples : &VBDPR-MATNR+2(4)& &VBDKL-BRGEW(I13)& &’Currency : ’VBDKA-WAERK& &’Case # &PREFIX&’VBDPR-BSTNK+2(8)’00’&
  • 26. Layout Set Commands • IF..ELSE..ENDIF can be used within the layout set to control the flow of logic. Example : /: IF &VBRK-VKORG(2)& EQ ‘HG’. /: DEFINE &PREFIX& = ‘Mr.’. /: ELSE. /: DEFINE &PREFIX& = ‘Mrs.’. /: ENDIF. . / &PREFIX&
  • 27. 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
  • 28. Layout Set Commands • Using the command NEW-PAGE, a page -break can be made in SAPscript at any position before the end of the page defined in the layout set. The next page can be specified explicitly. Syntax: /: NEW-PAGE [PAGE] • A page break within a paragraph can be prevented by using this command PROTECT..ENDPROTECT. Syntax : /: PROTECT text text text /: ENDPROTECT
  • 29. Layout Set Commands • The command ADDRESS…ENDADDRES formats an address according to the postal standards of the country of destination which is defined in the parameter COUNTRY. Syntax : /: ADDRESS DELIVERY PARAGRAPH paragraph [ PRIORITY prio LINES lines ] /: TITLE form of address /: NAME name1[, name2[, name3[,name4]]] /: STREET strno /: POBOX pobox [CODE code] /: POSTCODE postal code /: CITY city1[,city2] /: REGION district /: COUNTRY recipient country /: FORMCOUNTRY sender country /: ENDADDRESS
  • 30. Layout Set Commands • Parameter PRIORITY defines which address lines may be omitted, if necessary. The possible values are as follows : A Form of address B Mandatory blank line 1 C Mandatory blank line 2 2 Name2 3 Name3 4 Name4 L Country name S Street line O City line • 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.
  • 31. Layout Set Commands • The date can be formatted using the command SET DATE MASK = ‘…’. After formatting all date fields are output as specified. The available formats for day, month and year are following. DD Day MM Month in figures MMMM Month in words YY Year (2 digits) YYYY Year (4 digits) Example : /: SET DATE MASK = ‘MM/DD/YYYY’ • The formatting can be reset at any point of time by /: SET DATE MASK = ‘’. Formatting is then carried out as defined by the System.
  • 32. Layout Set Commands • The time can be formatted using the command SET TIME MASK = ‘…’. After formatting all time fields are output as specified. The available formats for hours, minutes and seconds are following. HH Hours MM Minutes SS Seconds Example /: SET TIME MASK = ‘HH:MM:SS’ • The formatting can be reset at any point of time by /: SET TIME MASK = ‘’. Formatting is then carried out as defined by the System.
  • 33. Layout Set Commands • In SAPscript, any text can be included at a certain position in the document using INCLUDE command. Syntax : INCLUDE name OBJECT object ID identifier PARAGRAPH paragraph LANGUAGE language 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 SAPscript. One is APPLICATION TEXT and other one is STANDARD TEXT.
  • 34. 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.
  • 35. Layout Set Commands • Several different text IDs can belong to one object . • TEXT ID 0002 Sales document header note1. 0003 Sales document header note2.
  • 36. Layout Set Barcode Printing • To print barcode , follow the steps below : • Select / Create a barcode font in SAP. • Create a character string and include the barcode with it. • The data need to printed as barcode should be attributed via the character string.
  • 37. Layout Set Logo Printing – using Standard Text • To print a Logo, follow the steps below : • Build a Logo. This file can be a bit map or windows meta file. • Convert the Logo to a TIFF ( extension TIF ) file. • Use program RSTXLDMC to convert the TIF file to a standard text.
  • 38. Layout Set Logo Printing – using GRAPHICS object• To print a logo using a GRAPHICS object (SAP 4.6B onwards) • Build a Logo. This file can be a bit map. • Import the logo as a GRAPHICS object using transaction SE78 (Function key F5). • Print this GRAPHICS object via SAPscript INCLUDE command. • e.g. /: INCLUDE ZHEX-IBMLOGO-BMP OBJECT GRAPHICS ID BCOL
  • 39. Output Program Overview • 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
  • 40. Output Program Function Call • General Function calls: • CALL FUNCTION ‘ OPEN_FORM ’. • CALL FUNCTION ‘ WRITE_FORM ’. • CALL FUNCTION ‘ CLOSE_FORM ’. • CALL FUNCTION ‘ CONTROL_FORM ’. • CALL FUNCTION ‘ READ_TEXT ’.
  • 41. Output Program Function Call•CALL FUNCTION ‘ OPEN_FORM ’ = .. EXPORTING FORM = .. LANGUAGE = .. DEVICE = .. OPTIONS = .. DIALOG = .. APPLICATION = .. IMPORTING LANGUAGE = .. EXCEPTIONS …..
  • 42. Output Program Function Call •OPEN_FORM opens layout set for Printing . •Parameters • LANGUAGE defines the layout set language version . • DEVICE specifies the output device type . ( Example : PRINTER, SCREEN, TELEX, TELEFAX) • OPTIONS can be used to specify the print preview. • DIALOG can request a pop-up screen on which user can enter spool information such as printer name.
  • 43. Output Program Function Call • Possible Exceptions : • DEVICE = Device type invalid • FORM = Layout set does not exist • OPTIONS = Options invalid • UNCLOSED = A layout set is still active
  • 44. Output Program Function Call • CALL FUNCTION ‘ WRITE_FORM ’ = .. EXPORTING ELEMENT = .. TYPE = .. FUNCTION = .. WINDOW = .. EXCEPTIONS …..
  • 45. 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. • No specification of WINDOW name is necessary for MAIN window. • TYPE defines area of the MAIN window, where data need to written. Possible values : • TOP = MAIN window header. • BOTTOM = MAIN window footer. • BODY = MAIN window normal output area (Default).
  • 46. Output Program Function Call •FUNCTION defines how the data specified in the text element is to be written in the respective WINDOW. • MAIN window • SET = Append to preceding output. • APPEND= Identical with SET. • DELETE = Ineffective. • OTHER window • SET = Delete old contents and output new text. • APPEND= Append to preceding output. • DELETE = Delete the specified text element. • Default is SET
  • 47. Output Program Function Call • Possible Exceptions : • ELEMENT = Text does not exist. • FUNCTION = Function is invalid. • TYPE = Window area is invalid. • WINDOW = Window does not exist. • UNOPENED = Layout set printing not opened.
  • 48. Output Program Function Call • CALL FUNCTION ‘ CLOSE_FORM ’ = .. EXPORTING RESULT = .. EXCEPTIONS….. • Layout set opened with function ‘OPEN_FORM’ is closed. • Layout set must be closed before being able to output the data on the screen or printer. • Possible exceptions : • UNOPENED = No open layout set.
  • 49. Output Program Function Call • CALL FUNCTION ‘ CONTROL_FORM ’ = .. EXPORTING COMMAND = .. EXCEPTIONS….. • ‘CONTROL_FORM’ can execute SAPscript control commands. • Example : PROTECT … ENDPROTECT. • Parameter COMMAND accept the SAPscript command. • Possible exceptions : • UNOPENED = Layout set printing has not been opened. • UNSTARTED = No layout set opened
  • 50. Output Program Function Call • CALL FUNCTION ‘ READ_TEXT ’ = .. EXPORTING OBJECT = .. NAME = .. ID = .. LANGUAGE = .. IMPORTING HEADER = .. TABLES LINES = .. EXCEPTIONS …..
  • 51. 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 •Work area for text lines must be defined as an internal table. DATA BEGIN OF LINES OCCURS ... INCLUDE STRUCTURE TLINE DATA END OF HEADER
  • 52. Output Program Function Call • Possible Exceptions : • ID = Text ID invalid. • LANGUAGE = Language invalid. • NAME = Text name invalid. • NOT_FOUND = Text not found. • OBJECT = Text object invalid. • REFERENCE_CHECK = Reference sequence interrupted.
  • 53. Output Program Function Call•Document ( e.g. Sales Order ) generation programs can also be triggered via business transaction. •Sources of data : Document Header Item SO VDBKA VBDPA Delivery Note VDBKL VBDPL Picking VDLKK VBLKP Invoice VDBKR VBDPR Purchase Order EKKO EKPO Payment REGUH REGUP
  • 54. Configuration Output Determination  Linking a layout set to the printing program  Proposing the output type for the documents  Output time  Output device  Print parameters
  • 55. Configuration Linking Layout set to Program: SD Module•SD Menu: SD > Basic functions > Output > Output determination > Process output and forms > Assign forms and programs > Allocate to sales documents •Output type / Medium determines – Printing program – Layout set – Form routine •Good screen to check initially to see which programs and the layout sets the standard system uses to print standard forms
  • 56. Configuration Linking Layout set to Program•By using the “FORM Routine” field you can indicate different “entry point” to the printing program. •All output type can be associated with the same program / layout set combination but to different “FORM Routines”. •Helps to consolidate logic variation in one program Internt’l = XInternt’l = X Interco = XInterco = X internal = Xinternal = X FORM EntryA FORM EntryB FORM EntryC If Internt’l = X …. elseif Interco = X … elseif Internal = X …. Endif ProgramProgram Layout setLayout set Open_FormOpen_FormFORM Entry
  • 57. Configuration Linking Layout set to Program: MM Module •Purchasing Menu: MM > Purchasing > Messages > Output control > Output 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
  • 58. 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
  • 59. 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?
  • 60. 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
  • 61. Printing SAP Script Forms Output Type - “When” •Click on “Communication method” button •Send time – 1 Send with next selection run • Batch printing using program RSNAST00 – 2 Send with time specification • Batch printing using program RSNAST00 in the background job – 3 Explicit request • On demand – 4 Immediately • After an update
  • 62. Printing SAP Script Forms Output Type - “Where” •Click on “Further data” button •Printer name - Physical output device name •Number of messages - Number of copies to be printed
  • 63. Printing SAP Script Forms •Output medium: – 1 Printout – 2 Fax – 3 Teletex – 4 Telex – 6 EDI – 7 SAP Office – 8 Special function – 9 Workflow events – A Distribution (ALE) – T Workflow: Task •Processing status: – 0 Not processed – 1 Successfully processed – 2 Incorrectly processed – 3 Not active
  • 64. Printing SAP Script Forms Screen Vs. Printer •Menu: Issue Output To > Screen – Works with all timing as long as there exists an output type – Ignores the output device specification – Best for debugging •Menu: Issue Output To > Printer – Works only if Send time = 3 (On demand)
  • 65. Printing SAP Script Forms Print Preview•On screen display of print preview
  • 66. Printing SAP Script Forms Collective Printing (Send time = 1)•Execute Program RSNAST00 using Transaction SA38. Transaction OVNN. •Can define and use variants. •Only the output types with timing = 1 will be detected •Only the output type with status = 0 will be detected unless Send Again field is checked •Object key = Document number
  • 67. Printing SAP Script Forms Repeating Output 1. Enter the document in change mode. 2. Select an output type that has already been successfully processed (Status = 1). 3. Click on “Repeat output” button. 4. Select the new entry. (Status = 0) and change any data if necessary 5. Trigger printing as before.
  • 68. SAP Script Utilities Upload/Download • SAP Scripts are client-dependent objects. Hence, they may often require to be downloaded from or uploaded to SAP system • Following programs can be used to download from/upload to SAP System • RSTXR3TR – To EXPORT/IMPORT layout set (FORM) using a Transport Request (CTS)
  • 69. SAP Script Utilities Assignment of Standard text to CTS • Creation of a SAP Script Standard Text does not require a CTS • Standard Text can be assigned to a CTS using program RSTXTRAN

Editor's Notes

  • #4: Forms Vs. Reports: Forms Look “nicer” (More control mechanisms to format fonts, paragraphs, etc) Forms can have graphic element (e.g. company logo, bar code) Forms can be event-triggered (e.g. Generate output as soon as the document is saved)
  • #5: SAP documents (e.g. sales order, billing document) are printed using forms. Forms are defined and formatted using layout sets Layout set is a template that defines how the form will look SAP script is a tool that SAP provides for creating layout sets
  • #6: At a very high level, the only difference between creating a report and a form is the one additional step of formatting the data using the layout set. The output program(written in ABAP) will still extract the needed data The manual formatting logic is taken out of the ABAP program The layout set defines the format the extracted data gets printed There has to be some mechanism for the output program and the layout set to communicate The communication is achieved through Function calls Communication structures Configuration
  • #7: Most people commonly refer to SAP Script as the combination of the output program and the corresponding layout set. However, in order for SAP script forms to work, all of its components (including the configuration elements) must be created and configured properly Output program is written in ABAP. It collects the data in the document (communication structure) and feeds it to the layout set via function calls. Layout set formats the passed data Output determination configuration determines the appropriate output program / layout set combination. It defines which event triggers the printing of the forms, and also defines the timing (batch, on-line) and destination (which printer) of the output Printer configuration specifies the print control of the output device (e.g. impact, laser printer). Font configuration can be used to specify logos and barcodes.
  • #8: Creating SAP script requires very broad set of knowledge across many different areas. It is ideal to develop a skill set to configure / develop all of these items. The more of these different skills you gain, the easier (less dependent on others) it will be to develop SAPscript forms. Understanding of how all these components work together and how the other components impact your area of responsibility is essential. Understanding where different types of problems can originate is essential in working together very efficiently.
  • #9: Client specific (client-dependent) Language specific Can be translated using the standard SAP translation tools Note: If the layout set is not available in the client in which the document is being printed, then the SAPscript checks for the style or layout set in client 000. Recommendation: Keep only one copy of the layout set in client 000
  • #10: There are 6 components of the layout set Header: General info and default settings Paragraphs: Font and tab info Character strings: Font info within a paragraph Windows: Description of areas on the pages Pages: Name of the pages with page flow info Page windows: Position and size of the windows on the pages Most often used window is the Page windows and Paragraphs. Header, Pages, and Windows can be defined once in the beginning. Character string is usually only changed as needed.
  • #12: “Page windows” shows a list of all the windows on the page with coordinates given by the upper left-hand corner and the width and length. It only shows the windows defined for the first page. To see the windows defined for the next page, select the appropriate page and click the ‘Enter’ button. It is possible to jump from this list to the text elements of the windows.
  • #13: There are 3 different types of windows: Main - A special window where item lines are to be printed. CONST (Constant) - Contents of a constant window is generated once at the beginning and then printed on every output page. Performance consideration. VAR (Variable) - Contents of a variable window is regenerated on every new page. All windows which contain different information different pages must be of type ‘VAR’.
  • #14: A window can contain hard-coded texts and the variables to be printed in the window. Tag column: Specifies format of the text Text line column: Contains the text of the window. Special characters * Default paragraph /: Command line /* Comment line /E Text element
  • #15: To jump to the contents of a window, select the window by double clicking on the name of the window, and then click the Text element button. Text element always starts with the line /E and continues to the next text element. The output program controls whether or not to print a text element and the order of printing of the text elements. If you specify more tabs than defined for the paragraph, the default paragraph of the header is used.
  • #16: The next page of the first page (FIRST) is defined as NEXT. The next page of the second page (NEXT) is defined as NEXT, recursively defining all subsequent pages to be the same format as NEXT.
  • #17: Paragraphs contain all necessary information needed to format a paragraph of text. Font and Tabs are important characteristics of the paragraphs.
  • #18: Specifying a list of tabs is the way to create columns for outputting line items of a document. You specify the tab positions by number of characters from the left, but note that the system uses the value behind ‘Character/inch’ of the header to convert the number of characters into an absolute value. The font size does not matter for this conversion. If not font is specified, then the default font from the layout set header will be used.
  • #19: A character string is used to override the paragraph settings for a few words within a paragraph. (e.g. Switch to bold for a single word within a paragraph)
  • #20: Header consists of either administrative information for the layout set or default settings which can be overridden in other parts of the layout set. Page format = LETTER for the US, DINA for Australia
  • #21: Release 3.0 + has a new feature called test print. It allows you to visually confirm the layout set definitions (mostly the window parameters and field lengths) you have defined without execution of the print program. No data will be extracted. Useful for the development process of the layout set.
  • #22: Release 3.0 + has a new feature called test print. It allows you to visually confirm the layout set definitions (mostly the window parameters and field lengths) you have defined without execution of the print program. No data will be extracted. Useful for the development process of the layout set.
  • #40: Forms Vs. Reports: Forms Look “nicer” (More control mechanisms to forat fonts, paragraphs, etc) Forms can have graphic element (e.g. company logo, bar code) Forms can be event-triggered
  • #55: Output determination configuration will allow you to Establish link between the layout set and the printing program Define the time at which the combination (layout set + printing program) will be executed (Print time) Define the output device Define the print parameters Generally, there’s two parts to the output type configuration (Module specific) Establishing the link between the layout set and the print program Proposing output type for the documents Output determination configuration is usually a responsibility of the functional consultant. However, the more you understand how it works, the better you will be equipped to solve output related problems. Gaining output determination configuration knowledge is not easy because it is often very module specific. It is very different from one module to another, sometimes even very different from one sub module to another within the module.
  • #56: Part of what output determination configuration will allow you to do is establish the link between the layout set and the print program which extracts the data for the layout set. The best way to develop a custom layout set is to copy an existing one and modifying it. Therefore, this is a good screen to investigate initially to find out which program and the layout set is being used by the standard system. For each output type / medium combination, you can define Print program Layout set FORM routine
  • #57: FORM routine allows you to start the print program from different routines. This gives you the flexibility to use one program instead of using many programs each for specific cases. For example, instead of writing 3 separate programs to print international invoice, inter-company invoice, and internal invoice, you can write one single program which contains the main logic all of the three invoice have in common. By starting the program through different “entry” FORM routine, you can set certain flags and later branch into different routines based on the flag. The advantage of doing it this way is that you will only have one program to maintain. It is highly recommended to create as few programs and layout sets as possible in order to reduce the amount of effort involved in maintaining all the variations.
  • #58: Gaining output determination configuration knowledge is not easy because it is often very module specific. It is very different from one module to another, sometimes even very different from one sub module to another within one module.
  • #59: Gaining output determination configuration knowledge is not easy because it is often very module specific. It is very different from one module to another, sometimes even very different from one sub module to another within one module.
  • #60: Where should it be printed? Which output device should it be printed on? How many copied should be printed? One Multiple When should it be printed? On demand Batch mode Specified time Immediately after saving the document What medium should it be “printed” on? Printout Fax EDI Workflow etc. At what level should the information be stored? SAP document What types of status should be captured? Was it correctly processed? How many times was it processed?
  • #61: In order to print a form, you have to understand a little bit about the output type determination configuration. You will not necessarily have to know how to configure it, but you’ll need to understand what aspects (e.g. timing, output device) of the printing can be controlled through the configuration. Output type defines when, to where, and how to print the form. The output types are proposed for SAP documents via configuration and can be over-ridden. To get to the detail screen which allows you to define the timing of the output, click on “Communication method” button. To get to the detail screen which allows you to define which output device to print to, click on “Further data” button.
  • #62: Many of SAP forms are designed to be triggered by “event”. For example, you can configure it so that the saving (event) of the document can trigger the automatic printing of the form. There are 4 different triggering events 1 - Send with next selection run The output will not be issued until a batch printing program called RSNAST00 is executed. When the program is executed (typically once or twice a day manually), all output types with send time = 1 that hasn’t been printed yet (status =0) will be printed. 2 - Send with time specification Output has to be issued manually on demand. 3 - Explicit request Individual output will be triggered manually on demand. This demand is registered by the system when a user performs “Issue > Output to” command. 4 - Immediately Saving of the document will trigger the output to be issued. Output will be generated and issued to the specified printer when triggered by their respective events. It is assumed that the output type which contains the timing information will also contain the correct device to print.
  • #63: Specify the name of the physical output device name. Enter the number of copies to be printed in the “Number of message” field. Specified number of copies will be printed to the same device at the same time. Note: In order to print two identical copies, each to a different printer, you must set up a separate output type. Each of these output types should specify different output device name even though they are configured to print the same form. Click on “Print immediately” indicator to have the output come out immediately upon triggering events. If this indicator is not turned on, the output will only be generated in the spool format until it is manually released. Click on “Release after output” indicator to release the printed form from the spool. If this indicator is not turned on, the spool will not be deleted from the system even after the form was physically printed.
  • #64: Available choices for the Output medium are: 1 Printout- Printer (laser, impact) 2 Fax 3 Teletex 4 Telex 6 EDI 7 SAPoffice 8 Special function- Exit to a ABAP routine 9 Workflow events A Distribution (ALE) T Workflow: Task Available choices for the Processing status are: 0 Not processed 1 Successfully processed 2 Incorrectly processed 3 Not active Initially all unprocessed output types have status = 0. Once the output was successfully printed, the status will be updated to 1. Once the status is updated to 1 or 2, the same output type cannot be used again unless you follow the procedure on the slide titled “Repeating output”. Note: This indicator is especially important for those output types with timing = 1.
  • #65: You may preview the output on the screen before printing by following the procedure. Bring up the document you want to print in either change or display mode. There are two options at this point. Sales document > Issue > output to > Printer Sales document > Issue > output to > Screen Selecting the Printer option will only work if you have an output type defined with timing of 3 (explicit request) Selecting the Screen option will work regardless of what timing the output type has been defined with, as long as there exists a default output type (proposed by output type determination configuration) Over write any information (e.g. output type, device name) and confirm.
  • #66: Print preview is WYSIWYG as of 3.0 release
  • #67: Those documents with output types which are defined to print with send time = 1, are to be printed collectively. Therefore, when a document with such output type is saved, nothing happens until at later time when a triggering program RSNAS00 is manually launched. The program RSNAST00 loops through all documents that are between the specified number ranges (object key) contain the specified output type the output type has not been processed (status = 0) Note: The object key is the document number. It must be specified in 10 digits (padded with preceding 0’s if necessary) In normal day to day operation, you do not have to specify the document number ranges. By not specifying the number range, the system will evaluate ALL documents that meet the above criteria and print the ones that haven’t been printed since the last collective run. Once the collective run finishes the status of all the documents that have been printed will be updated.
  • #68: Once the document has been successfully printed, you must follow the following procedures to reprint the same form (except Send time = 3). Enter the document in change mode Select the output type that has already been successfully printed which you wish to print again. Click on “Repeat output” button This will generate an identical entry of the same output type. Select the new entry and change any data if necessary. Proceed to trigger printing the same way as before. List of output types shows the history of when and how many times the form was generated to which output device. Understanding how this “log” works is essential in deducing the user error.