Professional Documents
Culture Documents
SAPscripts
1 2
Demonstration
Exercises HelpMe
5
India SAP CoE, Slide 2
SAPscripts
1 2
Demonstration
Exercises HelpMe
5
India SAP CoE, Slide 3
Purpose
SAPscript is a template that simplifies the process of designing business forms. You need SAPscript forms to print, distribute or display business forms.
Use
Forms are defined and formatted using layout sets. Sap documents are printed using forms. SAPscript is a tool that SAP provides for creating layout sets.
(Output)
Define
SAPscript
SAP documents are printed using forms. Forms are defined and formatted using layout sets. SAPscript is a tool that SAP provides for creating layout sets.
Components of SAPscript
Output determination configuration
Output Program
Layout set
Form
SAPscripts
1 2
Demonstration
Exercises HelpMe
5
India SAP CoE, Slide 8
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 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.
Syntax Description
General Function calls: CALL FUNCTION OPEN_FORM . CALL FUNCTION WRITE_FORM . CALL FUNCTION CLOSE_FORM . CALL FUNCTION CONTROL_FORM . CALL FUNCTION READ_TEXT .
Syntax Description
CALL FUNCTION OPEN_FORM = ..
EXPORTING
IMPORTING EXCEPTIONS
= .. = ..
= .. = .. = ..
Syntax Description
CALL FUNCTION WRITE_FORM = ..
EXPORTING = ..
ELEMENT
TYPE FUNCTION WINDOW .. = .. = .. = ..
EXCEPTIONS
SAPscripts
1 2
Demonstration
Exercises HelpMe
5
India SAP CoE, Slide 13
Demonstration
SAPscript Development
Component Output program Layout set Resource ABAP resource ABAP resource
Output determination Functional resource configuration Printer configuration Basis / ABAP (Impact, Thermal, Laser) 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.
Page windows
IMG
India SAP CoE, Slide 17
General info and default settings Font and tab info Font info within a paragraph Description of areas on the pages Name of the pages with page flow info Position and size of the windows on the 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.
Tabs
Font
If no font is specified, default font from the layout set header will be used
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 printed.
Layout Set
Activating Layout Set
Menu: Layout set > Activate Must activate the layout set any time a change has been made
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.
In SAPscript:
PERFORM < routine_name> in <report_name> USING &var1& CHANGING &var2&. ENDPERFORM.
Logo Printing
To print a Logo, follow the steps below :
Built 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. Print this standard text via SAPscript INCLUDE command.
e.g. ST /: INCLUDE ZHEX-IBMLOGO-PCL OBJECT TEXT ID
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.
e.g. / <BC> * &VBAKA-WERKS& * </>
SAPscripts
1 2
Demonstration
Exercises HelpMe
5
India SAP CoE, Slide 34
Exercises
Let us design one SAPscript for Billing Document.. The layout specifications and data retrieval logic has been explained in these word documents.
Layout Specification
SAPscripts
1 2
Demonstration
Exercises HelpMe
5
India SAP CoE, Slide 36
HelpMe
Additional Info
Some Standard SAPscript Forms
Form Description Sales order confirmation Picking List INVOICE PURCHASE ORDER PRENUMBERED CHECK
RSTXPDFT4 : to convert your SAPscripts spools into a PDF format. RSTXSCRP : Import/Export SAPscript form from PC file RSTXLDMC : To convert TIF file to Standard text
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
FORMATTING of the symbol can be done in following different ways:
&SYMBOL+ 4& &SYMBOL(5)& &SYMBOL(I)& &SYMBOL(Z)& &SYMBOL(C)& &SYMBOL(R)& &SYMBOL(S)& &SYMBOL(5,2)& &SYMBOL(E3)& &text1SYMBOLtext2& = Off set = Length = If the symbol is initial, output nothing = Suppress leading zeros = Compress blanks = Right-justified output = Suppress +/- sign = Decimal place formatting = Exponential notation = Concatenation of symbol and text
Examples :
&VBDPR-MATNR+2(4)& &VBDKL-BRGEW(I13)& &Currency : VBDKA-WAERK& &Case # &PREFIX&VBDPR-BSTNK+2(8)00&
SAPscripts Boxes/Lines/Shading
Drawing a box
/: BOX XPOS '11.21' MM YPOS '5.31' MM HEIGHT '10' MM WIDTH '20' MM INTENSITY 10 FRAME 0 TW OR /: POSITION XORIGIN '11.21' YORIGIN '5.31' MM /: SIZE HEIGHT '2' MM WIDTH '76' MM /: BOX FRAME 10 TW INTENSITY 10
The position is now 5 MM from the left and 10 MM from the top of the window.