SlideShare a Scribd company logo
1 of 86
SAPscript




HP Restricted [edit or delete]
Prerequisites

   –   ABAP Programming Experience




                                     2
Course Goals

 –   To learn the basic concepts of SAPscript and how its various
     components interact.
 –   To learn how to create and maintain SAPscript forms
 –   To learn how to maintain and execute print programs




                                                                    3
Course Objectives

 –   At the conclusion of the training, you will be able to:
     ◦   Explain how SAPscript forms are processed
     ◦   Create and manage SAPscript forms
     ◦   Maintain print programs




                                                               4
Course Outline



 – SAPscript Introduction
  ◦ Overview, Components, and Processing
 – SAPscript Form
  ◦ Form Painter
  ◦ Form Painter Components
  ◦ Form Painter Screen Editors
 – SAPscript Print Program
  ◦ SAPscript Function Modules




                                           5
Introduction
Overview



 –   What is SAPscript?


     ◦   SAPscript is a tool used within SAP that allows us to create and
         design a business form. It also enable us to display, print, or
         distribute (via email / fax) the business forms through the ABAP Print
         Program.




                                                                                  7
Overview (cont..)



    –   Sample of Business Forms
        ◦ Invoices
        ◦ Purchase Orders
        ◦ Accounting Statements
        ◦ Payslip
        ◦ Checks
        ◦ Confirmations
        ◦ Reminders (Dunning Letters)




