Você está na página 1de 38

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

Header :
Consists of Administrative Data and Basic Settings.

Administrative Data :
Displays the name of the form, its description, form class and the status.

Kaavian Systems

Header
Basic Settings : Default settings for the entire document is
given here. It consists of page size, Orientation,

font, print attributes (Lines per inch, and


Characters per inch) default font to be used etc.

Kaavian Systems

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

Kaavian Systems

Paragraph Format :

Kaavian Systems

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

Page Layout:

Page size is defined in the Basic Settings of Header. Within the Page, we can place any number of Windows in any

size.
Using Graphical Editor, placing and sizing windows on form is

simplified with mouse clicks and drag & drop.


We can define several pages with minimum of one page.

Different pages can have different layouts.

Kaavian Systems

Windows:
There are 3 Types of Windows 1. Main Window.
It controls the page break. It contains the body text that may cover several pages. It allows to fix text elements at the upper and lower margins of the allocated page window (for example, for column headings).

2. Variable Window.
Window with variable contents. The text can vary on each page in which the window is positioned. Variable windows are formatted for each page.

3. Constant Window.
Window with constant contents that is formatted only once

Kaavian Systems

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

Documentation:

Store Technical Details relating to the Script.

Detailed Help regarding the Variables used (text elements, program


symbols etc), Logical Flow, Description about Various Windows etc to be
provided.

If copy of standard forms are modified, make sure that the changes are
properly documented.

Kaavian Systems

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

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

Kaavian Systems

Text Elements:

Text elements are defined for each window. They are accessed using their name by a print program,

formatted, and output in the respective window.


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.

Types :
Named Text Element Un-named Text Element
Kaavian Systems

Symbols:

These are Placeholders which represents data, replaced with their output values.
1. System symbol SAP Script supplies values for the system symbols

2. Program symbol
Data is supplied by the program. 3. Standard symbol

values are defined in the TTDTG table.


4.Text symbol values From control commands in text editor
Kaavian Systems

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

System Symbols
Sap script supplies values for System symbols. Fixed name for system symbols.

Examples
&DATE& &ULINE& &TIME&

Program Symbols
SAP Scripts cannot directly retrieve data from DB tables calls

another program to do this.


Values fed to SAP Scripts using data areas. Program symbol value limited to 255 chars

Kaavian Systems

Standard Symbols
Standard symbols are defined in the TTDTG table. This table contains both the name of each symbol and its value. The value, which is language-dependent, can contain up to 60 chars. This table is delivered complete with standard entries supplied by SAP. 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. There are two ways of doing this:
Use the menu entries in the text editor Use the control command DEFINE Kaavian Systems

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.

SAPscript Commands :
SAPscript commands Address, Endaddress Bottom, Endbottom Box, Position, Size Case, Endcase Define Hex, Endhex If, Endif Include New-page Description Formatting of address Define footer text in window Boxes, Lines and Shading Case distinction Value assignment to text symbols Hexadecimal values Conditional text output Include other texts Explicit form feed SAPscript Commands Perform, Endperform Print-control Protect, 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 + / - sign Formatting of time fields Change style Summing variables

New-window

New window main

Set header text in main window

Kaavian Systems

SAPscript Command: Address ENDAddress.


The command formats an address according to the postal standards of

the destination country defined in the parameter COUNTRY. The


reference fields are described in the structure ADRS. Both constants and symbols can be assigned to the parameters.
/: ADDRESS [DELIVERY][PARAGRAPH P][PRIORITY PR][LINES L ] /: TITLE <title> /: NAME name1 [,name3[,name3]] /: STREET street /: POSTBOX PO Box [CODE zipcode] /: POSTCODE zipcode /: CITY town1[,town2] /: REGION region /: COUNTRY country /: FROMCOUNTRY from country /:ENDADDRESS
Kaavian Systems

SAP script Command:


BOXES, LINES, SHADING: BOX, POSITION, SIZE
The BOX, 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. Syntax 1. /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY] 2. /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE] 3. /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]

Kaavian Systems

SAP script Command:


SET DATE SET TIME /: Set date mask= date mask /: Set Time mask = HH:MM
/:TOP .. /:ENDTOP /:BOTTOM .. /:ENDBOTTOM /: PROTECT . /: ENDPROTECT
Kaavian Systems

HEADER TEXT :

FOOTER TEXT :

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

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.2)& -

&text1 SYMBOL text2& - Outputs Value preceded by text1 and succeeded by text2.
Kaavian Systems

PRINT PROGRAM :
The Structure of a Print Program
Retrieves data 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' ...

Opens layout set printing

Changes to another layout set Prints output on the layout set

Closes layout set printing


SAP AG

Kaavian Systems

Form Functions
Open_form
Close_form Write_form Write_form_lines Start_form End_form

- Opens form printing.


Closes form printing. - Prints text elements in layout set window. Prints text lines from table into specified form window. - To combine several different forms into one print output - Ends the currently open form and Executes the required termination processing
Kaavian Systems

Beginning and End of Layout Set Prin

CALL FUNCTION OPEN_FORM EXPORTING FORM = LANGUAGE = DEVICE = OPTIONS = DIALOG = IMPORTING LANGUAGE = EXCEPTIONS ... =

. . . . .

. . . . .

. . . . .

... ...

CALL FUNCTION CLOSE_FORM IMPORTING RESULT = ... EXCEPTIONS ... = ...

tputting More than One Layout Se ng a Single Spool Request


CALL FUNCTION START_FORM EXPORTING FORM = . LANGUAGE = . STARTPAGE = . IMPORTING LANGUAGE = . EXCEPTIONS ... = . CALL FUNCTION END_FORM IMPORTING RESULT = EXCEPTIONS ... =
Kaavian Systems

.. .. .. .. ..

... ...

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

Adding Graphics to Layout:


Convert the available graphic to either BMP format or TIFF format. Invoke Transaction SE78. Select Category and Enter a name of the graphic image to be stored in Document Server. Click on Import Icon. Enter existing image file name with path at File name field. Enter Description of the image. Press Enter Key. The image is saved in Document Server from where we can directly place it on the layout.
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). Preconfigured SAPscript forms: Developed for the U.S. and Canadian markets, the preconfigured SAPscript forms are delivered with the Preconfigured Client (PCC).

Kaavian Systems

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

Você também pode gostar