25 Kaavian SAP Script

  • Upload
    haarush

  • View
    243

  • Download
    0

Embed Size (px)

Citation preview

  • 7/31/2019 25 Kaavian SAP Script

    1/38

    SAP SCRIPTS

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    2/38

    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

  • 7/31/2019 25 Kaavian SAP Script

    3/38

    Editor

    Form Layouts and Styles

    Composer

    Print Program (Driver)

    Database

    Components

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    4/38

    Process

    Printer

    FAX

    E-Mail

    On Screen

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    5/38

    FORM Painter (SE71)

    A graphical tool to manage form design and layout

    PC Editor (SO10)

    A text based tool to manage business contents

    FORM Management Tools

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    6/38

    Header

    Paragraph format

    Character format

    Page layout

    Documentation

    FORM Components:

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    7/38

    Header :

    Consists ofAdministrative Data and Basic

    Settings.

    Administrative Data :

    Displays the name of the form, its description,

    form class and the status.

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    8/38

    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

  • 7/31/2019 25 Kaavian SAP Script

    9/38

    Paragraph Format

    Used to define several paragraph formats tobe 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 hasto be defined as default paragraph in Basicsettings.

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    10/38

    Paragraph Format :

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    11/38

    To define formats to words and characters such as Bold, Italic, Underlined,

    Barcode format, Font Name and Size etc.

    Character Format:

  • 7/31/2019 25 Kaavian SAP Script

    12/38

    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.

    Page Layout:

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    13/38

    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

    Windows:

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    14/38

    HEADER WINDOW

    FOOTER WINDOW

    LOGO Company Name & Details

    FOOTER WINDOW

    RecipientAddress

    Information

    MAINWINDOW

    MAINWINDOW

    Variable Windows

    Variable Windows

    Variable Windows

    Main Windows

    Constant Windows

    Window Types :

  • 7/31/2019 25 Kaavian SAP Script

    15/38

    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 ofstandard forms are modified, make sure that the changes are

    properly documented.

    Documentation:

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    16/38

    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

    Working With Windows:

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    17/38

    PC Editor can be invoked using Transaction SO10.

    When working with Form Painter Layout, Select theWindow to Edit, right click and Select Edit Text.

    The Graphical Editor displayed can be changed toLine Editor using the menu path GOTO ChangeEditor.

    Displays the Text Editor for the Window.

    You can Enter the Text Elements, Symbols etc.

    PC Editor :

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    18/38

    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

    Text Elements:

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    19/38

    These are Placeholders which represents data, replaced with theiroutput 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

    Symbols:

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    20/38

    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

    CONDITIONS FOR USING SYMBOLS

  • 7/31/2019 25 Kaavian SAP Script

    21/38

    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

  • 7/31/2019 25 Kaavian SAP Script

    22/38

    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

  • 7/31/2019 25 Kaavian SAP Script

    23/38

    Following tags are used in Editor to designate the commands

    Tag Meaning

    /E - 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.

    How to Define Commands ?

  • 7/31/2019 25 Kaavian SAP Script

    24/38

    SAPscriptcommands Description

    Address,

    EndaddressFormatting of address

    Bottom, Endbottom Define footer text in window

    Box, Position, Size Boxes, Lines and Shading

    Case, Endcase Case distinction

    DefineValue assignment to text

    symbols

    Hex, Endhex Hexadecimal values

    If, Endif Conditional text output

    Include Include other texts

    New-page Explicit form feed

    New-window New window main

    SAPscriptCommands Description

    Perform,

    EndperformCall ABAP subroutines

    Print-controlInsert print control

    character

    Protect,

    EndprotectProtect from page break

    ResetInitialize outline

    paragraph

    Set countryCountry-specific

    formatting

    Set date mask Formatting of date fields

    Set sign Position + / - sign

    Set time mask Formatting of time fields

    Style Change style

    Summing Summing variables

    TopSet header text in main

    window

    SAPscript Commands :

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    25/38

    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 /: 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

  • 7/31/2019 25 Kaavian SAP Script

    26/38

    SAP script Command:

    BOXES, LINES, SHADING: BOX, POSITION, SIZE

    The BOX, POSITION and SIZE commands for drawing boxes, lines andshadowing 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 orwith shadowing.

    Syntax

    1. /: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY]

    2. /: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE]

    3. /: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE]

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    27/38

    SAP script Command:

    SET DATE - /: Set date mask= date mask

    SET TIME - /: Set Time mask = HH:MM

    HEADER TEXT : /:TOP../:ENDTOP

    FOOTER TEXT : /:BOTTOM..

    /:ENDBOTTOM

    PROTECT : /: PROTECT./: ENDPROTECT

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    28/38

    SAP script Formatting :

    Changing the value of a counter Increasing or decreasing the value of a counter

    Country dependent formatting Specifying formats for country dependent values

    Date mask Formatting date fields

    Exponent for floating point

    numbers

    Specifying an exponent for floating point values

    Fill characters Replacing leading spaces with fill characters

    Ignoring conversion rules Ignoring conversion rules from Dictionary

    Leading sign to the left Leading sign of numeric values is on the left

    Leading sign to the right Leading sign of numeric values is on the right

    Number of decimals Specifying the number of decimal places

    Offset Specifying an offset of n charactersOmitting leading zeros Omitting the leading zeros

    Omitting the leading sign Omitting the leading sign of numeric values

    Omitting the separator for

    Thousands

    Omitting the separator for thousands in numeric values

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    29/38

    SAPscript Formatting:

    &SYMBOL& - Symbol value is output

    &SYMBOL+4& - Offset (Value returned from Offset)

    &SYMBOL(5)& - Width of the value

    &SYMBOL(I)& - Suppress Initial Value

    &SYMBOL(Z)& - Suppress Leading Zeros

    &SYMBOL(C)& - Condense the variable

    &SYMBOL(R)& - Right Aligned Output

    &SYMBOL(*)& - Dictionary Length

    &SYMBOL(9.2)& - Decimal Format

    &text1 SYMBOL text2& - Outputs Value preceded by text1and succeeded by text2.

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    30/38

    PRINT PROGRAM :

    R

    The Structure of a Print Program

    Retrieves dataRetrieves dataRetrieves data

    Opens layout set

    printing

    Opens layout set

    printing

    Opens layout set

    printing

    Closes layout set

    printing

    Closes layout set

    printing

    Closes layout set

    printing

    Prints output on the

    layout set

    Prints output on the

    layout set

    Prints output on thelayout set

    Changes toanother layout set

    Changes toanother layout set

    Changes to

    another layout set

    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' ...

    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' ...

    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' ...

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    31/38

    Form Functions

    Open_form - Opens form printing.

    Close_form Closes form printing.

    Write_form - Prints text elements in layout set window.

    Write_form_lines Prints text lines from table into specifiedform window.

    Start_form - To combine several different forms into one

    print output

    End_form - Ends the currently open form and Executesthe required termination processing

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    32/38

    CALL FUNCTION OPEN_FORMEXPORTINGFORM = . . .LANGUAGE = . . .DEVICE = . . .OPTIONS = . . .

    DIALOG = . . .IMPORTING

    LANGUAGE = . . .EXCEPTIONS ... = . . .

    CALL FUNCTION CLOSE_FORMIMPORTING

    RESULT = . . .EXCEPTIONS ... = . . .

    CALL FUNCTION CLOSE_FORMIMPORTING

    RESULT = . . .EXCEPTIONS ... = . . .

    CALL FUNCTION CLOSE_FORMIMPORTING

    RESULT = . . .EXCEPTIONS ... = . . .

  • 7/31/2019 25 Kaavian SAP Script

    33/38

    CALL FUNCTION START_FORMEXPORTING

    FORM = . . .LANGUAGE = . . .STARTPAGE = . . .

    IMPORTINGLANGUAGE = . . .

    EXCEPTIONS ... = . . .

    CALL FUNCTION END_FORMIMPORTING

    RESULT = . . .EXCEPTIONS ... = . . .

    CALL FUNCTION END_FORMIMPORTING

    RESULT = . . .EXCEPTIONS ... = . . .

    CALL FUNCTION END_FORM

    IMPORTINGRESULT = . . .

    EXCEPTIONS ... = . . .

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    34/38

    CALL FUNCTION'WRITE_FORM'EXPORTING

    ELEMENT =

    WINDOW =

    FUNCTION =

    TYPE =

    IMPORTINGPENDING_LINES =

    EXCEPTIONS

    ELEMENT =

    FUNCTION =

    TYPE =UNOPENED =

    UNSTARTED =

    WINDOW =

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    35/38

    Adding Graphics to Layout:

    Convert the available graphic to eitherBMP format orTIFF format.

    Invoke Transaction SE78.

    Select Category and Enter a name of the graphic image to be stored in

    Document Server.

    Click on ImportIcon.

    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 directlyplace it on the layout.

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    36/38

    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 withthe Preconfigured Client (PCC).

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    37/38

    Some of the Standard SAPscript Forms:

    Form Description Standard Form NameSales Order Confirmation RVORDER01

    Packing List RVDELNOTE

    Invoice RVINVOICE01

    Purchase Order MEDRUCK

    Prenumbered Check F110_PRENUM_CHCK

    Some of the Preconfigured SAPscript forms (for US & CANADA)

    Form Description Preconfigured Form Name

    Sales Order Confirmation YPCC_ORDCONF_STD

    Packing List YPCC_PACKLIST

    Purchase Order YPCC_CHECK_NUM

    Invoice YPCC_INVOICE_STD

    Remittance Advice YPCC_REMITT_STD

    Account Statement / Open Item List YPCC_STATEMT_STD

    Balance Carried Forward Statement /Open Item List YPCC_STMBCF_STD

    Unnumbered Check YPCC_CHECK_UNN

    Prenumbered Check YPCC_CHECK_NUM

    Kaavian Systems

  • 7/31/2019 25 Kaavian SAP Script

    38/38

    Discussion !