[                                       8
Components of SAPscript



 –   The 2 Major Components when creating a SAPscript are:
     ◦   SAPscript Form
     ◦   Print Program




                                                             9
SAPscript Forms



 –   Forms contains the layout and appearance of the document.
 –   Forms can be accessed via:
     ◦   Transaction SE71
     ◦   Menu Path: ABAP Workbench -> Tools -> Form Printout ->
         Sapscript -> Form




                                                                  10
Print Program



   –   An ABAP program where the general processing of the SAPscript
       takes place, such as:
       ◦   Allows the user to input the parameters of the data to be displayed.
       ◦ Retrieves the data from the database table.
       ◦ Specify the SAPscript Form to be displayed.
       ◦ Controls what are the text/data to be displayed.
       ◦ Controls the type of output of the SAPscript, whether it will be
           displayed, printed, emailed, or faxed.




[Rev. # or date] – HP Restricted                                                  11
SAPscript Processing



   – Listed below shows how the SAPscript is being processed and the
     interaction between the print program and the form:
   – The Print Program initializes the printing process, it retrieves the data
     from the database, and specifies the SAPscript Form to be used, as
     well as the Output Device.
   – The Document will now be formatted according to the layout
     information from the Form specified by the Print Program.
   – If the Document contains variables, these will be replaced with the
     values of the variables declared/populated by the Print Program.
   – The processing is now complete, and the completed document will be
     sent to the Output Devices as determined in the Print Program.




[Rev. # or date] – HP Restricted                                                 12
SAPscript Processing (cont..)




                                      Print
              Database
                                     Program




                                                    Output Devices
                                                      Printer
                                                      Onscreen Display
                                                      Email
                                                      Fax




                                   SAPscript Form

[Rev. # or date] – HP Restricted                                         13
SAPscript Form
SAPscript Form



 – A SAPscript Form controls the appearance of the business document.
 – It is client-dependent.




                                                                        15
Form Painter



 – This can be accessed via:
  ◦ Transaction SE71
  ◦ Menu Path: ABAP Workbench -> Tools -> Form Printout ->
    Sapscript -> Form
 – This is a graphical tool that is used to manage/create a Form Layout.




                                                                           16
Form Painter (cont..)



 –   Form Components
     ◦ Header
     ◦ Pages
     ◦ Windows
     ◦ Page Windows
     ◦ Paragraph Formats
     ◦ Character Formats




                           17
Form Components - Header



 – The Header contains the general information about the layout set
 – It consists of the Administrative Data for the form and the Basic
   Settings that can be overridden in other parts of the form.
 – Within the Basic Settings, you can input the global parameters of the
   form like, the page format (e.g. LETTER, LEGAL, DINA4 etc..), the
   page orientation (e.g. Portrait or Landscape), the default values for text
   formatting.
 – You can also assign a default paragraph and the first page.




                                                                            18
Form Components – Header (cont..)




      Administrative Data           Basic Settings




                                                     19
Form Components - Pages



 – A FORM / LAYOUT SET can have one or more pages
 – Allows a page sequence for a document
 – You must always enter a starting page in a form’s header data
 – A specific page format is defined for each form
 – SAP Script allows for automatic page numbering




                                                                   20
Form Components – Pages (cont..)




                                   21
Form Components - Window



 – The Window are the Output area found on a form, this is where the
   text are added and displayed.
 – There are three type: MAIN, CONSTANT and VARIABLE window:


  ◦ MAIN window can flow across pages.
    – Every layout set can have only one MAIN window.
    – MAIN window is created by default.
    – As soon as the MAIN window is full, it will automatically trigger a page break and continue the
      output of the remaining text in the Main Window of the subsequent pages.




                                                                                                        22
Form Components - Window (cont…)




  ◦ CONSTANT and VARIABLE windows
   – These are use only once per page.
   – The contents of the windows are processed for each page which includes this window.
   – The system outputs as much text as fits into the window, but Text exceeding the window size is
     truncated.
   – The main difference between CONSTANT and VARIABLE window is that for VARIABLE
     window, it may have different window sizes on different pages, while the CONSTANT window
     can only have a single defined window size on all pages.




                                                                                                      23
Form Components - Window (cont…)




                                   24
Form Components – Page Windows



 – A Page Window is where we specify which Window will appear on a
   Page.
 – We can also arrange the Window’s position and their sizes on the
   Page.
 – By default the Main window should be included in all Page Window.




                                                                       25
Form Components – Page Windows (cont..)




                                          26
Form Components – Paragraph



 – Used to Format texts in form. The Paragraph Formats contains all
   information needed to format the text within the window.
 – You can specify different attributes like paragraph alignment (left, right,
   centered, justified), line spacing, font formats, tab setting , bar codes,
   margins, etc…




                                                                             27
Form Components – Paragraph (cont..)



 – The “Standard” tab is where you specify the Paragraph Alignment
   (Right, Left, Center, Justified); the Line Spacing; and the Paragraph
   Margins.




                                                                           28
Form Components – Paragraph (cont..)



 – The “Font” tab is where you specify the default Paragraph Font
   Settings, such as Font Type, Size, and Attributes (such as Bold, Italics,
   or Underlined).




                                                                           29
Form Components – Paragraph (cont..)



 – The “Tabs” tab is where you specify the Tab spacing/position. In the
   PC Editor, you click the Tab button from your keyboard to go to the
   next tab position. In the Line Editor, tabs are represented by “,,” (2
   commas). This is most useful in creating tables in the Form.




                                                                            30
Form Components – Paragraph (cont..)



 – The “Outline” tab is where you specify the Outline settings (e.g. I, II, III
   …) for the given Paragraph.




                                                                                  31
Form Components - Character



 – You can specify the font types, font sizes, barcodes, superscripts,
   subscript, hidden, protected, etc…
 – You can override the paragraph settings (or the header settings) for a
   specific words within the window.




                                                                            32
Form Components – Character (cont..)




                                       33
Form Screen Editors



 – There are 2 Types of screen editors used to enter texts within the
   SAPscript windows, these are:
  ◦ PC Editor
  ◦ Line Editor




                                                                        34
Form Screen Editors – PC Editor



 – You can edit text in the PC Editor the same way you can edit text in
   any word processing system.
 – Directly assigns Paragraph and Character Formats via pushbuttons in
   the application toolbar.
 – Operates on a WYSIWYG concept (What You See Is What You Get).
   Which means it displays all applied paragraph and character format as
   you see in the editor.
 – Has an integrated syntax check for the inserted commands to avoid
   input errors.
 – This editor can be activated by Settings -> Editor Mode




                                                                          35
Form Screen Editors – Line Editor



 – The Line Editor screen contains the Format Column and the Input
   Lines.
 – The Format Columns is used to enter the Paragraph Format, and
   special types of formatting to interpret SAPscript commands.
 – The Input Lines is where you enter you text or commands.
 – Entering and formatting text using the Line Editor is different than the
   WYSIWYG concept of the PC Editor.
  ◦ The main difference is that with Line Editor, the text you entered is
    not in its final format.
  ◦ Instead the formatting is applied only when the form is printed or
    displayed.




                                                                              36
Form Content – Text-Elements



 – This are the individual components of a form, which is defined in
   different windows.
 – In each window you can use 2 types of Text-Elements. These are:
  ◦ Text Elements with Names
  ◦ Text Elements without Names




                                                                       37
Form Content – Named Text-Elements



 – The Named Text-Elements can be identified by the paragraph
   format /E in the format column for the Line Editor, or in the PC Editor,
   this line is shaded in gray.
 – The Name assigned to the Text-Element can be up to 30 characters
   and may consist of letters, numbers, and/or special characters.
 – The Text-Element name is valid locally, meaning different window can
   use the same Text-Element name.
 – The end of this type of text-element is marked by the start of the next
   text-element (the next /E line).
 – The system outputs the Named Text-Elements only if the print program
   explicitly calls them.




                                                                              38
Form Content – Nameless Text-Elements



    – The Nameless Text-Elements or Default Text-Elements are those text
      lines and control statements that appear at the beginning of the
      corresponding window contents without having the /E paragraph
      format.
    – Only 1 Nameless Text-Elements in each window.
    – The Nameless Text-Elements includes all text lines up to the next /E
      paragraph line or up to the end of the text is no /E paragraph line was
      declared.
    – The main difference between the Named and Nameless Text-Element
      are:
     ◦ The system outputs the Named Text-Elements only if the print
       program explicitly calls them using the Function Module
       WRITE_FORM.
     ◦ The system outputs the Nameless Text-Elements automatically
       whenever it processes the corresponding window.
[                                                                               39
Form Content – Symbols



 – Symbols are used to insert program and system data into the form.
 – Symbols are declared with the &<symbol>&
 – Can be added within the Editor Screen via “Insert  Symbols”
 – Type of Symbols supported by SAPscript:
  ◦ Text Symbols
  ◦ Program Symbols
  ◦ Standard Symbols
  ◦ System Symbols




                                                                       40
Form Content – Text Symbols



 – Text Symbols are defined locally within the Window.
 – These is used to define recurring terms or text fragments in the document.
 – Use the DEFINE Control Command to declare a text symbol within your
   document. And enclose the symbol with &…&
 – Then Use the path Insert  Symbols  Text Symbols to insert the symbol
   declared into any part of your window.
 – In the Line Editor, you can directly input the Text Symbol by the following:


    Example:           /:    DEFINE &name& = ‘ABAP’
                       B1    Name: &name&
                       B1    Are you really &name& ?
    Result:            Name: ABAP
                       Are you really ABAP ?


                                                                                  41
Form Content – Program Symbols



 – Program Symbols are data which came from a database table or internal
   table/variable within the Print Program.
 – You use the Print Program to provide the necessary data for the Program
   Symbols.
 – You can use the path Insert  Symbols  Program Symbols to insert the
   symbol into your form.
 – In the Line Editor, you can directly input the Program Symbol by the following:

    Example:Print Program  populates i_mara with contents
                coming from the database table mara

                       SAPscript Form: MAIN Window
                       B1    Material Number: &I_MARA-MATNR&


    Result:            Material Number: 000000123456

                                                                                     42
Form Content – Standard Symbols



 – Standard Symbols are predefined text symbol which are maintained in
   the table TTDTG.
 – Standard Symbols are language dependent, which based it in the
   language settings of your SAPscript form.
 – You can use the path Insert  Symbols  Standard to insert the
   symbol into your form.




   Example:
                   B1   &SGF& Meme
   Result:         Dear Ms. Meme


                                                                     43
Form Content – System Symbols



 – System Symbols came from global system variables
 – The different system symbols are retrieved from the following tables:
  ◦ SAPSCRIPT – these contains SAPscript form specific symbols such as
    &sapscript-formpage&, etc…
  ◦ SYST – these are the system fields in ABAP program such as &syst-
    uname&, &syst-subrc&, etc..
  ◦ TTSXY – these are the SAPscript system symbol such as &date&, &uline&…
      Example:           B1    Page: &SAPSCRIPT-FORMPAGE&
                         B1    Name: &SYST-UNAME&
                         B1    Date: &DATE&
      Result:            Page: 1
                         Name: BH8044
                         Date: 07.09.2007


                                                                           44
Form Content – Control Commands



 – The Control Commands can be use to influence the output formatting,
   such as it allows us to:
  ◦ Apply special formats into the text
  ◦ Apply condition logic
  ◦ Assign values into the Text Symbols, and many more…
 – The Control Commands are indicated by the /: Paragraph format in the
   Format column (in the Line Editor), or in the PC Editor, it is highlighted
   in gray.
 – If the Control Commands is unknown or syntactically incorrect, the
   command line is treated as a comment line, and is not interpreted or
   printed.




                                                                            45
Form Content – Control Commands (cont..)
  SAPscript Command      Description
  ADDRESS                Formatting of Addresses
  BOTTOM,                Define Footer Text in a Window
  ENDBOTTOM
  BOX, POSITION, SIZE    Boxes, Lines and Shading
  CASE, ENDCASE          Case Distinction
  DEFINE                 Value Assignment to Text Symbols
  HEX, ENDHEX            Hexadecimal Values
  IF, ENDIF              Conditional Text Output
  INCLUDE                Include Other Texts
  NEW-PAGE               Explicit Forms Feed
  NEW-WINDOW             Next Window MAIN
                                                            46
Form Content – Control Commands (cont..)

  SAPscript Command      Description
  PERFORM,               Calling ABAP Subroutines
  ENDPERFORM
  PRINT-CONTROL          Insert Print Control Characters
  PROTECT,               Protect Text from Page Break
  ENDPROTECT
  RESET                  Initialize Outline Paragraphs
  SET COUNTRY            Country Specific Formatting
  SET DATE MASK          Formatting of Date Fields
  SET SIGN               Position or +/- signs
  SET TIME MASK          Formatting of Time Fields
  STYLE                  Change Style
  SUMMING                Summing Variables
  TOP                    Set Header Text in Window MAIN
                                                           47
Form Content – Formatting Options



 – Country Dependent Formatting
  ◦ Formatting the fields based on the country settings.
  ◦ The country depended format options are stored in table T005X.
       Syntax:            /:       SET COUNTRY <country_key>


       Example:           /:    SET COUNTRY ‘CAN’




 – To revert the back the settings, use a blank country key.
  ◦ Example:               /:       SET COUNTRY ‘ ‘




                                                                     48
Form Content – Formatting Options (cont..)



 – Date Mask
  ◦ Allows us to format the date field



       Syntax:                 /:          SET DATE MASK = ‘date_mask’

       Example:                /:        SET DATE MASK = ‘MMDDYYYY’
                               B1        &SY-DATUM&
       Result:                 09012007

  ◦ If there are other characters existing other than the default date mask values, these are interpreted
    as simple text.            /:    SET DATE MASK = ‘Date, MM/DD/YYYY’
       Example:
                               B1 &SY-DATUM&
       Result:                 Date, 09/01/2007


  ◦ To revert the back the settings, use a blank date mask.
    – Example:                      /:      SET DATE MASK = ‘ ‘                                        49
Form Content – Formatting Options (cont..)


  – Time Mask
    ◦ Allows us to format the time field
      Syntax:              /:          SET TIME MASK = ‘time_mask’
      Example:             /:        SET TIME MASK = ‘HH:MM’
                           B1        &SY-UZEIT&
      Result:              11:30


    ◦ If there are other characters existing other than the default time mask values, these are
      interpreted as simple text.
      Example:             /: SET DATE MASK = ‘HH Hours MM Minutes’
                           B1 &SY-UZEIT&
      Result:              11 Hours 30 Minutes

    ◦ To revert the back the settings, use a blank date mask.
      – Example:                /:         SET TIME MASK = ‘ ‘
                                                                                           50
Form Content – Formatting Options (cont..)



 – Fill Character (F<char>)

  ◦ This formatting option replace the leading spaces of a
    field with a character.
       Syntax:                &variable(F<char>)&


   Example:                        If the field w_name contains the value ‘ Hello’.
                              B1   &w_name(F#)&
   Result:             ###Hello




                                                                                      51
Form Content – Formatting Options (cont..)



 – Leading Signs Format (< or >)
   ◦ This format option specifies the placement of the leading sign.
      Syntax:          &variable(< or >)&  – for individual variable
                       SET SIGN LEFT/RIGHT – for the whole window

Example:
    Example:            To display the the w_num leading sign to to the (100.00-)
                              To display w_num leading sign the left left (100.00-)
                       B1
                       B1   &w_num(<)&
                            &w_num(<)&

     Result:
Result:               -100.00
                -100.00

Example:
    Example:            To display the the w_num leading sign to to the (100.00-)
                              To display w_num leading sign the left left (100.00-)

                       /:
                       /:   SET SIGN LEFT
                            SET SIGN LEFT
                       B1
                       B1   &w_num&
                            &w_num&

     Result:
Result:               -100.00
                -100.00


                                                                                  52
Form Content – Formatting Options (cont..)



 – Output Length and No. of Decimals
  ◦ This format option specifies the number of characters to output.
  ◦ And also for numeric, it can specify the number of decimal character.
      Syntax:         &variable(x)&     – for output length
                      &variable(.y)&              – for decimals
                      &variable(x.y)&   – combination of both

      Example:               w_num = 12345
                     B1    &w_num(3)&
                     B1    &w_num(.2)&
                     B1    &w_num(3.2)&


      Result:         123
                      12345.00
                      123.00

                                                                        53
Form Content – Formatting Options (cont..)



 – Offset
  ◦ This format option specifies from what character value of a variable
    to be shown in the output.
  ◦ This can also be combined with the Output length and Decimal
    formats
      Syntax:         &variable+(x)&

      Example:                   w_num = 12345
                      B1      &w_num+2&
                      B1      &w_num+2(1)&
                      B1      &w_num+3(2.2)&


      Result:         345
                      3
                      45.00
                                                                           54
Form Content – Formatting Options (cont..)



 – Omitting Leading Zeros (Z)
  ◦ This format option suppressed the leading zeros before output
      Syntax:        &variable(Z)&

      Example:                  w_num = 0012
                     B1    &w_num(Z)&
      Result:        12




                                                                    55
Form Content – Formatting Options (cont..)



 – Omitting Leading Signs (S)
  ◦ This format option suppressed the leading signs before output

      Syntax:        &variable(S)&

      Example:                  w_num = 100.00-
                     B1    &w_num(S)&
      Result:        100.00




                                                                    56
Form Content – Formatting Options (cont..)



 – Omitting Thousands Separator (T)
  ◦ This format option suppressed the Thousands separator character
    before output (which are normally formatted for the data types DEC,
    CURR, INT, and QUAN)
      Syntax:         &variable(T)&

      Example:                w_num = 112,233.00
                     B1    &w_num(T)&
      Result:         112233.00




                                                                          57
Form Content – Formatting Options (cont..)



 – Suppressing Initial Values (I)
  ◦ This format option suppressed the output of the symbol that still
    contains their initial value.
     Syntax:            &variable(I)&
Example: w_num = 0      currency field, thus initial value is not space but 0.
                         B1    &w_num&
                         B1    &w_num(I)&
Result:          0.00
                 <blank>




                                                                                  58
Form Content – Formatting Options (cont..)



 – Condense (Space Compression) (C)
  ◦ This format option replaces a string of space characters into a single
    space.
  ◦ The leading spaces are completely removed.
      Syntax:         &variable(C)&

      Example:                w_name = ‘ Who        Are   You ?’
                      B1   &w_name(C)&
      Result:         Who Are You ?




                                                                         59
Form Content – Formatting Options (cont..)




Right-Justified Output (R)
 – This format options output the variable in right-justified format.
      Syntax:          &variable(R)&

     Example:                  w_name = ‘Hello’
                       B1    &w_name(R)&
     Result:                                                      Hello




                                                                          60
Form Content – Formatting Options (cont..)



 – Preceeding and Subsequent Text
  ◦ In using the variable symbols, we can also add text inside the &…&
    symbols. The advantage of using this is, if the text symbol does not
    contain a value, then the text within the & will not be shown.
      Syntax:         &’text’variable’text’&
      Example 1:      B1 NAME: &w_name&
                      w_name = ‘ABAP Team’
                      B1 &‘NAME: ’w_name&


      Result:         NAME: ABAP Team
                      NAME: ABAP Team
      Example 2:      B1 NAME: &w_name&
                      w_name = blank
                      B1 &‘NAME: ’w_name&


      Result:         NAME:
                      <no output>                                          61
Form Content – Standard Texts



 – Standard Texts are stored externally via the transaction code SO10.
 – These text can be re-used in any SAPscript forms
 – The advantage of using standard texts is that any updates made are
   automatically reflected in the SAPscript forms which uses these
   standard texts. Sample of these texts are disclaimers, header texts,
   etc…
 – In SO10, input the TEXT name, the Text ID (by default can use ST for
   Standard text), and Language Key. Upon clicking the create button,
   enter your text, save and activate.
 – To include a Standard Text in the Sapscript Editor, go to “Insert 
   Text  Standard”. Then input the TEXT name you have created in
   SO10.
 – To add the Standard Text in the SAPscript Editor, it uses the INCLUDE
   Control Command.
  ◦ Example: INCLUDE YAJC_SAPSCRIPT_TEXT01 OBJECT TEXT ID                 62
Print Program
SAPscript Print Program



   – The Print Program is an ABAP program which allows you to print the
     SAPscript form.
   – It retrieves the necessary data from the database table and combines
     it with the users input within the selection screen, then process the
     data and output it into the SAPscript form.




[Rev. # or date] – HP Restricted                                             64
Print Program Function Modules


             OPEN_FORM
                 START_FORM
                       WRITE_FORM
                       WRITE_FORM
                       ….
                 END_FORM
                 START_FORM
                       WRITE_FORM
                       WRITE_FORM
                       ….
                 END_FORM
             CLOSE_FORM



[Rev. # or date] – HP Restricted    65
Print Program FM – OPEN_FORM



   – This function module opens the SAPscript form for printing.
   – This is the first function module that needs to be executed before the
     START_FORM, and WRITE_FORM can be processed.
   – To end a form printing, you must specify the CLOSE_FORM,
     otherwise the system does not print or display anything.
   – At this function module, you need not specify the Form Name.
   – But if you did not specify the form name at this FM, you need to use
     the START_FORM function module to open the specific form for
     printing.




[Rev. # or date] – HP Restricted                                              66
Print Program FM – OPEN_FORM (cont..)



CALL FUNCTION 'OPEN_FORM'
   EXPORTING
     APPLICATION        = 'TX‘         if device is set to SCREEN, system displays text formatting on the
screen
     ARCHIVE_INDEX      = ' ‘          Enter the index information for the print output you want to archive
     ARCHIVE_PARAMS     = ' ‘          interprets the settings passed in this parameter when archiving the
output.
     DEVICE             = 'PRINTER‘    desire output device (PRINTER, MAIL, TELEFAX, SCREEN/ABAP)
     DIALOG             = 'X‘          determines whether to display a dialog box before printing
     FORM               = ' ‘          you can enter the form name here, which then controls output
formatting
     LANGUAGE           = SY-LANGU     form are language-dependent, enter desired language
     OPTIONS            = ' ‘          to set several options for printing. Allows user to change print settings
     MAIL_SENDER        = ' ‘          used for email device type
     MAIL_RECIPIENT     = ' ‘          used for email device type
     MAIL_APPL_OBJECT   = ' ‘          used for email device type
     RAW_DATA_INTERFACE = '*‘
   IMPORTING
     LANGUAGE           =              to retrieve which language variant of the form the system actually used.
     NEW_ARCHIVE_PARAMS =              results of the archiving process
     RESULT             =              results of the print formatting process
   EXCEPTIONS
     CANCELED           = 1
     …
                                                                                                                    67
Print Program FM – START_FORM



 – In between the OPEN_FORM and CLOSE_FORM function module,
   you can use different form.
 – With the use of the START_FORM/END_FORM function modules, you
   can combine several different forms into one print output.
 – You can specify the SAPscript form name within the START_FORM
   function module.
 – This function module is optional. You can skip executing the
   START_FORM/END_FORM function module by indicating the
   SAPscript form name into the OPEN_FORM function module.




                                                                   68
Print Program FM – START_FORM (cont..)




CALL FUNCTION 'START_FORM'
  EXPORTING
    ARCHIVE_INDEX    = ' ‘
    FORM             = ' ‘    name of the form you want to use for printing
    LANGUAGE         = ' ‘    form are language-dependent, enter desired language
    STARTPAGE        = ' ‘    enter the desired start-page if you want to start with other page than the default
    PROGRAM          = ' ‘    enter the program name of where the program symbols will be taken
    MAIL_APPL_OBJECT = ' '
  IMPORTING
    LANGUAGE         =        to retrieve which language variant of the form the system actually used.
  EXCEPTIONS
    FORM             = 1
    FORMAT           = 2
    UNENDED          = 3
    UNOPENED         = 4
    UNUSED           = 5
    OTHERS           = 6




                                                                                                                69
Print Program FM – WRITE_FORM



 – This function module outputs the texts of the Window and Text-
   Elements specified.
 – If the Element parameter is blank, it prints out all the Name-less text
   element within the window.
 – You should execute One (1) WRITE_FORM function module for each
   window and element that you want to output.
 – Refer to this site for documentation on the parameters of this Function
   Module.



  http://help.sap.com/saphelp_nw70/helpdata/en/d6/0dba41494511d182
  b70000e829fbfe/content.htm



                                                                             70
Print Program FM – END_FORM



 – This function module ends the currently open form and executes the
   required termination processing
 – Once this form is executed, the form that was opened by the
   START_FORM function module was closed.
 – This is an option function module. Only execute this function module if
   the START_FORM was executed.
 – This function module does not replace the CLOSE_FORM function
   module.




                                                                         71
Print Program FM – CLOSE_FORM



 – This function module closes the SAPscript processing opened by the
   OPEN_FORM function module.
 – This function module is used to close the form printing.
 – If this function module was not executed, the form will not be printed,
   emailed, or displayed.




                                                                             72
Exercise
Exercise

In this exercise, we will create a SAPscript form and a print program to
output a formatted document.
 –   The format of the output document should look like the form below:




                                                                           74
Exercise (cont..)



 –   Go to SE71 and create a form following this format:
     Z_SSCRIPT_<emp_no>




                            Z_SSCRIPT_TA0000




                                                           75
Exercise (cont..)



 – Inside the PAGES tab, let us create a page named FIRST.




                                                             76
Exercise (cont..)



 – Inside the WINDOWS tab, let us create two windows namely HEADER
   and MAIN. HEADER window will contain the CARRID and
   CARRNAME details while MAIN window will contain the rest.




 – Make sure that the window type of MAIN is MAIN and of HEADER is
   VAR.




                                                                     77
Exercise (cont..)



 – Inside the PAGE WINDOWS, map each window to a page. Thus,
   HEADER and MAIN windows should be mapped to FIRST page




                                                               78
Exercise (cont..)



 – Inside Paragraph Formats tab, create paragraph formats depending on
   the paragraph style our form requires. Specify the Standard, Font,
   Tabs, and Outline attributes as needed. In this exercise, it seems we
   only need to define one set of paragraph format for our document. Let
   us use Courier for our font.




                                                                       79
Exercise (cont..)



 – Similar with Paragraph Formats, inside the Character Formats tab,
   create character formats as necessary. It looks like we will need Bold
   characters for our document. Let us create a Bold character format




                                                                            80
Exercise (cont..)



 – Let us try to activate the form. When the Activation finds an error stating for
   example that the Page FIRST window MAIN: Window is too wide for the page
   format used, press Enter to bypass the message.
 – In this instance we can use the Graphical Form Painter to fix alignment of
   windows. We can do this by going to Transaction SE71, then Settings->Form
   Painter..




                                                                                     81
Exercise (cont..)



  –   Now we go to the print program. The program should prompt for
      CARRID for out input.




  –   From this CARRID, we need to output CARRNAME, and all CONNID,
      CITYFROM, CITYTO, and MAXSETS associated with the CARRID
      inputted.
  –   Note: The tables involved are SCARR, SPFLI, and SFLIGHT
  –   Lets go to transaction SE38 and create the Print Program. Please use
      this format in naming your object: Y_PPROGRAM_<emp_no>.


                                                                      82
Exercise (cont..)



 – After all the data is ready for output, we then invoke the SAPscript
   form by using the following function modules:
   ◦ OPEN_FORM
   ◦ START_FORM
   ◦ WRITE_FORM
   ◦ END_FORM
   ◦ CLOSE_FORM




                                                                          83
Exercise (cont..)

Reference:

* (1)TABLES: scarr, sflight, spfli.
DATA: carrid like scarr-carrid...
select * from...                      * (4) Print customer bookings
                                      LOOP AT bookings WHERE
* (2) Open form                       CALL FUNCTION 'WRITE_FORM'
CALL FUNCTION 'OPEN_FORM'             EXPORTING
EXPORTING                             ELEMENT = 'FLIGHTS'
DEVICE = 'PRINTER'                    TYPE = 'BODY'
FORM = 'Z_SSCRIPTFORM'
                                      WINDOW = 'MAIN'
DIALOG = 'X'
                                      ...
EXCEPTIONS
                                      ENDLOOP
others = 1

                                      * (5) Close form
* (3) Print table heading
                                      CALL FUNCTION 'CLOSE_FORM'
CALL FUNCTION 'WRITE_FORM'
EXPORTING
TYPE = 'TOP'
WINDOW = 'HEADING'
FUNCTION = 'SET'

                                                                      84
Exercise (cont..)



 – Finally, let us try to execute our program and print our document! 




                                                                          85
The End

More Related Content

What's hot

Sap abap modularization interview questions
Sap abap modularization interview questionsSap abap modularization interview questions
Sap abap modularization interview questionsPradipta Mohanty
 
Bdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONBdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONHitesh Gulani
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answersUttam Agrawal
 
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERSIICT Chromepet
 
Internal tables
Internal tables Internal tables
Internal tables Jibu Jose
 
Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1Panduka Bandara
 
Sap Abap Reports
Sap Abap ReportsSap Abap Reports
Sap Abap Reportsvbpc
 
Edit idoc , reprocess and test idoc
Edit idoc , reprocess and test idocEdit idoc , reprocess and test idoc
Edit idoc , reprocess and test idoclakshmi rajkumar
 
Comandos e funções em abap
Comandos e funções em abapComandos e funções em abap
Comandos e funções em abapalienscorporation
 
Introducing enhancement framework.doc
Introducing enhancement framework.docIntroducing enhancement framework.doc
Introducing enhancement framework.docKranthi Kumar
 
abap list viewer (alv)
abap list viewer (alv)abap list viewer (alv)
abap list viewer (alv)Kranthi Kumar
 

What's hot (20)

Dialog programming ABAP
Dialog programming ABAPDialog programming ABAP
Dialog programming ABAP
 
Sap abap
Sap abapSap abap
Sap abap
 
Module pool programming
Module pool programmingModule pool programming
Module pool programming
 
Badi document
Badi documentBadi document
Badi document
 
Sap abap modularization interview questions
Sap abap modularization interview questionsSap abap modularization interview questions
Sap abap modularization interview questions
 
Abap Questions
Abap QuestionsAbap Questions
Abap Questions
 
Sap abap material
Sap abap materialSap abap material
Sap abap material
 
Bdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATIONBdc BATCH DATA COMMUNICATION
Bdc BATCH DATA COMMUNICATION
 
Sap abap tutorials
Sap abap tutorialsSap abap tutorials
Sap abap tutorials
 
Bapi step-by-step
Bapi step-by-stepBapi step-by-step
Bapi step-by-step
 
Smartforms interview questions with answers
Smartforms interview questions with answersSmartforms interview questions with answers
Smartforms interview questions with answers
 
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
500+ SAP ABAP INTERVIEW QUESTIONS WITH ANSWERS
 
Internal tables
Internal tables Internal tables
Internal tables
 
Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1Beginner’s guide to sap abap 1
Beginner’s guide to sap abap 1
 
Sap Abap Reports
Sap Abap ReportsSap Abap Reports
Sap Abap Reports
 
SAP-ABAP/4@e_max
SAP-ABAP/4@e_maxSAP-ABAP/4@e_max
SAP-ABAP/4@e_max
 
Edit idoc , reprocess and test idoc
Edit idoc , reprocess and test idocEdit idoc , reprocess and test idoc
Edit idoc , reprocess and test idoc
 
Comandos e funções em abap
Comandos e funções em abapComandos e funções em abap
Comandos e funções em abap
 
Introducing enhancement framework.doc
Introducing enhancement framework.docIntroducing enhancement framework.doc
Introducing enhancement framework.doc
 
abap list viewer (alv)
abap list viewer (alv)abap list viewer (alv)
abap list viewer (alv)
 

Viewers also liked

Viewers also liked (19)

Sap sapscripts tips and tricks
Sap sapscripts tips and tricksSap sapscripts tips and tricks
Sap sapscripts tips and tricks
 
Sap script made easy
Sap script made easySap script made easy
Sap script made easy
 
Lecture15 abap on line
Lecture15 abap on lineLecture15 abap on line
Lecture15 abap on line
 
Corso ABAP OO 03
Corso ABAP OO  03Corso ABAP OO  03
Corso ABAP OO 03
 
Corso ABAP OO 04
Corso ABAP OO  04Corso ABAP OO  04
Corso ABAP OO 04
 
Corso ABAP OO 01
Corso ABAP OO   01Corso ABAP OO   01
Corso ABAP OO 01
 
Corso ABAP OO 02
Corso ABAP OO   02Corso ABAP OO   02
Corso ABAP OO 02
 
Object oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAPObject oriented approach to ALV Lists in ABAP
Object oriented approach to ALV Lists in ABAP
 
SAP WEBDYNPRO ABAP TRAINING
SAP WEBDYNPRO ABAP TRAININGSAP WEBDYNPRO ABAP TRAINING
SAP WEBDYNPRO ABAP TRAINING
 
SAP Landscape 2014
SAP Landscape 2014SAP Landscape 2014
SAP Landscape 2014
 
Workbench and customising request
Workbench and customising requestWorkbench and customising request
Workbench and customising request
 
Abap package concept
Abap package conceptAbap package concept
Abap package concept
 
Clients in sap
Clients in sapClients in sap
Clients in sap
 
Sap system landscape best practice
Sap system landscape best practiceSap system landscape best practice
Sap system landscape best practice
 
Sap abap ppt
Sap abap pptSap abap ppt
Sap abap ppt
 
Scenario on business transaction events
Scenario on business transaction eventsScenario on business transaction events
Scenario on business transaction events
 
Exercise in alv
Exercise in alvExercise in alv
Exercise in alv
 
Sp rao abap
Sp rao abapSp rao abap
Sp rao abap
 
Abap web dynpro
Abap   web dynproAbap   web dynpro
Abap web dynpro
 

Similar to Sapscript

sap abap training in chennai
sap abap training in chennaisap abap training in chennai
sap abap training in chennaisanjai rsamy
 
CRM WebClient UI for Interaction Center_C4H_CRM702_BB_ConfigGuide_EN_XX.doc
CRM WebClient UI for Interaction Center_C4H_CRM702_BB_ConfigGuide_EN_XX.docCRM WebClient UI for Interaction Center_C4H_CRM702_BB_ConfigGuide_EN_XX.doc
CRM WebClient UI for Interaction Center_C4H_CRM702_BB_ConfigGuide_EN_XX.docKrisStone4
 
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...marjoramg
 
How to develop_smart_forms_01
How to develop_smart_forms_01How to develop_smart_forms_01
How to develop_smart_forms_01Rafael Rocha
 
Maintaining comment fields directly in planning layouts using the transaction...
Maintaining comment fields directly in planning layouts using the transaction...Maintaining comment fields directly in planning layouts using the transaction...
Maintaining comment fields directly in planning layouts using the transaction...Janakiram Yelike
 
90 Tips & Tricks Every SAP Super User Should Know - Submitted.pdf
90 Tips & Tricks Every SAP Super User Should Know - Submitted.pdf90 Tips & Tricks Every SAP Super User Should Know - Submitted.pdf
90 Tips & Tricks Every SAP Super User Should Know - Submitted.pdfRahulSinha756887
 
Acumatica ERP 4.1 Customization Guide
Acumatica ERP 4.1 Customization GuideAcumatica ERP 4.1 Customization Guide
Acumatica ERP 4.1 Customization Guidedaloe
 
Abap interview questions and answers
Abap interview questions and answersAbap interview questions and answers
Abap interview questions and answersKaustav Pyne
 
Zebra -bar one label printing
Zebra -bar one label printingZebra -bar one label printing
Zebra -bar one label printingMax Santolaya
 
Programming Interface & SAP BDC
Programming Interface & SAP BDCProgramming Interface & SAP BDC
Programming Interface & SAP BDCSyam Sasi
 
Computer basic course
Computer basic courseComputer basic course
Computer basic coursedipalihalder
 

Similar to Sapscript (20)

Spool Admin
Spool AdminSpool Admin
Spool Admin
 
12 Smartforms. .pptx
12 Smartforms.                     .pptx12 Smartforms.                     .pptx
12 Smartforms. .pptx
 
SAP Smart forms
SAP Smart formsSAP Smart forms
SAP Smart forms
 
sap abap training in chennai
sap abap training in chennaisap abap training in chennai
sap abap training in chennai
 
Sap abap
Sap abapSap abap
Sap abap
 
CRM WebClient UI for Interaction Center_C4H_CRM702_BB_ConfigGuide_EN_XX.doc
CRM WebClient UI for Interaction Center_C4H_CRM702_BB_ConfigGuide_EN_XX.docCRM WebClient UI for Interaction Center_C4H_CRM702_BB_ConfigGuide_EN_XX.doc
CRM WebClient UI for Interaction Center_C4H_CRM702_BB_ConfigGuide_EN_XX.doc
 
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
Connect 2014 AD209 - Making Your Development Team More Productive With IBM Do...
 
How to develop_smart_forms_01
How to develop_smart_forms_01How to develop_smart_forms_01
How to develop_smart_forms_01
 
Maintaining comment fields directly in planning layouts using the transaction...
Maintaining comment fields directly in planning layouts using the transaction...Maintaining comment fields directly in planning layouts using the transaction...
Maintaining comment fields directly in planning layouts using the transaction...
 
90 Tips & Tricks Every SAP Super User Should Know - Submitted.pdf
90 Tips & Tricks Every SAP Super User Should Know - Submitted.pdf90 Tips & Tricks Every SAP Super User Should Know - Submitted.pdf
90 Tips & Tricks Every SAP Super User Should Know - Submitted.pdf
 
Acumatica ERP 4.1 Customization Guide
Acumatica ERP 4.1 Customization GuideAcumatica ERP 4.1 Customization Guide
Acumatica ERP 4.1 Customization Guide
 
Abap sample
Abap sampleAbap sample
Abap sample
 
Abap interview questions and answers
Abap interview questions and answersAbap interview questions and answers
Abap interview questions and answers
 
Zebra -bar one label printing
Zebra -bar one label printingZebra -bar one label printing
Zebra -bar one label printing
 
Programming Interface & SAP BDC
Programming Interface & SAP BDCProgramming Interface & SAP BDC
Programming Interface & SAP BDC
 
Computer basic course
Computer basic courseComputer basic course
Computer basic course
 
Dbms fast track 2/3
Dbms fast track 2/3Dbms fast track 2/3
Dbms fast track 2/3
 
Investment Management (IM).pdf
Investment Management (IM).pdfInvestment Management (IM).pdf
Investment Management (IM).pdf
 
ss5.ppt
ss5.pptss5.ppt
ss5.ppt
 
SAP INTRODUCTION.pptx
SAP INTRODUCTION.pptxSAP INTRODUCTION.pptx
SAP INTRODUCTION.pptx
 

Recently uploaded

Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...KokoStevan
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 

Recently uploaded (20)

Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
SECOND SEMESTER TOPIC COVERAGE SY 2023-2024 Trends, Networks, and Critical Th...
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 

Sapscript

  • 2. Prerequisites – ABAP Programming Experience 2
  • 3. Course Goals – To learn the basic concepts of SAPscript and how its various components interact. – To learn how to create and maintain SAPscript forms – To learn how to maintain and execute print programs 3
  • 4. Course Objectives – At the conclusion of the training, you will be able to: ◦ Explain how SAPscript forms are processed ◦ Create and manage SAPscript forms ◦ Maintain print programs 4
  • 5. Course Outline – SAPscript Introduction ◦ Overview, Components, and Processing – SAPscript Form ◦ Form Painter ◦ Form Painter Components ◦ Form Painter Screen Editors – SAPscript Print Program ◦ SAPscript Function Modules 5
  • 7. Overview – What is SAPscript? ◦ SAPscript is a tool used within SAP that allows us to create and design a business form. It also enable us to display, print, or distribute (via email / fax) the business forms through the ABAP Print Program. 7
  • 8. Overview (cont..) – Sample of Business Forms ◦ Invoices ◦ Purchase Orders ◦ Accounting Statements ◦ Payslip ◦ Checks ◦ Confirmations ◦ Reminders (Dunning Letters) [ 8
  • 9. Components of SAPscript – The 2 Major Components when creating a SAPscript are: ◦ SAPscript Form ◦ Print Program 9
  • 10. SAPscript Forms – Forms contains the layout and appearance of the document. – Forms can be accessed via: ◦ Transaction SE71 ◦ Menu Path: ABAP Workbench -> Tools -> Form Printout -> Sapscript -> Form 10
  • 11. Print Program – An ABAP program where the general processing of the SAPscript takes place, such as: ◦ Allows the user to input the parameters of the data to be displayed. ◦ Retrieves the data from the database table. ◦ Specify the SAPscript Form to be displayed. ◦ Controls what are the text/data to be displayed. ◦ Controls the type of output of the SAPscript, whether it will be displayed, printed, emailed, or faxed. [Rev. # or date] – HP Restricted 11
  • 12. SAPscript Processing – Listed below shows how the SAPscript is being processed and the interaction between the print program and the form: – The Print Program initializes the printing process, it retrieves the data from the database, and specifies the SAPscript Form to be used, as well as the Output Device. – The Document will now be formatted according to the layout information from the Form specified by the Print Program. – If the Document contains variables, these will be replaced with the values of the variables declared/populated by the Print Program. – The processing is now complete, and the completed document will be sent to the Output Devices as determined in the Print Program. [Rev. # or date] – HP Restricted 12
  • 13. SAPscript Processing (cont..) Print Database Program Output Devices Printer Onscreen Display Email Fax SAPscript Form [Rev. # or date] – HP Restricted 13
  • 15. SAPscript Form – A SAPscript Form controls the appearance of the business document. – It is client-dependent. 15
  • 16. Form Painter – This can be accessed via: ◦ Transaction SE71 ◦ Menu Path: ABAP Workbench -> Tools -> Form Printout -> Sapscript -> Form – This is a graphical tool that is used to manage/create a Form Layout. 16
  • 17. Form Painter (cont..) – Form Components ◦ Header ◦ Pages ◦ Windows ◦ Page Windows ◦ Paragraph Formats ◦ Character Formats 17
  • 18. Form Components - Header – The Header contains the general information about the layout set – It consists of the Administrative Data for the form and the Basic Settings that can be overridden in other parts of the form. – Within the Basic Settings, you can input the global parameters of the form like, the page format (e.g. LETTER, LEGAL, DINA4 etc..), the page orientation (e.g. Portrait or Landscape), the default values for text formatting. – You can also assign a default paragraph and the first page. 18
  • 19. Form Components – Header (cont..) Administrative Data Basic Settings 19
  • 20. Form Components - Pages – A FORM / LAYOUT SET can have one or more pages – Allows a page sequence for a document – You must always enter a starting page in a form’s header data – A specific page format is defined for each form – SAP Script allows for automatic page numbering 20
  • 21. Form Components – Pages (cont..) 21
  • 22. Form Components - Window – The Window are the Output area found on a form, this is where the text are added and displayed. – There are three type: MAIN, CONSTANT and VARIABLE window: ◦ MAIN window can flow across pages. – Every layout set can have only one MAIN window. – MAIN window is created by default. – As soon as the MAIN window is full, it will automatically trigger a page break and continue the output of the remaining text in the Main Window of the subsequent pages. 22
  • 23. Form Components - Window (cont…) ◦ CONSTANT and VARIABLE windows – These are use only once per page. – The contents of the windows are processed for each page which includes this window. – The system outputs as much text as fits into the window, but Text exceeding the window size is truncated. – The main difference between CONSTANT and VARIABLE window is that for VARIABLE window, it may have different window sizes on different pages, while the CONSTANT window can only have a single defined window size on all pages. 23
  • 24. Form Components - Window (cont…) 24
  • 25. Form Components – Page Windows – A Page Window is where we specify which Window will appear on a Page. – We can also arrange the Window’s position and their sizes on the Page. – By default the Main window should be included in all Page Window. 25
  • 26. Form Components – Page Windows (cont..) 26
  • 27. Form Components – Paragraph – Used to Format texts in form. The Paragraph Formats contains all information needed to format the text within the window. – You can specify different attributes like paragraph alignment (left, right, centered, justified), line spacing, font formats, tab setting , bar codes, margins, etc… 27
  • 28. Form Components – Paragraph (cont..) – The “Standard” tab is where you specify the Paragraph Alignment (Right, Left, Center, Justified); the Line Spacing; and the Paragraph Margins. 28
  • 29. Form Components – Paragraph (cont..) – The “Font” tab is where you specify the default Paragraph Font Settings, such as Font Type, Size, and Attributes (such as Bold, Italics, or Underlined). 29
  • 30. Form Components – Paragraph (cont..) – The “Tabs” tab is where you specify the Tab spacing/position. In the PC Editor, you click the Tab button from your keyboard to go to the next tab position. In the Line Editor, tabs are represented by “,,” (2 commas). This is most useful in creating tables in the Form. 30
  • 31. Form Components – Paragraph (cont..) – The “Outline” tab is where you specify the Outline settings (e.g. I, II, III …) for the given Paragraph. 31
  • 32. Form Components - Character – You can specify the font types, font sizes, barcodes, superscripts, subscript, hidden, protected, etc… – You can override the paragraph settings (or the header settings) for a specific words within the window. 32
  • 33. Form Components – Character (cont..) 33
  • 34. Form Screen Editors – There are 2 Types of screen editors used to enter texts within the SAPscript windows, these are: ◦ PC Editor ◦ Line Editor 34
  • 35. Form Screen Editors – PC Editor – You can edit text in the PC Editor the same way you can edit text in any word processing system. – Directly assigns Paragraph and Character Formats via pushbuttons in the application toolbar. – Operates on a WYSIWYG concept (What You See Is What You Get). Which means it displays all applied paragraph and character format as you see in the editor. – Has an integrated syntax check for the inserted commands to avoid input errors. – This editor can be activated by Settings -> Editor Mode 35
  • 36. Form Screen Editors – Line Editor – The Line Editor screen contains the Format Column and the Input Lines. – The Format Columns is used to enter the Paragraph Format, and special types of formatting to interpret SAPscript commands. – The Input Lines is where you enter you text or commands. – Entering and formatting text using the Line Editor is different than the WYSIWYG concept of the PC Editor. ◦ The main difference is that with Line Editor, the text you entered is not in its final format. ◦ Instead the formatting is applied only when the form is printed or displayed. 36
  • 37. Form Content – Text-Elements – This are the individual components of a form, which is defined in different windows. – In each window you can use 2 types of Text-Elements. These are: ◦ Text Elements with Names ◦ Text Elements without Names 37
  • 38. Form Content – Named Text-Elements – The Named Text-Elements can be identified by the paragraph format /E in the format column for the Line Editor, or in the PC Editor, this line is shaded in gray. – The Name assigned to the Text-Element can be up to 30 characters and may consist of letters, numbers, and/or special characters. – The Text-Element name is valid locally, meaning different window can use the same Text-Element name. – The end of this type of text-element is marked by the start of the next text-element (the next /E line). – The system outputs the Named Text-Elements only if the print program explicitly calls them. 38
  • 39. Form Content – Nameless Text-Elements – The Nameless Text-Elements or Default Text-Elements are those text lines and control statements that appear at the beginning of the corresponding window contents without having the /E paragraph format. – Only 1 Nameless Text-Elements in each window. – The Nameless Text-Elements includes all text lines up to the next /E paragraph line or up to the end of the text is no /E paragraph line was declared. – The main difference between the Named and Nameless Text-Element are: ◦ The system outputs the Named Text-Elements only if the print program explicitly calls them using the Function Module WRITE_FORM. ◦ The system outputs the Nameless Text-Elements automatically whenever it processes the corresponding window. [ 39
  • 40. Form Content – Symbols – Symbols are used to insert program and system data into the form. – Symbols are declared with the &<symbol>& – Can be added within the Editor Screen via “Insert  Symbols” – Type of Symbols supported by SAPscript: ◦ Text Symbols ◦ Program Symbols ◦ Standard Symbols ◦ System Symbols 40
  • 41. Form Content – Text Symbols – Text Symbols are defined locally within the Window. – These is used to define recurring terms or text fragments in the document. – Use the DEFINE Control Command to declare a text symbol within your document. And enclose the symbol with &…& – Then Use the path Insert  Symbols  Text Symbols to insert the symbol declared into any part of your window. – In the Line Editor, you can directly input the Text Symbol by the following: Example: /: DEFINE &name& = ‘ABAP’ B1 Name: &name& B1 Are you really &name& ? Result: Name: ABAP Are you really ABAP ? 41
  • 42. Form Content – Program Symbols – Program Symbols are data which came from a database table or internal table/variable within the Print Program. – You use the Print Program to provide the necessary data for the Program Symbols. – You can use the path Insert  Symbols  Program Symbols to insert the symbol into your form. – In the Line Editor, you can directly input the Program Symbol by the following: Example:Print Program  populates i_mara with contents coming from the database table mara SAPscript Form: MAIN Window B1 Material Number: &I_MARA-MATNR& Result: Material Number: 000000123456 42
  • 43. Form Content – Standard Symbols – Standard Symbols are predefined text symbol which are maintained in the table TTDTG. – Standard Symbols are language dependent, which based it in the language settings of your SAPscript form. – You can use the path Insert  Symbols  Standard to insert the symbol into your form. Example: B1 &SGF& Meme Result: Dear Ms. Meme 43
  • 44. Form Content – System Symbols – System Symbols came from global system variables – The different system symbols are retrieved from the following tables: ◦ SAPSCRIPT – these contains SAPscript form specific symbols such as &sapscript-formpage&, etc… ◦ SYST – these are the system fields in ABAP program such as &syst- uname&, &syst-subrc&, etc.. ◦ TTSXY – these are the SAPscript system symbol such as &date&, &uline&… Example: B1 Page: &SAPSCRIPT-FORMPAGE& B1 Name: &SYST-UNAME& B1 Date: &DATE& Result: Page: 1 Name: BH8044 Date: 07.09.2007 44
  • 45. Form Content – Control Commands – The Control Commands can be use to influence the output formatting, such as it allows us to: ◦ Apply special formats into the text ◦ Apply condition logic ◦ Assign values into the Text Symbols, and many more… – The Control Commands are indicated by the /: Paragraph format in the Format column (in the Line Editor), or in the PC Editor, it is highlighted in gray. – If the Control Commands is unknown or syntactically incorrect, the command line is treated as a comment line, and is not interpreted or printed. 45
  • 46. Form Content – Control Commands (cont..) SAPscript Command Description ADDRESS Formatting of Addresses BOTTOM, Define Footer Text in a Window ENDBOTTOM BOX, POSITION, SIZE Boxes, Lines and Shading CASE, ENDCASE Case Distinction DEFINE Value Assignment to Text Symbols HEX, ENDHEX Hexadecimal Values IF, ENDIF Conditional Text Output INCLUDE Include Other Texts NEW-PAGE Explicit Forms Feed NEW-WINDOW Next Window MAIN 46
  • 47. Form Content – Control Commands (cont..) SAPscript Command Description PERFORM, Calling ABAP Subroutines ENDPERFORM PRINT-CONTROL Insert Print Control Characters PROTECT, Protect Text from Page Break ENDPROTECT RESET Initialize Outline Paragraphs SET COUNTRY Country Specific Formatting SET DATE MASK Formatting of Date Fields SET SIGN Position or +/- signs SET TIME MASK Formatting of Time Fields STYLE Change Style SUMMING Summing Variables TOP Set Header Text in Window MAIN 47
  • 48. Form Content – Formatting Options – Country Dependent Formatting ◦ Formatting the fields based on the country settings. ◦ The country depended format options are stored in table T005X. Syntax: /: SET COUNTRY <country_key> Example: /: SET COUNTRY ‘CAN’ – To revert the back the settings, use a blank country key. ◦ Example: /: SET COUNTRY ‘ ‘ 48
  • 49. Form Content – Formatting Options (cont..) – Date Mask ◦ Allows us to format the date field Syntax: /: SET DATE MASK = ‘date_mask’ Example: /: SET DATE MASK = ‘MMDDYYYY’ B1 &SY-DATUM& Result: 09012007 ◦ If there are other characters existing other than the default date mask values, these are interpreted as simple text. /: SET DATE MASK = ‘Date, MM/DD/YYYY’ Example: B1 &SY-DATUM& Result: Date, 09/01/2007 ◦ To revert the back the settings, use a blank date mask. – Example: /: SET DATE MASK = ‘ ‘ 49
  • 50. Form Content – Formatting Options (cont..) – Time Mask ◦ Allows us to format the time field Syntax: /: SET TIME MASK = ‘time_mask’ Example: /: SET TIME MASK = ‘HH:MM’ B1 &SY-UZEIT& Result: 11:30 ◦ If there are other characters existing other than the default time mask values, these are interpreted as simple text. Example: /: SET DATE MASK = ‘HH Hours MM Minutes’ B1 &SY-UZEIT& Result: 11 Hours 30 Minutes ◦ To revert the back the settings, use a blank date mask. – Example: /: SET TIME MASK = ‘ ‘ 50
  • 51. Form Content – Formatting Options (cont..) – Fill Character (F<char>) ◦ This formatting option replace the leading spaces of a field with a character. Syntax: &variable(F<char>)& Example: If the field w_name contains the value ‘ Hello’. B1 &w_name(F#)& Result: ###Hello 51
  • 52. Form Content – Formatting Options (cont..) – Leading Signs Format (< or >) ◦ This format option specifies the placement of the leading sign. Syntax: &variable(< or >)& – for individual variable SET SIGN LEFT/RIGHT – for the whole window Example: Example: To display the the w_num leading sign to to the (100.00-) To display w_num leading sign the left left (100.00-) B1 B1 &w_num(<)& &w_num(<)& Result: Result: -100.00 -100.00 Example: Example: To display the the w_num leading sign to to the (100.00-) To display w_num leading sign the left left (100.00-) /: /: SET SIGN LEFT SET SIGN LEFT B1 B1 &w_num& &w_num& Result: Result: -100.00 -100.00 52
  • 53. Form Content – Formatting Options (cont..) – Output Length and No. of Decimals ◦ This format option specifies the number of characters to output. ◦ And also for numeric, it can specify the number of decimal character. Syntax: &variable(x)& – for output length &variable(.y)& – for decimals &variable(x.y)& – combination of both Example: w_num = 12345 B1 &w_num(3)& B1 &w_num(.2)& B1 &w_num(3.2)& Result: 123 12345.00 123.00 53
  • 54. Form Content – Formatting Options (cont..) – Offset ◦ This format option specifies from what character value of a variable to be shown in the output. ◦ This can also be combined with the Output length and Decimal formats Syntax: &variable+(x)& Example: w_num = 12345 B1 &w_num+2& B1 &w_num+2(1)& B1 &w_num+3(2.2)& Result: 345 3 45.00 54
  • 55. Form Content – Formatting Options (cont..) – Omitting Leading Zeros (Z) ◦ This format option suppressed the leading zeros before output Syntax: &variable(Z)& Example: w_num = 0012 B1 &w_num(Z)& Result: 12 55
  • 56. Form Content – Formatting Options (cont..) – Omitting Leading Signs (S) ◦ This format option suppressed the leading signs before output Syntax: &variable(S)& Example: w_num = 100.00- B1 &w_num(S)& Result: 100.00 56
  • 57. Form Content – Formatting Options (cont..) – Omitting Thousands Separator (T) ◦ This format option suppressed the Thousands separator character before output (which are normally formatted for the data types DEC, CURR, INT, and QUAN) Syntax: &variable(T)& Example: w_num = 112,233.00 B1 &w_num(T)& Result: 112233.00 57
  • 58. Form Content – Formatting Options (cont..) – Suppressing Initial Values (I) ◦ This format option suppressed the output of the symbol that still contains their initial value. Syntax: &variable(I)& Example: w_num = 0  currency field, thus initial value is not space but 0. B1 &w_num& B1 &w_num(I)& Result: 0.00 <blank> 58
  • 59. Form Content – Formatting Options (cont..) – Condense (Space Compression) (C) ◦ This format option replaces a string of space characters into a single space. ◦ The leading spaces are completely removed. Syntax: &variable(C)& Example: w_name = ‘ Who Are You ?’ B1 &w_name(C)& Result: Who Are You ? 59
  • 60. Form Content – Formatting Options (cont..) Right-Justified Output (R) – This format options output the variable in right-justified format. Syntax: &variable(R)& Example: w_name = ‘Hello’ B1 &w_name(R)& Result: Hello 60
  • 61. Form Content – Formatting Options (cont..) – Preceeding and Subsequent Text ◦ In using the variable symbols, we can also add text inside the &…& symbols. The advantage of using this is, if the text symbol does not contain a value, then the text within the & will not be shown. Syntax: &’text’variable’text’& Example 1: B1 NAME: &w_name& w_name = ‘ABAP Team’ B1 &‘NAME: ’w_name& Result: NAME: ABAP Team NAME: ABAP Team Example 2: B1 NAME: &w_name& w_name = blank B1 &‘NAME: ’w_name& Result: NAME: <no output> 61
  • 62. Form Content – Standard Texts – Standard Texts are stored externally via the transaction code SO10. – These text can be re-used in any SAPscript forms – The advantage of using standard texts is that any updates made are automatically reflected in the SAPscript forms which uses these standard texts. Sample of these texts are disclaimers, header texts, etc… – In SO10, input the TEXT name, the Text ID (by default can use ST for Standard text), and Language Key. Upon clicking the create button, enter your text, save and activate. – To include a Standard Text in the Sapscript Editor, go to “Insert  Text  Standard”. Then input the TEXT name you have created in SO10. – To add the Standard Text in the SAPscript Editor, it uses the INCLUDE Control Command. ◦ Example: INCLUDE YAJC_SAPSCRIPT_TEXT01 OBJECT TEXT ID 62
  • 64. SAPscript Print Program – The Print Program is an ABAP program which allows you to print the SAPscript form. – It retrieves the necessary data from the database table and combines it with the users input within the selection screen, then process the data and output it into the SAPscript form. [Rev. # or date] – HP Restricted 64
  • 65. Print Program Function Modules OPEN_FORM START_FORM WRITE_FORM WRITE_FORM …. END_FORM START_FORM WRITE_FORM WRITE_FORM …. END_FORM CLOSE_FORM [Rev. # or date] – HP Restricted 65
  • 66. Print Program FM – OPEN_FORM – This function module opens the SAPscript form for printing. – This is the first function module that needs to be executed before the START_FORM, and WRITE_FORM can be processed. – To end a form printing, you must specify the CLOSE_FORM, otherwise the system does not print or display anything. – At this function module, you need not specify the Form Name. – But if you did not specify the form name at this FM, you need to use the START_FORM function module to open the specific form for printing. [Rev. # or date] – HP Restricted 66
  • 67. Print Program FM – OPEN_FORM (cont..) CALL FUNCTION 'OPEN_FORM' EXPORTING APPLICATION = 'TX‘  if device is set to SCREEN, system displays text formatting on the screen ARCHIVE_INDEX = ' ‘  Enter the index information for the print output you want to archive ARCHIVE_PARAMS = ' ‘  interprets the settings passed in this parameter when archiving the output. DEVICE = 'PRINTER‘  desire output device (PRINTER, MAIL, TELEFAX, SCREEN/ABAP) DIALOG = 'X‘  determines whether to display a dialog box before printing FORM = ' ‘  you can enter the form name here, which then controls output formatting LANGUAGE = SY-LANGU  form are language-dependent, enter desired language OPTIONS = ' ‘  to set several options for printing. Allows user to change print settings MAIL_SENDER = ' ‘  used for email device type MAIL_RECIPIENT = ' ‘  used for email device type MAIL_APPL_OBJECT = ' ‘  used for email device type RAW_DATA_INTERFACE = '*‘ IMPORTING LANGUAGE =  to retrieve which language variant of the form the system actually used. NEW_ARCHIVE_PARAMS =  results of the archiving process RESULT =  results of the print formatting process EXCEPTIONS CANCELED = 1 … 67
  • 68. Print Program FM – START_FORM – In between the OPEN_FORM and CLOSE_FORM function module, you can use different form. – With the use of the START_FORM/END_FORM function modules, you can combine several different forms into one print output. – You can specify the SAPscript form name within the START_FORM function module. – This function module is optional. You can skip executing the START_FORM/END_FORM function module by indicating the SAPscript form name into the OPEN_FORM function module. 68
  • 69. Print Program FM – START_FORM (cont..) CALL FUNCTION 'START_FORM' EXPORTING ARCHIVE_INDEX = ' ‘ FORM = ' ‘  name of the form you want to use for printing LANGUAGE = ' ‘  form are language-dependent, enter desired language STARTPAGE = ' ‘  enter the desired start-page if you want to start with other page than the default PROGRAM = ' ‘  enter the program name of where the program symbols will be taken MAIL_APPL_OBJECT = ' ' IMPORTING LANGUAGE =  to retrieve which language variant of the form the system actually used. EXCEPTIONS FORM = 1 FORMAT = 2 UNENDED = 3 UNOPENED = 4 UNUSED = 5 OTHERS = 6 69
  • 70. Print Program FM – WRITE_FORM – This function module outputs the texts of the Window and Text- Elements specified. – If the Element parameter is blank, it prints out all the Name-less text element within the window. – You should execute One (1) WRITE_FORM function module for each window and element that you want to output. – Refer to this site for documentation on the parameters of this Function Module. http://help.sap.com/saphelp_nw70/helpdata/en/d6/0dba41494511d182 b70000e829fbfe/content.htm 70
  • 71. Print Program FM – END_FORM – This function module ends the currently open form and executes the required termination processing – Once this form is executed, the form that was opened by the START_FORM function module was closed. – This is an option function module. Only execute this function module if the START_FORM was executed. – This function module does not replace the CLOSE_FORM function module. 71
  • 72. Print Program FM – CLOSE_FORM – This function module closes the SAPscript processing opened by the OPEN_FORM function module. – This function module is used to close the form printing. – If this function module was not executed, the form will not be printed, emailed, or displayed. 72
  • 74. Exercise In this exercise, we will create a SAPscript form and a print program to output a formatted document. – The format of the output document should look like the form below: 74
  • 75. Exercise (cont..) – Go to SE71 and create a form following this format: Z_SSCRIPT_<emp_no> Z_SSCRIPT_TA0000 75
  • 76. Exercise (cont..) – Inside the PAGES tab, let us create a page named FIRST. 76
  • 77. Exercise (cont..) – Inside the WINDOWS tab, let us create two windows namely HEADER and MAIN. HEADER window will contain the CARRID and CARRNAME details while MAIN window will contain the rest. – Make sure that the window type of MAIN is MAIN and of HEADER is VAR. 77
  • 78. Exercise (cont..) – Inside the PAGE WINDOWS, map each window to a page. Thus, HEADER and MAIN windows should be mapped to FIRST page 78
  • 79. Exercise (cont..) – Inside Paragraph Formats tab, create paragraph formats depending on the paragraph style our form requires. Specify the Standard, Font, Tabs, and Outline attributes as needed. In this exercise, it seems we only need to define one set of paragraph format for our document. Let us use Courier for our font. 79
  • 80. Exercise (cont..) – Similar with Paragraph Formats, inside the Character Formats tab, create character formats as necessary. It looks like we will need Bold characters for our document. Let us create a Bold character format 80
  • 81. Exercise (cont..) – Let us try to activate the form. When the Activation finds an error stating for example that the Page FIRST window MAIN: Window is too wide for the page format used, press Enter to bypass the message. – In this instance we can use the Graphical Form Painter to fix alignment of windows. We can do this by going to Transaction SE71, then Settings->Form Painter.. 81
  • 82. Exercise (cont..) – Now we go to the print program. The program should prompt for CARRID for out input. – From this CARRID, we need to output CARRNAME, and all CONNID, CITYFROM, CITYTO, and MAXSETS associated with the CARRID inputted. – Note: The tables involved are SCARR, SPFLI, and SFLIGHT – Lets go to transaction SE38 and create the Print Program. Please use this format in naming your object: Y_PPROGRAM_<emp_no>. 82
  • 83. Exercise (cont..) – After all the data is ready for output, we then invoke the SAPscript form by using the following function modules: ◦ OPEN_FORM ◦ START_FORM ◦ WRITE_FORM ◦ END_FORM ◦ CLOSE_FORM 83
  • 84. Exercise (cont..) Reference: * (1)TABLES: scarr, sflight, spfli. DATA: carrid like scarr-carrid... select * from... * (4) Print customer bookings LOOP AT bookings WHERE * (2) Open form CALL FUNCTION 'WRITE_FORM' CALL FUNCTION 'OPEN_FORM' EXPORTING EXPORTING ELEMENT = 'FLIGHTS' DEVICE = 'PRINTER' TYPE = 'BODY' FORM = 'Z_SSCRIPTFORM' WINDOW = 'MAIN' DIALOG = 'X' ... EXCEPTIONS ENDLOOP others = 1 * (5) Close form * (3) Print table heading CALL FUNCTION 'CLOSE_FORM' CALL FUNCTION 'WRITE_FORM' EXPORTING TYPE = 'TOP' WINDOW = 'HEADING' FUNCTION = 'SET' 84
  • 85. Exercise (cont..) – Finally, let us try to execute our program and print our document!  85

Editor's Notes

  1. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  2. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  3. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  4. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  5. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  6. [Course Title] [Module Title] [Rev. # or date] – HP Restricted
  7. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  8. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  9. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  10. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  11. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  12. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  13. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  14. [Course Title] [Module Title] [Rev. # or date] – HP Restricted
  15. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  16. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  17. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  18. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  19. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  20. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  21. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  22. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  23. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  24. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  25. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  26. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  27. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  28. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  29. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  30. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  31. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  32. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  33. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  34. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  35. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  36. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  37. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  38. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  39. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  40. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  41. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  42. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  43. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  44. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  45. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  46. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  47. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  48. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  49. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  50. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  51. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  52. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  53. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  54. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  55. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  56. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  57. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  58. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  59. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  60. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  61. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  62. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  63. [Course Title] [Module Title] [Rev. # or date] – HP Restricted
  64. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  65. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  66. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  67. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  68. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  69. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  70. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  71. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  72. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  73. [Course Title] [Module Title] [Rev. # or date] – HP Restricted
  74. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  75. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  76. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  77. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  78. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  79. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  80. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  81. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  82. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  83. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  84. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  85. [Course Title] [Module Title] [Rev. # or date] – HP Restricted Instructor notes [Copy and paste this text box on notes pages for all slides]
  86. [Course Title] [Module Title] [Rev. # or date] – HP Restricted