SAP SCRIPTS

Kaavian Systems

What is SAPscript ?
 SAPscript is the integrated text management system of R/3.  It is similar to other word processing systems.  SAPscript simplifies the process of designing forms.  It supplies the layout and content for your business forms.  Used To print, distribute, or display the business forms

Kaavian Systems

Components
 Editor  Form Layouts and Styles  Composer  Print Program (Driver)  Database

Kaavian Systems

Process Printer FAX E-Mail On Screen Kaavian Systems .

FORM Management Tools FORM Painter (SE71) A graphical tool to manage form design and layout PC Editor (SO10) A text based tool to manage business contents Kaavian Systems .

FORM Components:  Header  Paragraph format  Character format  Page layout  Documentation Kaavian Systems .

its description. Administrative Data : Displays the name of the form.Header : Consists of Administrative Data and Basic Settings. Kaavian Systems . form class and the status.

and Characters per inch) default font to be used etc. font. print attributes (Lines per inch.Header Basic Settings : Default settings for the entire document is given here. Kaavian Systems . It consists of page size. Orientation.

Tab settings and Outline definitions. Alignment. Font Name & Size. Kaavian Systems .Paragraph Format Used to define several paragraph formats to be used with Texts in Forms. At least 1 format to be specified and it has to be defined as default paragraph in Basic settings. Some of the Attributes are Margins.

Paragraph Format : Kaavian Systems .

Italic. Barcode format.Character Format: To define formats to words and characters such as Bold. Underlined. . Font Name and Size etc.

 Different pages can have different layouts. placing and sizing windows on form is simplified with mouse clicks and drag & drop.  Using Graphical Editor. we can place any number of Windows in any size.Page Layout:  Page size is defined in the Basic Settings of Header. Kaavian Systems .  Within the Page.  We can define several pages with minimum of one page.

2. Variable Window. It controls the page break. for column headings). Main Window. It allows to fix text elements at the upper and lower margins of the allocated page window (for example. Window with constant contents that is formatted only once Kaavian Systems . 3. The text can vary on each page in which the window is positioned. Variable windows are formatted for each page.Windows: There are 3 Types of Windows 1. It contains the body text that may cover several pages. Window with variable contents. Constant Window.

Window Types : LOGO Company Name & Details Constant Windows HEADER WINDOW Recipient Address Information Variable Windows MAIN WINDOW Variable Windows Main Windows MAIN WINDOW FOOTER WINDOW Variable Windows FOOTER WINDOW .

 If copy of standard forms are modified. Kaavian Systems .Documentation:  Store Technical Details relating to the Script. Logical Flow. make sure that the changes are properly documented. Description about Various Windows etc to be provided. program symbols etc).  Detailed Help regarding the Variables used (text elements.

Working With Windows: Manipulation of the layout of a form can be subdivided into the following operations:  Creating a new window  Renaming a window  Changing the position of a window  Changing the size of a window  Removing a window  Aligning a window Kaavian Systems .

Kaavian Systems . The Graphical Editor displayed can be changed to Line Editor using the menu path GOTO  Change Editor. Symbols etc. When working with Form Painter Layout. right click and Select ‘Edit Text’. Displays the Text Editor for the Window. You can Enter the Text Elements. Select the Window to Edit.PC Editor : PC Editor can be invoked using Transaction SO10.

Types : – Named Text Element – Un-named Text Element Kaavian Systems . formatted.  The /E in the tag column is used to identify the text as a text element  Text is assigned to window(s) as text elements. and output in the respective window.Text Elements:  Text elements are defined for each window.  They are accessed using their name by a print program.

3.Text symbol values From control commands in text editor Kaavian Systems . 4.Symbols: These are Placeholders which represents data. System symbol SAP Script supplies values for the system symbols 2. 1. replaced with their output values. Standard symbol values are defined in the TTDTG table. Program symbol Data is supplied by the program.

CONDITIONS FOR USING SYMBOLS  Symbols must be enclosed within ‘&’ character.  Line break should not occur between the symbols.  Additional formatting options can be used within () immediately after the symbols.  The code letters should be in CAPITAL letters .

Examples &DATE& &ULINE& &TIME& Program Symbols  SAP Scripts cannot directly retrieve data from DB tables – calls another program to do this.System Symbols  Sap script supplies values for System symbols.  Program symbol value limited to 255 chars Kaavian Systems .  Fixed name for system symbols.  Values fed to SAP Scripts using data areas.

can contain up to 60 chars.  The value.  This table contains both the name of each symbol and its value.  It may be extended with customer-specific symbols Text Symbols  All symbols which do not correspond to one of the three types of symbol described above are text symbols. You define the value of a text symbol yourself in the text module.Standard Symbols  Standard symbols are defined in the TTDTG table. There are two ways of doing this:  Use the menu entries in the text editor  Use the control command DEFINE Kaavian Systems .  This table is delivered complete with standard entries supplied by SAP. which is language-dependent.

.How to Define Commands ? Following tags are used in Editor to designate the commands Tag /E /: ‘‘ = ( / /= /( * /* - Meaning Element Name Command Line Continuous Text (Left Blank) Extended Line Raw Line Line Feed Line feed with Extended Line Life feed with Raw Line Default Paragraph Comment Line along with other paragraph formats defined.

sign Formatting of time fields Change style Summing variables New-window New window main Set header text in main window Kaavian Systems . Endperform Print-control Protect. Lines and Shading Case distinction Value assignment to text symbols Hexadecimal values Conditional text output Include other texts Explicit form feed SAPscript Commands Perform. Endaddress Bottom. Endbottom Box. Endcase Define Hex. Endhex If. Endprotect Reset Set country Set date mask Set sign Set time mask Style Summing Top Description Call ABAP subroutines Insert print control character Protect from page break Initialize outline paragraph Country-specific formatting Formatting of date fields Position + / .SAPscript Commands : SAPscript commands Address. Size Case. Endif Include New-page Description Formatting of address Define footer text in window Boxes. Position.

town2] /: REGION region /: COUNTRY country /: FROMCOUNTRY from country /:ENDADDRESS Kaavian Systems . The reference fields are described in the structure ADRS.SAPscript Command: Address … ENDAddress.name3[. Both constants and symbols can be assigned to the parameters. /: ADDRESS [DELIVERY][PARAGRAPH P][PRIORITY PR][LINES L ] /: TITLE <title> /: NAME name1 [.name3]] /: STREET street /: POSTBOX PO Box [CODE zipcode] /: POSTCODE zipcode /: CITY town1[. The command formats an address according to the postal standards of the destination country defined in the parameter COUNTRY.

SAP script Command: BOXES. POSITION and SIZE commands for drawing boxes. lines and shadowing can be used for specifying that within a layout set particular windows or passages of text within a window are to be output in a frame or with shadowing. POSITION. LINES. /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE] 3. SHADING: BOX. /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY] 2. /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE] Kaavian Systems . SIZE The BOX. Syntax 1.

SAP script Command: SET DATE SET TIME /: Set date mask= ‘date mask’ /: Set Time mask = ‘HH:MM’ /:TOP . /:ENDTOP /:BOTTOM .. /: ENDPROTECT Kaavian Systems HEADER TEXT : FOOTER TEXT : PROTECT : . /:ENDBOTTOM /: PROTECT …..

SAP script Formatting : Changing the value of a counter Country dependent formatting Date mask Exponent for floating point numbers Fill characters Ignoring conversion rules Leading sign to the left Leading sign to the right Increasing or decreasing the value of a counter Specifying formats for country dependent values Formatting date fields Specifying an exponent for floating point values Replacing leading spaces with fill characters Ignoring conversion rules from Dictionary Leading sign of numeric values is on the left Leading sign of numeric values is on the right Number of decimals Offset Omitting leading zeros Omitting the leading sign Omitting the separator for ‘Thousands’ Specifying the number of decimal places Specifying an offset of n characters Omitting the leading zeros Omitting the leading sign of numeric values Omitting the separator for ‘thousands’ in numeric values Kaavian Systems .

Kaavian Systems .Outputs Value preceded by ‘text1’ and succeeded by ‘text2’.2)& - &’text1’ SYMBOL ‘text2’& .SAPscript Formatting: &SYMBOL& &SYMBOL+4& &SYMBOL(5)& &SYMBOL(I)& &SYMBOL(Z)& Symbol value is output Offset (Value returned from Offset) Width of the value Suppress Initial Value Suppress Leading Zeros &SYMBOL(C)& &SYMBOL(R)& &SYMBOL(*)& - Condense the variable Right Aligned Output Dictionary Length Decimal Format &SYMBOL(9.

. . call function 'START_FORM' .. ... ... Opens layout set printing Changes to another layout set Prints output on the layout set Closes layout set printing  SAP AG R Kaavian Systems . sbook. call function 'END_FORM' . ..... call function 'WRITE_FORM' exporting element = .. tables: scustom. call function 'START_FORM' . ..... ... select * from .... ..... call function 'CLOSE_FORM' . call function 'OPEN_FORM' exporting form = ... ...PRINT PROGRAM : The Structure of a Print Program Retrieves data program rstxexp1.. window = .. call function 'END_FORM' .....

To combine several different forms into one print output . – Closes form printing.Ends the currently open form and Executes the required termination processing Kaavian Systems . .Prints text elements in layout set window.Opens form printing. . – Prints text lines from table into specified form window.Form Functions Open_form Close_form Write_form Write_form_lines Start_form End_form .

.. . . . EXCEPTIONS . . = .. . .. .. = . .. . .. . CALL FUNCTION ’CLOSE_FORM’ IMPORTING RESULT = ..... . . .Beginning and End of Layout Set Prin CALL FUNCTION ’OPEN_FORM’ EXPORTING FORM = LANGUAGE = DEVICE = OPTIONS = DIALOG = IMPORTING LANGUAGE = EXCEPTIONS . .. ..

. . IMPORTING LANGUAGE = . .. = Kaavian Systems ... STARTPAGE = .... . ... . CALL FUNCTION ’END_FORM’ IMPORTING RESULT = EXCEPTIONS . EXCEPTIONS ... LANGUAGE = .tputting More than One Layout Se ng a Single Spool Request CALL FUNCTION ’START_FORM’ EXPORTING FORM = ... = . ..

CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = WINDOW = FUNCTION = TYPE = IMPORTING PENDING_LINES = EXCEPTIONS ELEMENT = FUNCTION = TYPE = UNOPENED = UNSTARTED = WINDOW = Kaavian Systems .

The image is saved in Document Server from where we can directly place it on the layout. Kaavian Systems .  Enter Description of the image.  Click on Import Icon.  Press Enter Key.Adding Graphics to Layout:  Convert the available graphic to either BMP format or TIFF format.  Enter existing image file name with path at File name field.  Invoke Transaction SE78.  Select Category and Enter a name of the graphic image to be stored in Document Server.

Preconfigured SAPscript forms: Developed for the U. Kaavian Systems .Source of SAPscript Forms: SAP provides you with two different sources for SAPscript forms: Standard SAPscript forms: Standard SAPscript forms are delivered with the SAP standard client (usually referred to as client 000). the preconfigured SAPscript forms are delivered with the Preconfigured Client (PCC). and Canadian markets.S.

Some of the Standard SAPscript Forms: Form Description Sales Order Confirmation Packing List Invoice Purchase Order Prenumbered Check Standard Form Name RVORDER01 RVDELNOTE RVINVOICE01 MEDRUCK F110_PRENUM_CHCK Some of the Preconfigured SAPscript forms (for US & CANADA) Form Description Sales Order Confirmation Packing List Purchase Order Invoice Remittance Advice Account Statement / Open Item List Balance Carried Forward Statement /Open Item List Unnumbered Check Prenumbered Check Preconfigured Form Name YPCC_ORDCONF_STD YPCC_PACKLIST YPCC_CHECK_NUM YPCC_INVOICE_STD YPCC_REMITT_STD YPCC_STATEMT_STD YPCC_STMBCF_STD YPCC_CHECK_UNN Kaavian Systems YPCC_CHECK_NUM .

Discussion ! .

Sign up to vote on this title
UsefulNot useful