Top Banner

of 58

Sapscripts Doc Imp

Jul 07, 2018

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 8/18/2019 Sapscripts Doc Imp

    1/58

    SAP Scripts

  • 8/18/2019 Sapscripts Doc Imp

    2/58

    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.

    • SAP Script has two parts: one print program and anotherlayout set.

    • Print Program is written in SE38 transaction.

    • While for layout set SE71 Transaction is used.

  • 8/18/2019 Sapscripts Doc Imp

    3/58

    How SAP Script Works?

    SAP

    Document

    Layout set

    Template

    Read Data

    Print

    Form

    (Output)

    SAP Script

    Define

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

  • 8/18/2019 Sapscripts Doc Imp

    4/58

  • 8/18/2019 Sapscripts Doc Imp

    5/58

    Components of SAP Script

    SAP Document

    Output determination configuration

    Printer/Font Configuration

    Output

    Program

    Layout set Form

    • Output program: Extracts data from SAP datadictionary

    • Layout set: Formats the extracted data

    •Output determination configuration: Configures tr iggering event,timing/destination

    •Printer/ Font configuration: Configures impact/laser printer, barcode  lo o

  • 8/18/2019 Sapscripts Doc Imp

    6/58

    SAP Script Development

    Component Resource

    Output Program  ABAP resource

    Layout set  ABAP resource

    Output determinationconfiguration

    Functional resource

    Printer configuration(Impact,Thermal,Laser)

    Font configuration

    Testing

    Basis/ABAP

    Basis/ABAP

    End-user/Functional/ABAP resource.

  • 8/18/2019 Sapscripts Doc Imp

    7/58

    Layout Set elements

    Initial Screen(SE71 Transaction)

    • Header 

    • Paragraphs

    • Character strings

    • Windows• Pages

    • Page windows.

  • 8/18/2019 Sapscripts Doc Imp

    8/58

    Layout Set Elements Components

    S.O#

    P.O#

    Date

    S.O#

    P.O#

    Date

    Sold-to

    Ship-to

    Item Material# Price

    10 Part A $500

    20 Part B $350

    30 Part C $800

    Item Material# Price

    40 Part D $250

    50 Part E $400

    60 Part F $350

    70 Part G $150

    Total $2,800

    Header : General info AND default settings

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

  • 8/18/2019 Sapscripts Doc Imp

    9/58

    Structuring Pages Using Windows

    Windows

    Pages

  • 8/18/2019 Sapscripts Doc Imp

    10/58

    Layout Set Elements

    Page Windows

    • List of all the windows on the pagewith coordinates.

    • The coordinates are given by theupper left-hand corner and the

    width and length.• Note: A window which should

    appear on a page must be first

    defined under” Windows” and then

    be added to the page windows.

  • 8/18/2019 Sapscripts Doc Imp

    11/58

    Layout Set Elements

    Windows

    • Types of windows:

    - Main-Special

    -VAR –Variable

    -CONST-Constant

    • Shows list of all windows definedfor the layout set.

    •  A window can contain hard-codedtexts and the Variables to be

    printed in the window.

  • 8/18/2019 Sapscripts Doc Imp

    12/58

    Structuring Pages Using Windows

    Template Form: Windows

    Fly & Smile

    4 Truckee Way

    Durango, CO 85650

    Turnaround Inc.

    145 Apple Valley Ln.

    Ithaca, NY 14850

    Dear Sir or Madam,

    Thank you for your booking. We

    are pleased to confirm the

    following flights:

    Flight Date Depart Price

     AA 0017 07/20/98 13:15 799.00 USD

     AZ 0790 11/11/98 6:55 1644.00 USD

    LH 0400 07/21/98 6:07 387.80 USD

    LH 0400 07/28/98 6:07 398.80 USD

    Page 1

    07/15/98

  • 8/18/2019 Sapscripts Doc Imp

    13/58

    Windows and Page Windows

    Sender Date

     Ad ressee

    Footer 

    Window w i th

    b od y tex t

    Windows Form: Page w indows

    Page 1

    Page 2

  • 8/18/2019 Sapscripts Doc Imp

    14/58

    Window Types

    Sender Date

     Ad ressee

    Footer  

    W indow w i th

    bod y tex t

    Windows

    Window type: MAIN

    Windo w type: VAR

    Window type: VAR

  • 8/18/2019 Sapscripts Doc Imp

    15/58

    Main Window

    7/15/98

    Dear Si r or Madam,

     Thank you f or your book i ng. We ar epl eas ed t o conf i r m t he f ol l owi ngf l i ght s :

    F l i ght Dat e Depar t Pr i c eAA 0017 07/ 20/ 98 13: 15 799. 00 USDAZ 0790 11/ 11/ 98 6: 55 1644. 00 USD

    AA 2017 12/ 21/ 98 21: 55 799. 00 USDLH 0400 12/ 28/ 98 6: 07 398. 80 USD

    Page 1

    Page 2

     Tur nar ound I nc .145 Appl e Val l ey L n.I t haca , NY 14850

    Fl y & Smi l e4 T r uckee WayDur ango, CO 85650

    F l i ght Dat e Depar t Pr i c e- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -LH 0400 07/ 28/ 98 6: 07 398. 80 USDLH 0003 08/ 16/ 98 15: 06 990. 00 USD

     Your s f ai t hf ul l y. . .

    Layout Set Elements

  • 8/18/2019 Sapscripts Doc Imp

    16/58

    Layout Set Elements

    Windows-Text element

    •  A window can contain hard-codedtexts and the variables to be

    printed in the window.

    • Tag column: Specifies format ofthe text

    • Text l ine column: contains theactual content of the window.

    • Special characters

    - * Default paragraph

    -/: Command line

    -/* Comment l ine

    -/E Text element

    Layout set Elements

  • 8/18/2019 Sapscripts Doc Imp

    17/58

    Layout set Elements

    Windows-Text element

    • Text Element always starts withthe line /E and continues to the

    next text element (/E).

    • It is the output program ( not thelayout 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

  • 8/18/2019 Sapscripts Doc Imp

    18/58

    Layout Set Elements

    Pages

    • Shows the page flow information

    • Must define at least two pages.

    • The first page specifies the nextpage.

    • The last page recursively definesthe next page as itself.

  • 8/18/2019 Sapscripts Doc Imp

    19/58

    Pages: Attributes

    PagePage  attributesattributesPage

    Desc r ip t i on

    Next page

    P ag e c o u n ter  

    Mo d e

    In i t ia li ze cou n te r  

    In c re as e c o u n t e r  

    N o n -c h a n g in g c o u n t er  

    Nu mb e ri n g t y p e

    O u tp u t l en g thUpper case

    Nu mb e r i n g

    Pr in t a t tr ibu tes

    Resou rce nam e

    P r in t m o d e

    Page 1

     A d d res s Page

    Page 2

    NUMB ERING TYPES

     A RA B IC A rab ic n u m erals

    CHA R Fix ed c harac ter  

    L ETTER L etter s

    R O M A N R o m a n n u m er als

    NUMB ERING TYPES

     A RA B IC A rab ic n u m erals

    CHA R Fix ed c h arac ter  

    L ETTER L et ter s

    R OM A N R o m a n n u m er als

    For examp le:

    O utp u t len g th ->

    Page 1: 0001

    For examp le:

    O utp u t len g th ->

    Pag e 1: 0001

    P ap er t ra y c h o ic eP ap e r t ray c h o i c e

    O n e -s i d e d o r d o u b le -s i d ed

    pr in t ing de fau l t

    S Sim p lex m o de

    D Du p lex m o d e

    T Tu m b le m o de

    O n e -s i d ed o r d o u b le -s i d ed

    pr in t ing d e fau l t

    S Sim p lex m o de

    D Du p lex m o d e

    T Tu m b le m o de

     A tt r ib u tes Page

    Page co un te r  

    Pr in t a t tr ibu tes

    Resou rce name

    P r in t m o d e

    Mo d e

    In i t ia l ize co un ter  Inc rease co un te r  

    K eep c o u n ter u n c han g ed

    Nu mb e r i n g

    Nu mb e ri n g t y p e

    Ou tpu t l eng th

    Uppercase

    Page

    Desc r ip t i on

    Nex t p ag e

    FIRST

     A d d res s p ag e

    NEXT

    O n e -s i d e d o r d o u b le -s i d ed

    pr in t ing d e fau l t

    S Sim p lex m o de

    D Du p lex m o d e

    T Tu m b le m o de

    O n e -s i d ed o r d o u b le -s i d ed

    pr in t ing d e fau l t

    S Sim p lex m o de

    D Du p lex m o d e

    T Tu m b le m o de

    P ap er t ra y c h o ic eP ap er t ray c h o i c e

    For examp le:

    Outpu t leng th 4

    -> Pag e 1: 0001

    For examp le:

    Ou tpu t l eng th 4

    -> Pag e 1: 0001

    NUMB ERING TYPES

     A RA B IC A rab ic n u m erals

    CHA R Fix ed c harac ter  

    L ETTER L et ter s

    R O M A N R o m a n n u m e r als

    NUMB ERING TYPES

     A RA B IC A rab ic n u m erals

    CHA R Fix ed c harac ter  

    L ETTER L etter s

    R OM A N R o m a n n u m e r als

  • 8/18/2019 Sapscripts Doc Imp

    20/58

    Forms - Pages

    DIN A4 LETTER

    Horizontal

    DIN A5

    Page format Static page sequence

    Page 1 Page 2

    Next

    page

    Next page

    Static page sequenceStatic page sequencePage formatPage format

  • 8/18/2019 Sapscripts Doc Imp

    21/58

    Defining Page Windows

    Page w indow

    TopTop edgeedgeLeft edgeLeft edge

    WidthWidth

    HeightHeight

    PagePage

  • 8/18/2019 Sapscripts Doc Imp

    22/58

    Layout Set Elements Paragraphs

    • Contains all information needed toformat a paragraph of text

    • Font

    • Tabs.

  • 8/18/2019 Sapscripts Doc Imp

    23/58

    Layout Set Elements Paragraphs

    • Specifies tabs to create columns for line items

  • 8/18/2019 Sapscripts Doc Imp

    24/58

    Paragraph Formats: Standard Attributes

    Paragraph

    Lef t margin

    Righ t marg in

    In d en t 1s t l in e

    Space beforeSpace after 

     A l ignm ent

    Line spacing

    No b lan k lin es

    Page pro tec t ionNext paragraph sam e page

    Descr ipt ion

    WindowWindow

    IndentationIndentation

    Space after Space after 

    Space beforeSpace before

    Left marginLeft marginRight marginRight margin

    HD Header 1

    1.00 CM LEFT

    1.50 CM 1.00 LN

    2.00 CM

    1.50 CM

     Al ignm ent:B LOCK jus t i f ied

    CENTER centered

    LEFT aligned leftRIGHT aligned righ t

     Al ignm ent:B LOCK jus ti f ied

    CENTER centered

    LEFT aligned leftRIGHT aligned righ t

    Units of

    measurement:LN L ines

    CM Cen tim eters

    MM Mil l im eters

    IN Inches

    PT Poin ts

    TW Tw ips

    Units of

    measurement:LN LinesCM Cen tim eters

    MM Mil l im eters

    IN Inches

    PT Poin ts

    TW Tw ips

    Standard att r ibutes

    Layout Set Elements

  • 8/18/2019 Sapscripts Doc Imp

    25/58

    ayou Se e e s

    Paragraphs

    • If no font is specified, default font from the layout set set headerwil l be used.

  • 8/18/2019 Sapscripts Doc Imp

    26/58

    Elements for Structuring Texts

    Fly & Smile

    4 Truckee Way

    Durango, CO 85650

    Turnaround Inc.145 Apple Valley Ln.

    Ithaca, NY 14850

    07/15/98

    Dear Sir or Madam,

    Thank you for your booking. We are pleased to

    confirm the following flights:

    Flight Date Depart Price

     AA 0017 07/20/98 13:15 799.00 USD

     AZ 0790 11/11/98 6:55 1644.00 USD

    Yours faithfully

    ...

    ParagraphsParagraphs

    TypeType

    Layout Set Elements

  • 8/18/2019 Sapscripts Doc Imp

    27/58

    y

    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 wordswithin the paragraph.

    Ch t F t St d d Att ib t

  • 8/18/2019 Sapscripts Doc Imp

    28/58

    Character Formats: Standard Attributes

    String Description

    Protected

    Hidden

    SuperscriptSubscript

    On Off Retain

    BF Boldface

    Override header

    data or paragraph

    format settings

    Override header

    data or paragraph

    format settings

     Adopt header

    data or paragraph

    format settings

     Adopt header

    data or paragraph

    format settingsMarker 

    Bar code

    Symbolicnameof a

    bar codefrom SAPscript

    font maintenance

    Symbolicnameof a

    bar codefrom SAPscript

    font maintenance

    Standard attributes

    Layout Set Elements

  • 8/18/2019 Sapscripts Doc Imp

    29/58

    Header 

    •  Administrative info• Default settings

    • Page format: different for differentcountries/applications

    • Never change ‘Lines per inch’&‘character/inch’

    Graphical Form Painter: Page Layout

  • 8/18/2019 Sapscripts Doc Imp

    30/58

    Graphical Form Painter: Page Layout

    Opt ionsDesign / Text

    W indow

    Window

    Descr ip t ion

    Lef t m arg in

    Upper m arg inW i n d o w w i d th

    Window heigh t

    Ma in w indow

    Defaul t paragraph

    1,60 CM

    1,60 CM9,00 CM

    6,00 CM

     ADDRESS

     A d d res s

    Page

    FIRST Ad dress page

    Graph ic

    Form . ..

    MAIN*

    WINDOW1*

    WINDOW2*

    Des ign w indow A d m in is t rat ive w in d ow

    Layout Set

  • 8/18/2019 Sapscripts Doc Imp

    31/58

    Test Print

    • Menu :Utili ty>Test print• Shows the layout design of the

    layout set.

    • Test printing does not trigger theoutput program to interface with

    the layout set.

    • It simply shows the maximumlength of each of the fields being

    printed.

    Layout Set

  • 8/18/2019 Sapscripts Doc Imp

    32/58

     Activating Layout set

    • Must activate the layout set anytime a change has been made.

    Layout Set Symbols

  • 8/18/2019 Sapscripts Doc Imp

    33/58

    Layout Set Symbols

    • Symbols are placeholders for values duringprint formatting.

    • Symbols are identified by a name which is

    included in ‘&’ characters.Example: &VBAK-VBELN&.

    Symbols are case sensitive.

    Types of Symbols

  • 8/18/2019 Sapscripts Doc Imp

    34/58

    Types of Symbols

    Depending on the source, the value of a symbolcomes from, they can be categorized as below.

    System symbols

    Standard symbo ls

    Program symbols

    Text symbols

    Layout Set Symbols

  • 8/18/2019 Sapscripts Doc Imp

    35/58

    Layout Set Symbols

    • SYSTEM symbols are supplied by SAP scripts. 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 l ine

    & NAME_OF_MONTH& = Name of month

    Layout Set Symbols

  • 8/18/2019 Sapscripts Doc Imp

    36/58

    Layout Set Symbols

    • STANDARD symbol are maintained centrally in one table (TTDTG)for all SAP script users.

    • PROGRAM symbols are place holders for values which come fromthe program that calls the layout set. The symbol has to be definedin the Data dictionary and filled with values by the output program.

    Example:&kna1-name1& in the layout set will output the

    customer’s name.

    • Values of TEXT symbol are created by assignment via definestatement.

    Example: /: DEFINE &CASENUM& =‘1234’.

    Layout Set Symbols

  • 8/18/2019 Sapscripts Doc Imp

    37/58

    Layout Set Symbols

    • FORMATTING of the symbol can be done in following different ways:

    & SYMBOL+4& = Offset&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

  • 8/18/2019 Sapscripts Doc Imp

    38/58

    Layout Set Commands

    • IF..ELSE..ENDIF can be used within the layout set to controlthe flow of logic.

    • Example:

    /: IF &VBRK-VKORG(2)& EQ ‘HG’.

    /: DEFINE &PREFIX& = ‘Mr.’.

    /: ELSE./: DEFINE &PREFIX& = ‘Mrs.’.

    /: ENDIF.

    Layout Set Commands

  • 8/18/2019 Sapscripts Doc Imp

    39/58

    Layout Set Commands

    • CASE..ENDCASE command can also be used in the layout setto control the flow logic.

    • Example:

    /: CASE &VBDKL-VKORG(2)&

    /: WHEN ‘HG’

    /: Case# &’934’ vbdpl-sortkri&/: WHEN OTHERS

    /: Case # &’999’ vbdpl-sortkri&

    /: ENDCASE

    Layout Set Commands

  • 8/18/2019 Sapscripts Doc Imp

    40/58

    Layout Set Commands

    • Using the command NEW-PAGE, a page –break can be madein SAP script 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 usingthis command

    PROTECT..ENDPROTECT.

    syntax: /: PROTECT

    /: text text text/: ENDPROTECT

    Layout Set Commands

  • 8/18/2019 Sapscripts Doc Imp

    41/58

    y

    • The command ADDRESS…ENDADDRESS formats an address according tothe 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

  • 8/18/2019 Sapscripts Doc Imp

    42/58

    Layout Set Commands

    • Parameter PRIORITY defines which address lines may be omitted, ifnecessary. The possible values are as follows: A Form of AddressB Mandatory blank line 1C Mandatory blank line 2

    2 Name 23 Name 34 Name 4L country name

    S Street lineO City line

    • The parameter LINES are available for formatting the address. Possiblevalues 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 isomitted.

    Layout Set Commands

  • 8/18/2019 Sapscripts Doc Imp

    43/58

    • BOTTOM : Define footer text in a window

    • For MAIN, determine the lines also known as footer texts,

    which are always automatically output at the bottom of thatwindow.

    • Syntax:

    /:BOTTOM

    /:TEXT TEXT

    /:TEXT TEXT

    /:ENDBOTTOM.

    Layout SET Commands

  • 8/18/2019 Sapscripts Doc Imp

    44/58

    y

    • BOX, POSITION and SIZE :Boxes, lines ,shadingThe BOX,POSITION and SIZE commands draw boxes, lines and shadows.Within Any particular layoutset ,these commands specify window or passageof window text can 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]

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

    This command draws a box of the specif ied size at the specif ied position. Foreach parameter(XPOS,YPOS,WIDTH,HEIGHT ,and FRAME), both a

    measurement and a unit of measure must be specified. The INTENSITYparameter should be entered as a percentage between 0 and 100.XPOS,YPOS specify the upper left corner of the box, relative to POSITIONcommand values.

    Default is the values specified in the POSITION command.

    Frames, Lines, and Shading

  • 8/18/2019 Sapscripts Doc Imp

    45/58

    Window1

    [/ : POSITION WINDOW ]

    [/ : SIZE WIDTH 2 CM HEIGHT +40 TW]/ : BOX FRAME 10 TW

    Window2

    / : BOX INTENSITY 10

    Window3

    / : BOX HEIGHT 0 CM FRAME 20 TW

    / : BOX WIDTH 0 CM FRAME 20 TW

    Form

    Window1

    Window2

    Window3

    Calling ABAP Subroutines

  • 8/18/2019 Sapscripts Doc Imp

    46/58

    Ca g Sub out es

    /: PERFORM IN PROGRAM

    /: USING & invar1&

    /: USING & invar2&

    ……….

    /: CHANGING &o ut var1&

    ……..

    /: ENDPERFORM

    Form

    IN_TAB

    structure ITCSY

    NAME VALUE

    invar1 . . .

    invar2 . . .

    REPORT .

    FORM TABLES in_tab STRUCTURE itcsy

    out_tab STRUCTURE itcsy.

    . . .

    ENDFORM. AB AP

    report

     AB APDictionary

    Layout Set Commands

  • 8/18/2019 Sapscripts Doc Imp

    47/58

    • The date can be formatted using the command SET DATEMASK =‘…’. After formatting all date fields are output as specified. The availableformats 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

  • 8/18/2019 Sapscripts Doc Imp

    48/58

    • The time can be formatted using the command

    SETTIME MASK = ‘…’. After formatting all time fields are output asspecified. The available formats for hours, minutes and seconds

    are following.HH Hours

    MM Minutes

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

  • 8/18/2019 Sapscripts Doc Imp

    49/58

    • In SAP Script ,any text can be included at a certain position indocument using INCLUDE command.

    • Syntax:

    INCLUDE name OBJECT object id identifier PARAGRAPHparagraph LANGUAGE language.

    Example:

    INCLUDE&VBDPL-TDNAME& OBJECT VBBP ID 0001PARAGRAPH IT

    INCLUDE ‘SD_TEXT’ OBJECT TEXT ID SDVD PARAGRAPH HT

    • There are two different types of text handled in SAP script. One is APPLICATION TEXT and other one is STANDARD TEXT.

    Layout Set Commands

  • 8/18/2019 Sapscripts Doc Imp

    50/58

    • The ‘name ‘ in the Include command is always the document namefor APPLICATION TEXT and the name of standard text forSTANDARD 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 textKNVV Customer Master SD Text

    VBKA Contacts General text.

    VTTK Shipment Header TextThe ‘object’ is always ‘TEXT’ for STANDARD TEXT.

    Layout Set Commands

  • 8/18/2019 Sapscripts Doc Imp

    51/58

    • Several different text IDs can belong to one object.

    • TEXT ID

    0002 Sales document header note 1.0003 Sales document header note 2.

    Output Program

    Overview(Se38 Transaction)

  • 8/18/2019 Sapscripts Doc Imp

    52/58

    • Program retrieves the data to be printed in a Layoutset.

    • Structure of Programs

    - Stand alone-Transaction Triggered

    • Communication in between program and layout set is

    done via execution of function calls and communicationstructures.

    • Execution sequence of function calls

     – A layout set must be opened before being able tooutput data.

     – Data can be transfer as often as required.

     – At end layout set has to be closed.

    Output Program Function Call

  • 8/18/2019 Sapscripts Doc Imp

    53/58

    General Function calls:

    • CALL FUNCTION ‘OPEN_FORM’.

    • CALL FUNCTION ‘START_FORM’.

    • CALL FUNCTION ‘WRITE_FORM’.

    • CALL FUNCTION ‘END_FORM’.

    • CALL FUNCTION ‘CLOSE_FORM’.

    The Structure of a Print Program

  • 8/18/2019 Sapscripts Doc Imp

    54/58

    p ro g ram rs txexp 1.

    tab l es : scu s to m, sb o o k , ...

    s elec t * fro m ...

    .. .ca l l func t ion 'OPEN_FORM'

    ex po rt in g fo rm = ...

    .. .

    ca l l funct ion 'START_FORM' ...

    .. .

    ca l l func t ion 'WRITE_FORM'

    ex p or tin g elem en t = ...

    w i n d o w = ...

    .. .

    ca l l funct ion 'END_FORM' ...

    .. .

    ca l l funct ion 'START_FORM' ...

    .. .ca l l funct ion 'END_FORM' ...

    .. .

    ca l l funct ion 'CLOSE_FORM' ...

    Retr ieves d ata

    Opens fo rm

    pr in t ing

    Closes form

    pr in t ing

    Pr in ts ou tpu ton fo rm

    Changes to

    another form

    Output Program Function Call

  • 8/18/2019 Sapscripts Doc Imp

    55/58

    • CALL FUNCTION ‘CONTROL_FORM’.

    • CALL FUNCTION ‘READ_TEXT’.

    Calling Command Using a Program

  • 8/18/2019 Sapscripts Doc Imp

    56/58

    CALL FUNCTION 'CONTROL_FORM'

    EXPORTING

    COMMAND = . . .

    EXCEPTIONS ... = . . .

     ABAP

    program

    . . .

    CALL FUNCTION 'CONTROL_FORM'

    EXPORTINGCOMMAND = 'PROTECT'.

    CALL FUNCTION 'WRITE_FORM'

    EXPORTING

    ELEMENT = 'ITEM_LINE'.

    . . .

    CALL FUNCTION 'CONTROL_FORM'EXPORTING

    COMMAND = 'ENDPROTECT'.

    . . .

    ITEM_LINE

    Barcode Printing

  • 8/18/2019 Sapscripts Doc Imp

    57/58

    • 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 attr ibuted viathe character string.

    e.g. /: *&VBAKA-WERKS&*

    Logo Printing

  • 8/18/2019 Sapscripts Doc Imp

    58/58

    • To print a Logo ,follow the steps below:

    1. Built a Logo. This file can be a bit map or windows meta fi le.

    2. Convert the Logo to a TIFF (extension TIF) file.3. Use program RSTXLDMC to convert the TIF file to a standard

    text.

    4. Print this statement text via SAP script INCUDE command.

    e.g. /: INCLUDE ZHEX-IBMLOGO-PCL OBJECT TEXT ID ST