BC460 SAP Script

243
5/21/2018 BC460SAPScript-slidepdf.com http://slidepdf.com/reader/full/bc460-sap-script-561ab11bd0827 1/243 BC460 SAPscript Form Printing and Text Management mySAP Technology Date Training Center Instructors Education Website Participant Handbook Course Version: 2001 Q3 Course Duration: 3 Day(s) Material Number: 50066147  An SAP course - use it to learn, reference it for work  

description

BC460 SAP ABAP SAPScript

Transcript of BC460 SAP Script

  • BC460SAPscript Form Printing and Text

    ManagementmySAP Technology

    Date

    Training Center

    Instructors

    Education Website

    Participant HandbookCourse Version: 2001 Q3Course Duration: 3 Day(s)Material Number: 50066147

    An SAP course - use it to learn, reference it for work

  • Copyright

    Copyright 2004 SAP AG. All rights reserved.

    No part of this publication may be reproduced or transmitted in any form or for any purpose without theexpress permission of SAP AG. The information contained herein may be changed without prior notice.

    Some software products marketed by SAP AG and its distributors contain proprietary softwarecomponents of other software vendors.

    Trademarks

    Microsoft, WINDOWS, NT, EXCEL, Word, PowerPoint and SQL Server areregistered trademarks of Microsoft Corporation.

    IBM, DB2, OS/2, DB2/6000, Parallel Sysplex, MVS/ESA, RS/6000, AIX, S/390,AS/400, OS/390, and OS/400 are registered trademarks of IBM Corporation.

    ORACLE is a registered trademark of ORACLE Corporation. INFORMIX-OnLine for SAP and INFORMIX Dynamic ServerTM are registered trademarks

    of Informix Software Incorporated. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, the Citrix logo, ICA, Program Neighborhood, MetaFrame, WinFrame,

    VideoFrame, MultiWin and other Citrix product names referenced herein are trademarks ofCitrix Systems, Inc.

    HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C, World WideWeb Consortium, Massachusetts Institute of Technology.

    JAVA is a registered trademark of Sun Microsystems, Inc. JAVASCRIPT is a registered trademark of Sun Microsystems, Inc., used under license for

    technology invented and implemented by Netscape. SAP, SAP Logo, R/2, RIVA, R/3, SAP ArchiveLink, SAP Business Workflow, WebFlow, SAP

    EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP.com Logo and mySAP.com aretrademarks or registered trademarks of SAP AG in Germany and in several other countries allover the world. All other products mentioned are trademarks or registered trademarks of theirrespective companies.

    Disclaimer

    THESE MATERIALS ARE PROVIDED BY SAP ON AN "AS IS" BASIS, AND SAP EXPRESSLYDISCLAIMS ANY AND ALL WARRANTIES, EXPRESS OR APPLIED, INCLUDING WITHOUTLIMITATION WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULARPURPOSE, WITH RESPECT TO THESE MATERIALS AND THE SERVICE, INFORMATION, TEXT,GRAPHICS, LINKS, OR ANY OTHER MATERIALS AND PRODUCTS CONTAINED HEREIN. INNO EVENT SHALL SAP BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL,CONSEQUENTIAL, OR PUNITIVE DAMAGES OF ANY KIND WHATSOEVER, INCLUDINGWITHOUT LIMITATION LOST REVENUES OR LOST PROFITS, WHICH MAY RESULT FROMTHE USE OF THESE MATERIALS OR INCLUDED SOFTWARE COMPONENTS.

  • About This HandbookThis handbook is intended to complement the instructor-led presentation of thiscourse, and serve as a source of reference. It is not suitable for self-study.

    Typographic ConventionsAmerican English is the standard used in this handbook. The following typographicconventions are also used.

    Type Style Description

    Example text Words or characters that appear on the screen. Theseinclude field names, screen titles, pushbuttons as well asmenu names, paths, and options.

    Also used for cross-references to other documentationboth internal (in this documentation) and external (inother locations, such as SAPNet).

    Example text Emphasized words or phrases in body text, titles ofgraphics, and tables

    EXAMPLE TEXT Names of elements in the system. These include reportnames, program names, transaction codes, table names,and individual key words of a programming language,when surrounded by body text, for example SELECTand INCLUDE.

    Example text Screen output. This includes file and directory namesand their paths, messages, names of variables andparameters, and passages of the source text of a program.

    Example text Exact user entry. These are words and characters thatyou enter in the system exactly as they appear in thedocumentation.

    Variable user entry. Pointed brackets indicate that youreplace these words and characters with appropriateentries.

    2001/Q3 2004 SAP AG. All rights reserved. iii

  • About This Handbook BC460

    Icons in Body TextThe following icons are used in this handbook.

    Icon Meaning

    For more information, tips, or background

    Note or further explanation of previous point

    Exception or caution

    Procedures

    Indicates that the item is displayed in the instructorspresentation.

    iv 2004 SAP AG. All rights reserved. 2001/Q3

  • ContentsCourse Overview ...... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii

    Course Goals.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .viiCourse Objectives .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .vii

    Unit 1: SAPscripts Overview...... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1Introduction to SAPscript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2Components of SAPscript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7

    Unit 2: Form Elements ..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15Structuring Pages.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Structuring Forms... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Editing Forms ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

    Unit 3: The PC Editor and the Line Editor .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53SAPscript Editors .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54Form Elements.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

    Unit 4: Symbols and Control Commands..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85Symbols.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86Control Commands... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

    Unit 5: Print Program ..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .119Introduction to the Print Program ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .120Using the Print Program ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .124

    Unit 6: Styles ..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .157Introduction to Styles ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .158

    Unit 7: SAPscript: The Next Generation ..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .165Introduction to SAP Smart Forms ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .166Future of SAPscript. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .171

    Unit 8: Modifications in SAPscripts ..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .177Modifying the Print Program.... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .178

    2001/Q3 2004 SAP AG. All rights reserved. v

  • Contents BC460

    Modifying Forms ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .193Transporting SAPscript Objects ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .196

    Unit 9: Font Maintenance ..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .203Introduction to Font Maintenance.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .204

    Appendix 1: Appendix ..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .215

    Index ..... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .233

    vi 2004 SAP AG. All rights reserved. 2001/Q3

  • Course OverviewThis course provides you with an overview of SAPscripts. The course discussesthe various form elements and the editors that are used to write to SAPscripts, suchas PC Editor and Line Editor. This course also introduces several symbols andcontrol commands that are used to perform various operations on SAPscripts, such asformatting SAPscripts. Next, the course discusses the print program and describeshow to print using the print program. The course also describes the use of variousstyles to format SAPscripts and the modifications that you can apply to SAPscripts.Finally, the course introduces you to various fonts and their maintenance.

    Target AudienceThis course is intended for the following audiences:

    Project team Employees processing data Employees responsible for organization organizing data

    Course PrerequisitesRequired Knowledge

    BC 400 ABAP Workbench Basics

    Course GoalsThis course will prepare you to:

    Describe form printing in the context of SAP R/3 Enterprise Make changes to SAP standard forms and SAP print programs Transport SAPscript objects

    Course ObjectivesAfter completing this course, you will be able to:

    Maintain forms using SAPscript tools Use SAPscript control statements and symbols Control the print output using print programs

    2001/Q3 2004 SAP AG. All rights reserved. vii

  • Course Overview BC460

    Change print programs and forms in SAP R/3 Enterprise Use font maintenance in the SAP R/3 Enterprise

    SAP Software Component InformationThe information in this course pertains to the following SAP Software Componentsand releases:

    viii 2004 SAP AG. All rights reserved. 2001/Q3

  • Unit 1SAPscripts Overview

    Unit OverviewThis unit is designed to give an overview of SAPscript. This unit discusses howSAPscript is used and integrated into SAP R/3 Enterprise and the advantages of theintegration. Next, the unit introduces how forms interact with the print program andthe role of the composer in the interaction. Finally, the unit discusses the need fora print program to print forms.

    Unit ObjectivesAfter completing this unit, you will be able to:

    Understand SAPscripts List the advantages of SAPscripts Understand the components of SAPscripts

    Unit ContentsLesson: Introduction to SAPscript .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2Lesson: Components of SAPscript . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7

    2001/Q3 2004 SAP AG. All rights reserved. 1

  • Unit 1: SAPscripts Overview BC460

    Lesson: Introduction to SAPscript

    Lesson OverviewThis lesson introduces SAPscripts and the need for using SAPscripts. It also discussesthe advantages of using SAPscripts and explains the users perspective of SAPscripts.

    Lesson ObjectivesAfter completing this lesson, you will be able to:

    Understand SAPscripts List the advantages of SAPscripts

    Business ExampleYou are working with a garment export house that exports a large variety ofreadymade garments to various distributors across the world. As a result, the Salesand Distribution department of the export house needs to frequently create and printinvoices in a specified format. The export house is looking for options that can beused to make their task simple.

    As the Technology Head of this export house, you suggest the use of SAPscripts.Next, you need to make a presentation on SAPscripts, the need for SAPscripts, andthe advantages of SAPscripts to the management. You also need to discuss thecomponents of SAPscripts in the presentation.

    Need for SAPscript

    Figure 1: The Purpose of SAPscript

    2 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Introduction to SAPscript

    Every company needs to print documents, such as invoices and delivery notes, with auniformly defined layout.

    These documents are often created automatically.

    The basic layout of the document is predefined. But, in many cases, other data, suchas address data or purchase order items, has to be merged with the document. Thisdata might be entered manually by an employee or retrieved from a database table.

    Large quantities of these documents may have to be produced. Form printing includeslarge print runs of documents, such as pay slips, checks, order confirmations, andreminders.

    SAPscript in SAP R/3 Enterprise

    Figure 2: SAPscript in SAP R/3 Enterprise

    SAPscript is an integrated tool used to enter text and print forms in many SAPR/3 Enterprise applications, such as accounting, sales and distribution, productionplanning, and online documentation.

    2001/Q3 2004 SAP AG. All rights reserved. 3

  • Unit 1: SAPscripts Overview BC460

    Advantages of SAPscript

    Multilingual capability High performance when printing large quantities Uniform corporate design in documents Word processing scalability SAP R/3 Enterprise transport and translation connections Platform independence

    The PC editor supports Asian languages in addition to other languages. Form printingenables you to use different address layouts based on the country and use multiplecurrencies simultaneously.

    SAPscript supports a uniform design across all documents.

    Editor interfaces provide you with various functions according to the application.

    SAPscript can be run on all front-end applications supported by SAP.

    SAPscript: Users Perspective

    Figure 3: SAPscript from a Users Point of View

    A documents layout is defined in a form.

    Text modules are entered using the SAPscript Editor and stored centrally in thedatabase.

    4 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Introduction to SAPscript

    Most SAPscript users only use the Editor, which is used to type text such as letters.

    You can generate documents automatically from an ABAP program using theSAPscript programming interface.

    2001/Q3 2004 SAP AG. All rights reserved. 5

  • Unit 1: SAPscripts Overview BC460

    Lesson Summary

    You should now be able to: Understand SAPscripts List the advantages of SAPscripts

    6 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Components of SAPscript

    Lesson: Components of SAPscript

    Lesson OverviewThis lesson introduces you to the various components of SAPscript, such as formsand print programs.

    Lesson ObjectivesAfter completing this lesson, you will be able to:

    Understand the components of SAPscripts

    Business ExampleYou are working with a garment export house that exports a large variety of readymadegarments to various distributors across the world. The export house uses SAPscriptsto create and print invoices generated by the Sales and Distribution department.

    As a sales executive of the export house, you need to edit the invoices.

    Forms

    Figure 4: Forms

    A form specifies the appearance and structure of a document.

    Every SAPscript document uses a form.

    Forms contain predefined text modules with space reserved for variable data. You canuse these text modules in various applications.

    2001/Q3 2004 SAP AG. All rights reserved. 7

  • Unit 1: SAPscripts Overview BC460

    To make changes to your documents, such as moving a piece of text or changing fonts,paragraph formats, and tabs, you only need to change the form.

    To edit forms, select Tools SAPscript Form from the SAP R/3 Enterprise mainmenu.

    You can create your own form by copying and customizing existing forms.

    Print Program

    Figure 5: The Print Program

    The print program performs the following tasks:

    Controls the actual output text to the printer, screen, or fax machine Selects data from the database or from user input Selects a form and controls the text to be printed, the sequence of the text, and

    the frequency of occurrence of the text Determines various printer attributes, such as output device, number of copies,

    whether or not to print

    8 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Components of SAPscript

    Interaction Between the Components of SAPscript

    Figure 6: Processing Sequence: The Composer

    The final appearance of your document depends on the interaction between your printprogram and the form.

    The SAPscript print program initializes the printing process. Every command enteredusing the SAPscript programming interface is transferred to the composer.

    The composer receives layout information from the form specified in the printprogram. The documents are formatted according to this layout information.

    If the documents contain variables, the composer replaces these variables with datafrom SAP R/3 Enterprise or with the user data selected by the print program.

    The print program controls the completion of the form. After the form is completed,the composer places the completed document in the spool to start printing the form.

    2001/Q3 2004 SAP AG. All rights reserved. 9

  • Unit 1: SAPscripts Overview BC460

    Lesson Summary

    You should now be able to: Understand the components of SAPscripts

    10 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Unit Summary

    Unit SummaryYou should now be able to: Understand SAPscripts List the advantages of SAPscripts Understand the components of SAPscripts

    2001/Q3 2004 SAP AG. All rights reserved. 11

  • Unit Summary BC460

    12 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Test Your Knowledge

    Test Your Knowledge

    1. In which departments can SAPscript be used?Choose the correct answer(s). A Human Resources Management B Material Management C Sales and Distribution D Production Planning

    2. Which feature of SAPscript enables it to run on all front-end applicationssupported by SAP?Choose the correct answer(s). A Multilingual capability B High performance when printing large quantities C Uniform corporate design in documents D Word processing scalability E SAP R/3 Enterprise transport and translation connections F Platform independence

    3. A specifies the appearance and structure of a document.Fill in the blanks to complete the sentence.

    4. List a few functions of a print program.

    2001/Q3 2004 SAP AG. All rights reserved. 13

  • Test Your Knowledge BC460

    Answers

    1. In which departments can SAPscript be used?

    Answer: A, B, C, D

    SAPscript can be used in Human Resources Management, Material Management,Sales and Distribution, and Production Planning departments.

    2. Which feature of SAPscript enables it to run on all front-end applicationssupported by SAP?

    Answer: F

    Platform independence enables SAPscript to run on all front-end applicationssupported by SAP.

    3. A form specifies the appearance and structure of a document.

    Answer: form

    4. List a few functions of a print program.

    Answer: A print program performs the following functions:

    Controls the actual text output to the printer, screen or fax machine Selects data from the database or from user input Selects a form and controls the text to be printed, the sequence of the text,

    and the frequency of occurrence of the text Determines various printer attributes, such as output device and number of

    copies

    14 2004 SAP AG. All rights reserved. 2001/Q3

  • Unit 2Form Elements

    Unit OverviewThis unit introduces forms and their structures. Next, the unit gives an overview ofthe components of the form, such as the header, page layout, paragraph and characterformats, and documentation. The unit also describes the methods used to maintainforms and the form maintenance transaction. You can use this information to editforms.

    Unit ObjectivesAfter completing this unit, you will be able to:

    Understand pages and windows Structure pages using windows Understand form formats Identify page layouts Use Form Painter

    Unit ContentsLesson: Structuring Pages .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Lesson: Structuring Forms ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Lesson: Editing Forms .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

    2001/Q3 2004 SAP AG. All rights reserved. 15

  • Unit 2: Form Elements BC460

    Lesson: Structuring Pages

    Lesson OverviewThis lesson introduces you to pages and windows and describes how to structurepages using windows.

    Lesson ObjectivesAfter completing this lesson, you will be able to:

    Understand pages and windows Structure pages using windows

    Business ExampleYou are working with a garment export house that exports a large variety of readymadegarments to various distributors across the world. The export house uses SAPscriptsto create and print invoices generated by the Sales and Distribution department.

    You have created forms to edit the invoices created by the Sales and Distributiondepartment of your export house. The form contains various output areas calledwindows. To format the invoice, you need to organize the text of the invoice withinthe form windows using text elements and paragraphs.

    16 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Structuring Pages

    Introduction to Pages

    Figure 7: Example: Booking Confirmation

    A typical form contains the following information:

    Address Sender Body copy Business transaction data such as booking data

    The text and data is spread over several pages in a form.

    2001/Q3 2004 SAP AG. All rights reserved. 17

  • Unit 2: Form Elements BC460

    Figure 8: Forms: Pages

    A form can have one or more pages. You determine the page sequence of a documentby entering the page that follows the one you are currently on. You must always entera starting page in the header of a form.

    A specific page format, such as LETTER or DIN A4, is defined for each form.

    SAPscript allows automatic page numbering.

    18 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Structuring Pages

    Figure 9: Pages: Attributes

    Page attributes include Next page, Page counter, and Print attributes.

    The counter settings determine whether or not page numbers should increase, remainthe same, or revert to their initial value.

    The print attributes allow you to choose which paper tray you want to use and whetheror not you want to print the form on single sheets or on both sides of the sheet.

    2001/Q3 2004 SAP AG. All rights reserved. 19

  • Unit 2: Form Elements BC460

    Introduction to Windows

    Figure 10: Windows and Page Windows

    Windows can appear on numerous pages within a form. As a result, SAPscriptdifferentiates between logical windows and physical page windows.

    The user determines the location of page windows on each page by entering the sizeand position. A window can have a different size and position on different pages.

    Text that appears in page windows is defined for an entire form using the formscorresponding logical window.

    20 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Structuring Pages

    Figure 11: Window Types

    There are two types of windows in SAPscript:

    MAIN VAR

    Windows of type MAIN are used to display text that spreads across multiple pages.

    Windows of type VAR may vary in size and position for each page that they appearon. The text entered in the corresponding logical windows is always displayed oneach page where the window appears. Any text that cannot be fully displayed dueto the small size of the window is lost.

    Up to Release 4.0, windows of type CONST exist. These windows function similar tothe VAR windows.

    2001/Q3 2004 SAP AG. All rights reserved. 21

  • Unit 2: Form Elements BC460

    Figure 12: Main Window

    In main windows, variable length text is displayed, for example, all bookings of aspecific customer.

    Whenever the output area of one page is filled, SAPscript continues displaying thebody text in the main window on the next page.

    Main windows can have different heights and can be positioned differently on pageswhere they appear; but the windows must be of the same width.

    22 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Structuring Pages

    Figure 13: Defining Page Windows

    All forms have predetermined page formats, such as LETTER or DIN A4.

    The position of a page window is indicated by its distance from the top and leftedges of the page.

    The size of a page window is determined by its height and width.

    Both position and size can be defined using various units of measure, such as linesor characters.

    Figure 14: Windows and Page Windows: Attributes

    2001/Q3 2004 SAP AG. All rights reserved. 23

  • Unit 2: Form Elements BC460

    Windows and page windows are dealt with separately in the alphanumeric FormPainter.

    You can define logical windows in a form by specifying the name and type of thewindow. To specify the main window, which can contain text exceeding one page,use MAIN.

    To specify other windows of a form, use VAR in Release 4.0. In earlier releases,use CONST.

    CONST: The window has the same dimensions on all pages where the windowappears.

    VAR: The height and width of the window can vary.

    To create text for individual windows of the form, choose Text elements. The textyou create is divided into text elements that are stored with the form. You will learnabout the Text Editor in the next chapter.

    You can set a default paragraph for any window, which then applies to all textelements within the paragraph.

    You can assign logical windows to any page of your form. You can define thedistribution of page windows on a page by specifying the size and position of thewindows.

    To print labels or documents with more than one column, you can define more than onemain window on any page by selecting Edit Windows Create Main window.

    24 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Structuring Pages

    Structuring Pages Using Windows

    Figure 15: Structuring Pages Using Windows

    The various output areas found on a form page are called windows.

    You can organize text within windows using text elements and paragraphs.

    Figure 16: Structuring Pages Using Windows

    2001/Q3 2004 SAP AG. All rights reserved. 25

  • Unit 2: Form Elements BC460

    Windows on a form page display output such as addresses or detail items.

    26 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Structuring Pages

    Lesson Summary

    You should now be able to: Understand pages and windows Structure pages using windows

    2001/Q3 2004 SAP AG. All rights reserved. 27

  • Unit 2: Form Elements BC460

    Lesson: Structuring Forms

    Lesson OverviewThis lesson starts with an introduction to form elements and then describes how tostructure forms in various formats, such as paragraph and character formats. Finally, itdiscusses the various page layouts.

    Lesson ObjectivesAfter completing this lesson, you will be able to:

    Understand form formats Identify page layouts

    Business ExampleYou are working with a garment export house that exports a large variety of readymadegarments to various distributors across the world. The export house uses SAPscriptsto create and print invoices generated by the Sales and Distribution department.

    As a sales executive of the export house, you need to modify the appearance of text ininvoices printed using SAPscripts.

    Elements

    Figure 17: Forms: Elements

    28 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Structuring Forms

    The following sub-objects allow you to structure forms in SAPscript:

    Page layout Paragraph formats Character formats

    Use the Form Painter to edit the individual sub-objects of a form.

    Figure 18: Form Elements: Documentation

    Any changes that you make to a form should be documented accordingly.

    You can maintain form documentation using the Form documentation button.

    When you click this button, a list of form components, such as pages, windows, andtext elements, is displayed.

    On this screen, you can enter text describing the individual components.

    2001/Q3 2004 SAP AG. All rights reserved. 29

  • Unit 2: Form Elements BC460

    Paragraph Formats

    Figure 19: Paragraph Formats: Metric Sizes

    You can modify the appearance of text in SAPscript by changing the paragraph andcharacter formats.

    Paragraph formats define the following:

    Line spacing Vertical spacing: before and after Left margin/right margin Paragraph alignment: left or centered First line indentation Tabs Fonts Outline options

    Standard attributes Font attributes Tabs Outline attributes

    30 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Structuring Forms

    Figure 20: Paragraph Formats: Standard Attributes

    You can specify the following standard paragraph attributes:

    Left/right margin Paragraph indentation Line spacing Vertical spacing: space before or space after Paragraph alignment: left, right, centered, or justified Page protection: no automatic page break within a paragraph

    The characteristics of a paragraph are described by different attributes. ChooseStandard, Font, Tabs, or Outline to switch between various attributes.

    2001/Q3 2004 SAP AG. All rights reserved. 31

  • Unit 2: Form Elements BC460

    Figure 21: Paragraph Formats: Font Attributes

    Font attributes for paragraphs include:

    Font family, such as Courier, Helvetica or Times Roman Font size (in tenths of a point) Bold Italics Underlining, including the following additional options: spacing, thickness,

    and intensity

    You can take a particular font attribute from the general form attributes and use theattribute in the current paragraph by changing your settings to the following:

    Font family = space Font size = 0 Bold, italics, and underlining all set to Retain

    32 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Structuring Forms

    Figure 22: Paragraph Formats: Tabs

    Tab attributes control the tab positions in a paragraph.

    You can define several tab positions. To align a paragraph, you can use the followingtab positions: LEFT, RIGHT, CENTER, SIGN, or DECIMAL. In addition to the tabsof a paragraph format, standard tabs are available.

    To define the position of numbers in a paragraph, select SIGN or DECIMAL.

    SIGN allows you to define numbers, which are right-aligned at the tab position. Thisallows you to inset a minus sign or blank space at the end of the number.

    DECIMAL allows you to align decimal points with any tab position.

    2001/Q3 2004 SAP AG. All rights reserved. 33

  • Unit 2: Form Elements BC460

    Figure 23: Paragraph Formats: Outlines

    You can use the outline attributes provided by SAPscript to divide text into units, suchas chapters, subchapters and sections.

    To number paragraphs automatically, select one of the following numbering types:

    Arabic numerals, such as 1, 2, 3... Roman numerals, such as I, II, III... Letters, such as a, b, c... Fixed characters, such as *, *, *...

    You can also number text units by creating consecutive numbering levels, as shown:

    1. First level

    1.1. Second level, linked to first level

    1.2. Second level, linked to first level

    2. First level

    [...]

    34 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Structuring Forms

    Character Formats

    Figure 24: Character Formats

    You can define the following character format attributes:

    Font Font size Bold or Italics Underlining

    Standard attributes Font attributes

    2001/Q3 2004 SAP AG. All rights reserved. 35

  • Unit 2: Form Elements BC460

    Figure 25: Character Formats: Standard Attributes

    Standard character format attributes include:

    Protected: The character string cannot be broken up and the entire string isprinted on one line.

    Hidden: The character string is not printed. Superscript: The character string is printed half a line space above the line. Subscript: The character string is printed half a line space below the line. Barcode: The character string is encrypted and printed as a bar code.

    Figure 26: Character Formats: Font Attributes

    You can define font attributes by specifying the font, font size, or font style.

    To override a previously defined form header or paragraph format, choose On or Off.

    36 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Structuring Forms

    If you want the font attributes you have selected for a specific paragraph to be validfor the remainder of the form, choose Retain or leave the values for Font family andFont size blank.

    Page Layout

    Figure 27: Graphical Form Painter: Page Layout

    Page layouts can be edited in both the administrative window and the graphic designwindow.

    In the design window, you can set the size and position of display areas using dragand drop.

    The most important attributes of the current page and its windows are displayed in theadministrative window.

    2001/Q3 2004 SAP AG. All rights reserved. 37

  • Unit 2: Form Elements BC460

    Figure 28: Page Layout: Pages

    Forms can have multiple pages defined for them. A documents page sequence iscontrolled statically by the First page value entered in its header data and by the Nextpage value entered in its Page attributes.

    If no Next page value is specified, form printing ends with the current page.

    Use the Layout function from the initial Form Painter screen to call the graphical FormPainter. From the Page layout screen, you can define the pages you need. You canselect standard functions, such as Create page, Copy page, and Delete page, using theEdit Page... menu or by clicking the appropriate button on the screen.

    Additional attributes can be entered for all pages found in the list box.

    38 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Structuring Forms

    Figure 29: Page Layout: Windows and Page Windows

    The Window list displays a list of all the windows found on the current page.

    For each window, important attributes, such as position of the window on the page,window size, window type, and default paragraph, are displayed.

    A number of standard window editing functions are also available on this screen,including Create window, Copy window and Delete window.

    In addition, the Design/Text button allows you to switch between design mode andtext mode in the design window.

    In design mode, you can use your mouse to work with windows; text mode displaysthe individual window text.

    2001/Q3 2004 SAP AG. All rights reserved. 39

  • Unit 2: Form Elements BC460

    Figure 30: Page Layout: Options

    The Options button allows you to zoom in to a specific section of your page.

    In addition, you can choose to align the window automatically to the grid.

    You can also choose the unit of measure for the design window grid.

    40 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Structuring Forms

    Structuring Text

    Figure 31: Elements to Structure Text

    Various paragraph and character formats provide additional ways to structure thetext that you create.

    2001/Q3 2004 SAP AG. All rights reserved. 41

  • Unit 2: Form Elements BC460

    Lesson Summary

    You should now be able to: Understand form formats Identify page layouts

    42 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Editing Forms

    Lesson: Editing Forms

    Lesson OverviewThis lesson discusses the Form Painter.

    Lesson ObjectivesAfter completing this lesson, you will be able to:

    Use Form Painter

    Business ExampleYou are working with a garment export house that exports a large variety of readymadegarments to various distributors across the world. The export house uses SAPscriptsto create and print invoices generated by the Sales and Distribution department.

    To meet customer requirements, you need to change the format of the forms createdfor the invoices raised by the Sales and Distribution department.

    Form Painter

    Figure 32: Editing Forms

    2001/Q3 2004 SAP AG. All rights reserved. 43

  • Unit 2: Form Elements BC460

    To edit forms, select Tools Form printout SAPscript Form.

    Press F4 in the Form Name field to display a list of all existing forms.

    You can edit the following sub-objects of a form directly:

    Header Page layout Paragraph formats Character formats Documentation

    Figure 33: Editing Forms: The Form Painter

    From Release 4.0, a new Form Painter with graphical interface is available for moreintuitive and faster form creation.

    You can continue to use the alphanumeric Form Painter to create forms because all theform creation functions are available in the alphanumeric Form Painter.

    In the maintenance transaction of the graphical Form Painter, theWindows, Pages,and Page windows components from the alphanumeric Form Painter are consolidatedinto one component called Layout.

    Note: The graphical Form Painter is available from Release 4.0 for personalcomputers running either Windows NT 4.0 or Windows 95. Otherwise youare working with the alphanumeric Form Painter.

    44 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Editing Forms

    Figure 34: Form Painter: Maintenance Screen Structure

    The Form Painter maintenance screen contains the following:

    Element types, such as pages List of elements, such as a list of windows for this page List of attributes, such as a list of attributes for each window; position, size,

    and window type

    Header Data

    Figure 35: Header Data: Organization

    2001/Q3 2004 SAP AG. All rights reserved. 45

  • Unit 2: Form Elements BC460

    You must enter the following items in the header of each form:

    A short text describing the form. A default paragraph format. The formats attributes can be edited using the

    Paragraph formats function. A default value for tabs. A first page. The page attributes are defined using the Layout function in the

    graphical Form Painter and the Pages function in the alphanumeric Form Painter. Page size, page format, and orientation. Line spacing and character spacing. Form attributes, such as tab stops or line

    spacing, can be defined using more than one type of unit. If you use the units,CH (character) or LN (line), measurements are automatically converted to linesper inch (LPI) or characters per inch (CPI).

    Font attributes, such as font, font size, bold, italics, or underlining.

    When creating a new form, you should always assign a description of what yourform is to be used for.

    Figure 36: Header Data: Administrative Data

    Administrative information, such as a forms name, client, language and the date whenthe form was last changed, is displayed under Administrative Data.

    46 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Editing Forms

    A form can have the following status:

    New: Represents a form that has just been created and is not yet ready to beprinted.

    Active: Represents a form that is ready to be printed. To set the status of aform to active, select Form Activate.

    Revised: Represents a form that is revised and saved. Whenever you print theform, SAP R/3 Enterprise continues to use the Active version of the form.

    To undo any unwanted changes made to a form, select Utilities Reset.

    Figure 37: Header Data: Basic Settings

    Standard settings, such as first page, page format, default paragraph, tab stops, fontfamily, and font size, can be made under Basic Settings.

    Both the first page setting and the default paragraph setting are mandatory and mustbe defined by the user.

    Header data settings take effect only if no other settings have been made for thatcomponent. For example, consider a situation where you want to use a defaultparagraph in a particular window. If no default paragraph has been specified in thewindows attributes, the system automatically uses the default paragraph set in theheader data.

    2001/Q3 2004 SAP AG. All rights reserved. 47

  • Unit 2: Form Elements BC460

    Lesson Summary

    You should now be able to: Use Form Painter

    48 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Unit Summary

    Unit SummaryYou should now be able to: Understand pages and windows Structure pages using windows Understand form formats Identify page layouts Use Form Painter

    2001/Q3 2004 SAP AG. All rights reserved. 49

  • Unit Summary BC460

    50 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Test Your Knowledge

    Test Your Knowledge

    1. Main windows cannot have different heights and cannot be positioned differentlyon pages where they appear.Determine whether this statement is true or false. True False

    2. Which sub-objects allow you to structure pages in SAPscript?Choose the correct answer(s). A Page layout B Paragraph formats C Character formats D Windows

    3. You can organize text within windows using text elements and.

    Fill in the blanks to complete the sentence.

    4. Which sub-objects allow you to structure forms in SAPscript?Choose the correct answer(s). A Font B Page layout C Paragraph formats D Character formats

    5. Page layouts can be edited in the administrative window and thewindow.

    Fill in the blanks to complete the sentence.

    6. The functions used to create a form are available in the.

    Fill in the blanks to complete the sentence.

    2001/Q3 2004 SAP AG. All rights reserved. 51

  • Test Your Knowledge BC460

    Answers

    1. Main windows cannot have different heights and cannot be positioned differentlyon pages where they appear.

    Answer: False

    Main windows can have different heights and can be positioned differentlyon pages where they appear.

    2. Which sub-objects allow you to structure pages in SAPscript?

    Answer: A, B, C

    Page layout, paragraph formats, and character formats allow you to structureforms in SAPscript.

    3. You can organize text within windows using text elements and paragraphs.

    Answer: paragraphs

    4. Which sub-objects allow you to structure forms in SAPscript?

    Answer: B, C, D

    Page layout, paragraph formats, and character formats allow you to structureforms in SAPscripts.

    5. Page layouts can be edited in the administrative window and the graphic designwindow.

    Answer: graphic design

    6. The functions used to create a form are available in the alphanumeric FormPainter.

    Answer: alphanumeric Form Painter

    52 2004 SAP AG. All rights reserved. 2001/Q3

  • Unit 3The PC Editor and the Line Editor

    Unit OverviewThis unit discusses the various editors used to enter text in SAPscript, PC Editor andLine Editor. Next, the unit discusses the difference between the two editors. The unitalso describes named text elements and highlights the advantages of these elements.

    Unit ObjectivesAfter completing this unit, you will be able to:

    Learn about the SAPscript editors Identify the operation of the SAPscript editors Learn about form elements

    Unit ContentsLesson: SAPscript Editors ... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    Exercise 1: SAPscript Editors... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67Lesson: Form Elements... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

    2001/Q3 2004 SAP AG. All rights reserved. 53

  • Unit 3: The PC Editor and the Line Editor BC460

    Lesson: SAPscript Editors

    Lesson OverviewThis lesson introduces you to the various SAPscript editors used to write to aSAPscript, such as PC Editor and Line Editor. It also describes how SAPscripteditors work.

    Lesson ObjectivesAfter completing this lesson, you will be able to:

    Learn about the SAPscript editors Identify the operation of the SAPscript editors

    Business ExampleYou are working with a garment export house that exports a large variety of readymadegarments to various distributors across the world. The export house uses SAPscriptsto create invoices generated by the Sales and Distribution department.

    To create an invoice, you need to enter text in SAPscript. To do this, you need to usethe two editors provided by SAPscript, PC Editor and Line Editor.

    54 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: SAPscript Editors

    PC Editor

    Figure 38: PC Editor and Line Editor

    Two editors are available in SAPscript to enter text, the PC editor and the line editor.

    To use the PC editor, your operating system must meet several requirements. Yourcomputer must be running Windows NT 4.0 or Windows95. The PC editor alsorequires various DLL and OCX files, which are automatically installed by the SAPGUI. Users do not need to install any of these files.

    A dialog box prompts to install the most current versions of these DLL and OCX files.

    From the Standard Text: Request screen, you can choose which editor you want towork with. Select Go to Change editor from within one editor to change to theother.

    2001/Q3 2004 SAP AG. All rights reserved. 55

  • Unit 3: The PC Editor and the Line Editor BC460

    Figure 39: PC and Line Editor Operations

    Use the PC editor and the line editor to enter long text such as materials text, standardtext, or text in forms.

    The major advantage of the PC editor is that all its functions can be used by clickingthe buttons. Paragraph and character format assignments can be made using buttonsand any changes made are immediately displayed on the screen. SAPscript navigationcommands are also automatically tested using an integrated syntax check.

    In the line editor, paragraph formats are assigned using the tag column. Characterformats can be found in the menu. You need to use the menu to display the attributesof individual formats. You can select text by double-clicking the text or by clicking aspecial button. Special text structures are also identified in the tag column.

    From Release 4.0A, an integrated syntax check is also available in the line editor.

    56 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: SAPscript Editors

    Figure 40: The PC Editor

    The PC editor is similar to other common text editors and functions according to theWhat You See Is What You Get (WYSIWYG) principle. PC editor operations arecalled using buttons and menu functions.

    The paragraph format and character format buttons allow you to assign paragraph andcharacter formats to the text, according to what is selected.

    Figure 41: Entering Text in the PC Editor

    2001/Q3 2004 SAP AG. All rights reserved. 57

  • Unit 3: The PC Editor and the Line Editor BC460

    The PC editor provides automatic word wraparound.

    To create a new paragraph, position the cursor and press ENTER. If no paragraphformat has been used up to this point, the new paragraph is formatted according tothe default paragraph settings. Otherwise, the new paragraph takes the format of theone immediately preceding it.

    To insert a line break within a paragraph, use SHIFT+ENTER.

    Within a paragraph, your text automatically wraps when it reaches the right edge ofyour window.

    Figure 42: Assigning Paragraph and Character Formats

    You can use the PC editor to format paragraphs. The paragraph and character formatsavailable are visible on the screen in the PC editor.

    Select the text you want to format. Select the paragraph or character format you wantto apply to the text either by clicking the corresponding button on the screen or byselecting Format Paragraph and Format Character.

    To reset the format, select Edit Selected area Last character format EditSelected area Last paragraph format.

    58 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: SAPscript Editors

    Line Editor

    Figure 43: Outputting Text Using the PC Editor

    To display text, select Text Print from the PC editor or Standard text Print fromthe Standard Text: Request dialog box.

    From the PC editor menu, you can choose between Printing and Print preview.

    In the subsequent dialog box, you can specify various print parameters, such as theoutput device, the number of copies or pages, and several parameters for print control,such as print immediately.

    To display the output on the screen, select Print preview. To start printing to theselected output device, select Print on this screen.

    2001/Q3 2004 SAP AG. All rights reserved. 59

  • Unit 3: The PC Editor and the Line Editor BC460

    Figure 44: The Line Editor

    The title bar in the line editor displays the name of the current editing action and thetext being edited.

    The menu bar provides various application functions, such as Save or Print.

    The tag column contains the format ID or tag that determines how the text will beformatted for output. Enter the desired paragraph formats here.

    The status bar provides status information about various editing functions, such as:

    The form currently being edited The line segment (screen line or total number of lines) The text currently selected The paragraph and character formats used recently

    60 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: SAPscript Editors

    Figure 45: Entering Text in the Line Editor

    To create a new paragraph, position the cursor and press ENTER. An asterisk (*) inthe tag column indicates the default paragraph format. The new paragraph has thesame format as the preceding one.

    To insert a line break within a paragraph, use F6. A slash (/) in the tag columnindicates this line break.

    The editor provides automatic word wraparound when you:

    Choose a function key. Choose a menu function. Press ENTER. Choose Format.

    To merge two paragraphs:

    1. Use blank spaces to overwrite the key in the tag column.

    2. Choose Format.

    To delete blank lines or merge separate lines:

    1. Use blank spaces to overwrite the format key /.

    2. Choose Format.

    2001/Q3 2004 SAP AG. All rights reserved. 61

  • Unit 3: The PC Editor and the Line Editor BC460

    Figure 46: Inserting Text in the Line Editor

    To insert text, position the cursor and choose Insert. The title bar shows that theInsert mode is active.

    The Insert mode displays blank lines. Enter the text to be inserted.

    The paragraph format remains the same when text is inserted, although you canchange this format.

    To exit the Insert mode, choose End insert. The system returns to the original modeand inserts the new text at the cursor position.

    62 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: SAPscript Editors

    Figure 47: Selecting Text in the Line Editor

    You can select text in the line editor either by double-clicking the text or by clickingthe Select button.

    When using the Select button, place your cursor at the beginning of the text you wantto select and then click the button. Then, place your cursor at the end of the text youwant to select and click the Select button. This selects the area you want to edit.

    The system automatically starts the select mode after you have set the first selectmarker with your cursor. Selected text is highlighted in a different color. The area youhave selected is also displayed in the status bar at the bottom of the page.

    You can also select lines by double-clicking the lines entry in the tag column.Additional clicks in the tag column increase the size of the area you have selected.

    2001/Q3 2004 SAP AG. All rights reserved. 63

  • Unit 3: The PC Editor and the Line Editor BC460

    Figure 48: Selecting, Cutting, and Copying Text

    The select function allows you to delete or copy entire text passages.

    When you select the text and choose Cut or Copy, the text is copied to the clipboard:

    Cut deletes the marked text. Copy does not delete the marked text. When you cut or copy text, the previous contents of the clipboard are deleted.

    To insert the contents of the clipboard, position the cursor and choose Paste.

    To copy text to a different editor, use the clipboard.

    There are three user clipboards that you can use to save text. Select Go to UserClipboard to select a different clipboard.

    64 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: SAPscript Editors

    Using SAPscript Editors

    Figure 49: Paragraph and Character Formatting

    You can organize text using the paragraph and character formats that are available inthe current form.

    To apply paragraph and character formats, select Format Paragraph or FormatCharacter. The dialog box displays the format key, its description, and its attributes.In this dialog box, you can display the attributes of the different formats.

    Enter the paragraph keys in the tag column. You can change or delete format keys thathave already been entered. To display a list of possible paragraph formats, pressF4.

    To format a character string, enter .... NN refers to a one- or two-characterkey.

    When marking a character sequence, the system formats the word at the cursorposition. When you mark an entire section, ensure there is no blank space between thelast word to be marked and the cursor.

    To reapply the format last used within the marking mode, choose Last characterformat or Last paragraph format.

    2001/Q3 2004 SAP AG. All rights reserved. 65

  • Unit 3: The PC Editor and the Line Editor BC460

    Figure 50: Special Characters

    To suppress special character recognition, use ....

    To move text to the next tab position, set a double comma (,,) at the beginning ofthe text you want to move. You can define tab positions in paragraphs. If you donot define tabs, the default positions of the underlying layout set are used. To add acomment line, which is ignored when the text is formatted, enter /* in the tag column.

    To protect an extended line from the previously defined line format, enter =. Thisfunction also suppresses the implicit blank space in the Editor at the end of theprevious line.

    Symbols consist of spaces reserved for variable data, which is inserted during spoolingfor printing. To format symbols, enter &N...N&. See the section on Symbols andControl Commands.

    To use a SAPscript control command, enter /: in the tag column. Control commandsdo not affect editor formatting; the commands are not interpreted until the composerprocesses the document. The unit on Symbols and Control Commands containsfurther information about this topic.

    66 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: SAPscript Editors

    Exercise 1: SAPscript Editors

    Exercise ObjectivesAfter completing this exercise, you will be able to: Make changes to SAP standard forms Understand layout using the graphical Form Painter and the alphanumeric Form

    Painter Make text changes Print preview using the print program

    Business ExampleIn most cases, standard forms are altered to reflect the needs of individual customers.

    Task 1:

    Object Name / DescriptionName of the print program to be used SAPBC460D_01Name of the form to be used SAPBC460D_FM_03Name of the form to be created Z_BC460_EX3_##Development class $TMPNote: ## is your group number

    Make a copy of the Form SAPBC460D_FM_03 and review the output on yourmonitor.

    1. Create a new form with the name Z_BC460_EX3_xx. Use the Form Copy tocopy the form SAPBC460D_FM_03.

    2. Save and activate the form.

    Choose Save.

    In the window Object Catalog Entry select Local Private Object.

    Choose Activate.

    3. Run the print program SAPBC460D_01 for your form name.

    Choose Screen Display.

    Continued on next page

    2001/Q3 2004 SAP AG. All rights reserved. 67

  • Unit 3: The PC Editor and the Line Editor BC460

    In the next dialog window choose Print Preview.

    Task 2:Perform multiple modifications to your form.

    1. Change the text of the letter (in the MAIN window) as desired. It is veryimportant that you use both the line editor and the PC Editor tools. Make achange in one and observe the change in the other. To toggle between the twoeditors choose Goto Change editor.

    Use the following functions in the editors:

    - Insert

    - Select

    - Copy

    - Cut

    - Paste

    Note: The PC Editor allows you to work in a way that is very similar toother text editors.

    2. Change the address in your form.

    3. Suppress the page number on the first page.

    4. Move the DATE window to the same line as the ADDRESS window.

    Note: The graphical Form Painter allows you to easily move a windowto a different location on a page.

    5. Create a paragraph format to write justified text in a bold format. Add textusing this new paragraph type.

    6. Use bold font style for the flight number mentioned in the letter. Apply thischaracter format while in the PC Editor. Then, observe the results in the lineeditor.

    7. Add a new column called Discount. Define new tabs for the appropriateparagraph formats. Enter the discounts in this column.

    68 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: SAPscript Editors

    Solution 1: SAPscript EditorsTask 1:

    Object Name / DescriptionName of the print program to be used SAPBC460D_01Name of the form to be used SAPBC460D_FM_03Name of the form to be created Z_BC460_EX3_##Development class $TMPNote: ## is your group number

    Make a copy of the Form SAPBC460D_FM_03 and review the output on yourmonitor.

    1. Create a new form with the name Z_BC460_EX3_xx. Use the Form Copy tocopy the form SAPBC460D_FM_03.

    a) Copy form SAPBC460D_FM_03 and check the output on the screen.

    Create a new form named Z_BC460_EX3_xx.

    Choose Copy to copy form SAPBC460D_FM_03.

    Choose Tools SAPscript Form.

    Enter the name of the new form: Z_BC460_EX3_xx.

    Choose Create.

    Enter a Description.

    To copy the form choose Form Copy.

    2. Save and activate the form.

    Choose Save.

    In the window Object Catalog Entry select Local Private Object.

    Continued on next page

    2001/Q3 2004 SAP AG. All rights reserved. 69

  • Unit 3: The PC Editor and the Line Editor BC460

    Choose Activate.

    a) Save and activate the form.

    Choose Save.

    In the dialog window Create object catalog entry choose Local object.

    To activate your form choose Form Activate.

    3. Run the print program SAPBC460D_01 for your form name.

    Choose Screen Display.

    In the next dialog window choose Print Preview.

    a) For your form name, execute the print program SAPBC460D_01.

    Choose System Services Reporting.

    Enter the program name and choose Execute.

    Enter the form name and choose Screen display.

    In the subsequent dialog window choose Print preview.

    Task 2:Perform multiple modifications to your form.

    1. Change the text of the letter (in the MAIN window) as desired. It is veryimportant that you use both the line editor and the PC Editor tools. Make achange in one and observe the change in the other. To toggle between the twoeditors choose Goto Change editor.

    Use the following functions in the editors:

    - Insert

    - Select

    - Copy

    - Cut

    Continued on next page

    70 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: SAPscript Editors

    - Paste

    Note: The PC Editor allows you to work in a way that is very similar toother text editors.

    a) Make the changes to your form. Test the form as described in 1-3.

    Change the text (in the MAIN window). Use the PC Editor and the LineEditor. Make a change in one editor and look at the change in the other. Totoggle between the two editors select Goto Editor.

    Make sure to use the graphical Form Painter.

    In the form maintenance transaction, choose the graphical Form Painter(Tools SAPscript Form, and then Settings Form Painter).

    Return to the form in change mode.

    Choose Layout.

    In the dialog window, select the MAIN window using the mouse.

    Choose Text.

    Use the following functions in the editors:

    - Insert

    - Select

    - Copy

    - Cut

    - Paste

    Note: You can work with the PC Editor as with any other wordprocessing editor.

    To activate the form choose Form Activate and to test it choose Form Check.

    Continued on next page

    2001/Q3 2004 SAP AG. All rights reserved. 71

  • Unit 3: The PC Editor and the Line Editor BC460

    2. Change the address in your form.

    a) Change the address in your form.

    Switch to the ADDRESS window.

    Choose Text.

    Make changes.

    To activate the form, choose Form Activate and to test it chooseForm Check.

    3. Suppress the page number on the first page.

    a) Suppress the page number on the first page.

    Return to the graphical Form Painter.

    Make sure to be on the FIRST page.

    Switch to the window PAGENO.

    Choose Form Change page layout and then choose Delete.

    4. Move the DATE window to the same line as the ADDRESS window.

    Note: The graphical Form Painter allows you to easily move a windowto a different location on a page.

    a) Move the DATE window to the same line as the ADDRESS window.

    Note: The graphical Form Painter allows you to move a windoweasily to a different location on a page.

    Return to the graphical Form Painter.

    Make sure to be on the FIRST page.

    Select the DATE window using the mouse.

    Press the left mouse button and move the DATE window to the same levelas the ADDRESS window.

    Note: For the DATE window, you can assign the same upper leftcoordinates as defined for the ADDRESS window.

    To activate the form choose Form Activate and to test it choose Form Check.

    Continued on next page

    72 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: SAPscript Editors

    5. Create a paragraph format to write justified text in a bold format. Add textusing this new paragraph type.

    a) Create a paragraph format that allows you to write text justified and bold.Enter text that uses the new paragraph format.

    To switch to the paragraph view select Goto Paragraph formats.

    To create a new paragraph choose Edit Create element.

    Enter a two-character key and a description.

    Set the alignment to JUSTIFIED.

    Select Font to activate bold printing and to select a font family.

    To return to the layout view select Goto Layout.

    Edit the text elements of the MAIN window as before.

    Insert a new paragraph.

    Position the cursor on the paragraph and use the mouse to select the newlycreated paragraph format.

    Choose Goto Editor to switch to the Line Editor. Have a look at theparagraph tag.

    To activate the form choose Form Activate and to test it choose Form Check.

    6. Use bold font style for the flight number mentioned in the letter. Apply thischaracter format while in the PC Editor. Then, observe the results in the lineeditor.

    a) In the PC Editor use bold for the flight number specified in the letter. Thenlook at the result in the Line Editor.

    Edit the text elements of the MAIN window as before.

    Double-click the flight number in each line to mark it.

    Choose character format Bold.

    Go to the Line Editor to see how the character format appears there.

    Continued on next page

    2001/Q3 2004 SAP AG. All rights reserved. 73

  • Unit 3: The PC Editor and the Line Editor BC460

    7. Add a new column called Discount. Define new tabs for the appropriateparagraph formats. Enter the discounts in this column.

    a) Add a new column named Discount. Define new tabs for the relevantparagraph formats. Enter the discounts in this column.

    Edit the text elements of the MAIN window as before.

    In the header line after the price insert a tab and enter Discount.

    Go to the Line Editor. The tab there appears as a double comma (,,).

    Go back to the PC Editor.

    Insert a tab and enter discounts for several item lines.

    Choose Back.

    Select Goto Paragraph formats to go to the paragraph maintenance.

    Choose paragraph IH.

    To modify the tabs choose Tabs and enter your own alignment and positionfor the discount column.

    Do the same for paragraph IL.

    To activate the form choose Form Activate and to test it choose Form Check.

    74 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: SAPscript Editors

    Lesson Summary

    You should now be able to: Learn about the SAPscript editors Identify the operation of the SAPscript editors

    2001/Q3 2004 SAP AG. All rights reserved. 75

  • Unit 3: The PC Editor and the Line Editor BC460

    Lesson: Form Elements

    Lesson OverviewThis lesson introduces you to various form elements, such as windows and textelements.

    Lesson ObjectivesAfter completing this lesson, you will be able to:

    Learn about form elements

    Business ExampleYou are working with a garment export house that exports a large variety of readymadegarments to various distributors across the world. The export house uses SAPscriptsto create and print invoices generated by the Sales and Distribution department.

    The forms created for the invoices raised by the Sales and Distribution departmentof your export house are divided into various output areas called Windows. As asales executive of this export house, you need to structure the text in these Windowsusing form elements.

    Windows

    Figure 51: Windows

    By default, the main window of a form should always display body text.

    76 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Form Elements

    This body text contains the opening form of address, wraparound text, columnheaders, and data for the individual detail positions.

    Figure 52: Structuring Pages Using Forms

    The various output areas that appear on form pages are called page windows.

    Page window texts can be structured using text elements.

    Figure 53: Text Elements

    2001/Q3 2004 SAP AG. All rights reserved. 77

  • Unit 3: The PC Editor and the Line Editor BC460

    The text in the example above has been divided into three text elements: one forthe form of address and subsequent text, one for the table header, and one for theindividual data item.

    The sequence in which these elements are displayed is controlled by the print program.In addition, text within the main window, such as the table header, can be displayedmultiple times in different areas within the window on different pages. For moreinformation about these functions, refer to the print Program chapter.

    You can also use the print program to determine whether or not you want certaintext to be displayed at all.

    Figure 54: Text Elements in the Line Editor

    You need to use the format ID /E in the format column of the line editor to denote thebeginning of a text element. The name used to identify the text element is highlightedin red in the line editor. The end of a text element is reached when a new text elementbegins with /E in the format column.

    The names of text elements that have already been created by users are displayed inbold print in the PC editor and the entire background of the line is gray.

    78 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Form Elements

    Figure 55: Text Element Types

    SAPscript differentiates between default text elements and text elements with names.

    You can identify a default text element whenever you have body text at the beginningof a window, for example, an address in a window other than a main window ora page number. But no /E text element is defined in the tag column. In contrast tonamed text elements, default text elements are printed automatically, which meansthat no print control functions are available.

    Figure 56: Maintaining Text Elements in the Form Painter

    You can use the Form Painter to maintain all text elements in any window.

    2001/Q3 2004 SAP AG. All rights reserved. 79

  • Unit 3: The PC Editor and the Line Editor BC460

    Use either the Form: Change Page Layout (graphical Form Painter) dialog box orthe Form: Change Windows (alphanumeric Form Painter) dialog box to maintainthese elements. Select Edit Text elements or click the corresponding push buttonto go to the editor for that text element.

    80 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Form Elements

    Lesson Summary

    You should now be able to: Learn about form elements

    2001/Q3 2004 SAP AG. All rights reserved. 81

  • Unit Summary BC460

    Unit SummaryYou should now be able to: Learn about the SAPscript editors Identify the operation of the SAPscript editors Learn about form elements

    82 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Test Your Knowledge

    Test Your Knowledge

    1. What is a PC editor?

    2. In the Line editor, are assigned using thetag column.Fill in the blanks to complete the sentence.

    3. Use the PC editor and the Line editor to enter text, such as.

    Fill in the blanks to complete the sentence.

    4. What is a named text element?

    2001/Q3 2004 SAP AG. All rights reserved. 83

  • Test Your Knowledge BC460

    Answers

    1. What is a PC editor?

    Answer: The PC editor is a tool used to enter text in SAPscript. The PC editoris similar to other common text editors and functions according to the What YouSee Is What You Get (WYSIWYG) principle. The operations of the PC editorare performed using buttons and menu functions. The paragraph format andcharacter format buttons allow you to assign paragraph and character formats tothe text, according to what is selected.

    2. In the Line editor, paragraph formats are assigned using the tag column.

    Answer: paragraph formats

    3. Use the PC editor and the Line editor to enter text, such as materials text andstandard text.

    Answer: materials text and standard text

    4. What is a named text element?

    Answer: A named text element is a type of text element that is identified by itsname. You can have many named text elements in a window. In addition, theoutput sequence of the named text element is controlled by the print program.

    84 2004 SAP AG. All rights reserved. 2001/Q3

  • Unit 4Symbols and Control Commands

    Unit OverviewThis unit starts with the introduction of various symbols and then discusses the controlcommands. Finally, the unit highlights the various uses of the control commands.

    Unit ObjectivesAfter completing this unit, you will be able to:

    Use symbols Identify formatting options Use control commands

    Unit ContentsLesson: Symbols... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86Lesson: Control Commands.. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

    Exercise 2: Using Control Commands.. .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .105

    2001/Q3 2004 SAP AG. All rights reserved. 85

  • Unit 4: Symbols and Control Commands BC460

    Lesson: Symbols

    Lesson OverviewThis lesson introduces you to the various types of symbols. It also describes thevarious formatting options available with symbols.

    Lesson ObjectivesAfter completing this lesson, you will be able to:

    Use symbols Identify formatting options

    Business ExampleYou are working with a garment export house that exports a large variety of readymadegarments to various distributors across the world. The export house uses SAPscriptsto create and print invoices generated by the Sales and Distribution department.

    The information about the invoices created by the Sales and Distribution departmentis stored in tables. As a sales executive of this export house, you need to use symbolswith these tables. Symbols enable you to display the most current values from SAPtables in the form of text modules. You can use these text modules for further analysis.

    86 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Symbols

    Introduction to Symbols

    Figure 57: Using Symbols

    Symbols are placeholders for values that are inserted during print formatting.

    The use of symbols allows you to output the most current values from SAP tables inthe form of text modules.

    Symbols are identified by names surrounded by ampersand characters at the beginningand end of the symbol. Symbol names are not case-sensitive.

    Symbol names may not contain a blank space.

    Symbols must always completely fit on one text line; symbols cannot wrap to thenext line of text.

    2001/Q3 2004 SAP AG. All rights reserved. 87

  • Unit 4: Symbols and Control Commands BC460

    Types of Symbols

    Figure 58: Types of Symbols

    SAPscript uses four types of symbols:

    System Standard Program Text

    These symbol types differ in the way in which values are assigned to them.

    You can select symbols by selecting Include Symbols.

    88 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Symbols

    Figure 59: System Symbols

    SAPscript provides standard system symbols that are automatically replaced with datafrom SAP R/3 Enterprise when a document is printed.

    You can use system symbols in any document.

    To choose a system symbol, select Include Symbols System.

    From Release 4.5 A, the table TTXSY, which contains system symbols, is alsoavailable to users.

    Table TTDTG Symbols are user-defined. Symbols are language-dependent. Name: max. 22 characters. Value: max. 60 characters.

    Standard symbols are application-defined and stored in table TTDTG.

    You can display or change standard symbols by selectingSystem ServicesTablemaintenance Extended table maint. , or by selectingTools SAPscriptAdministration Settings.

    You can use standard symbols in any document.

    Standard symbols are language-specific.

    2001/Q3 2004 SAP AG. All rights reserved. 89

  • Unit 4: Symbols and Control Commands BC460

    Examples of standard symbols are:

    &SGDH& for the opening salutation: Dear Sir/Madam: &MFG& for the closing salutation: Yours faithfully

    Value is defined in the text module DEFINE &symbol& = value Name: max. 32 characters Value: max. 60 characters

    You can define a text symbol for any text module. This symbol is valid only in thetext module for which you have defined the symbol.

    You can assign values to a symbol in the following ways:

    Use DEFINE.

    The value assigned to the symbol is saved when you save the text module. To assign several values to the same symbol, use DEFINE every time you

    assign a new value. Use a standard text symbol. To do so, select Include Symbols Text symbols

    ...

    The system displays all the text symbols in the current text and form. You can assign any value to the symbols. The value assigned to a text symbol is only temporary and is not saved

    with the text.

    90 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Symbols

    Figure 60: Program Symbols

    Program symbols are substitute symbols for values, which originate from the ABAPprogram.

    Program symbols represent the contents of database fields or global program symbols.The database fields must be defined in a table or a structure in the ABAP Dictionarywith a TABLES statement. Global program symbols can be defined in the printprogram over DATA or SELECT OPTION.

    The data objects must be filled with values by the print program. You can editthe values using SAPscript according to the ABAP Dictionary or using theprogram-defined characteristics.

    2001/Q3 2004 SAP AG. All rights reserved. 91

  • Unit 4: Symbols and Control Commands BC460

    Figure 61: Program Symbols and Symbol Definition

    Click the Program symbols button or select Insert Symbols Program symbols todisplay a detailed list of program symbols for your print program. You can add thesesymbols to the text by clicking the symbols.

    Click the Symbol definition button or select Go to Print program Symboldefinition to branch to a specific data objects definition screen in the print program.

    Select Go to Print program Symbol definition with dialog to jump to variousprint programs using the dialog box that this function calls.

    To assign additional print programs to a form, selectInsert Symbols Programsymbols. A dialog box called Print program for form appears. Choose Append printprogram.

    92 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Symbols

    Figure 62: Creating Additional Information in the PC Editor

    You can insert commands, symbols, and text elements in the PC editor by using Edit Insert command.

    The structures you insert appear in fields on the screen.

    These structures can be deleted or changed by placing your cursor on the appropriateline and choosing either Edit Delete command or Edit Change command.

    Those commands and symbols inserted using the dialog box undergo a syntax checkbefore they are inserted into your text.

    You can also check syntax manually using Text Check.

    From 4.5A you can also check unknown symbols in form texts.

    2001/Q3 2004 SAP AG. All rights reserved. 93

  • Unit 4: Symbols and Control Commands BC460

    Formatting Options

    Figure 63: Formatting Options

    The value of a symbol is displayed in full but blank spaces at the end of the value arecut off. To change the symbol display, use the following options:

    Offset: Output begins here. Offset always refers to the formatted value. Length: Data of a specified length is displayed. I: If the field has an initial value, nothing is displayed at the output. Z: Leading zeros are suppressed. C: Several consecutive blank spaces are compressed into one blank space.

    Leading blank spaces are suppressed. R: The output is right-aligned. S: The sign is hidden. (x,y) Decimal notation: the data has length x with y decimal places.

    Text can also be inserted before or after a symbol, for example,&text1SYMBOLtext2&.

    You can also combine formatting options.

    For more formatting options, refer to the online documentation.

    94 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Symbols

    Lesson Summary

    You should now be able to: Use symbols Identify formatting options

    2001/Q3 2004 SAP AG. All rights reserved. 95

  • Unit 4: Symbols and Control Commands BC460

    Lesson: Control Commands

    Lesson OverviewThis lesson provides you with an overview of control commands. It also describeshow to use control commands for various purposes, such as to include text modulesand define text symbols.

    Lesson ObjectivesAfter completing this lesson, you will be able to:

    Use control commands

    Business ExampleYou are working with a garment export house that exports a large variety of readymadegarments to various distributors across the world. The export house uses SAPscriptsto create and print invoices generated by the Sales and Distribution department.

    You have created text modules for the SAPscript tables that are used to store thedetails of invoices. Now, you need to include these text modules to the Windows in aform. You also need to use the data from these tables. But the print program cannotread the data assigned to it. To enable the print program to read the data, you needto use control commands in SAPscript.

    Introduction to Control Commands

    Figure 64: Control Commands

    96 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Control Commands

    You can use control commands to modify the output text. Control commands allowyou to:

    Include text in a document. Assign values to text symbols. Start or suppress a page break. Reset outline paragraphs. Evaluate conditions.

    To enter a control command, use the format key /: in the format column.

    The length of a control command must not exceed one line.

    Using Control Commands

    Figure 65: Text Modules

    A form contains predefined text modules, such as material lists, customer description,a company footer, bank account numbers, and the names of the executive boardmembers.

    You can enter and store these text modules separately.

    You can combine and display these text modules in a form. You can use a text module in more than one form.

    2001/Q3 2004 SAP AG. All rights reserved. 97

  • Unit 4: Symbols and Control Commands BC460

    To identify the text, specify the client, name, language, text object, and text ID.

    The text object and text ID are used to classify the text.

    A text object describes the context of a document, such as Item Text, which containsPurchasing Document, Materials Text, or Standard Text. Such text can be used formore than one application.

    Text objects are divided into text IDs to permit a more precise classification of texttypes. For example, the category, Sales and Distribution Text, is a subcategory ofMaterials Text.

    To work on any standard document, that is, to work with all the text allocated toObject TEXT, select Tools SAPscript Standard text.

    Figure 66: Including Text Modules

    You can include text modules from the current client in any window in a form. Youcan also include text modules in other text modules. In both the cases, you need touse INCLUDE to add the text modules.

    You must specify the name of the text you want to include.

    You can specify additional key fields for the text using the OBJECT, ID, andLANGUAGE parameters.

    If you use the PARAGRAPH parameter to specify a paragraph format in a form, thisformat will be used as the default format in the inserted text.

    98 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Control Commands

    Use Insert Text Standard ... to include standard text. Enter the name of the textthat you want to include in the dialog box that appears.

    Figure 67: Defining Text Symbols

    You must specify values for text symbols explicitly. The DEFINE command allowsyou to anchor the value you assign in a text.

    To assign values to text symbols, you need to use DEFINE before the text symbolis displayed for the first time.

    Text symbols are retained in the document. This means that the text symbol remainsin the text module till you use the text symbol again.

    In addition, you can change the value of a text symbol that appears repeatedly inyour text.

    Figure 68: Formatting Addresses

    2001/Q3 2004 SAP AG. All rights reserved. 99

  • Unit 4: Symbols and Control Commands BC460

    The ADDRESS-ENDADDRESS command formats addresses according to the postalnorms of the recipients country, as defined in the COUNTRY parameter. Thecorresponding references fields are described in structure, ADRS. You can assignboth literals and symbols to the parameter.

    The composer calls the function module, ADDRESS_INTO_PRINTFORM, whenformatting addresses and transfers the appropriate format parameter from the textto the function module.

    For additional information, refer to the online documentation for the function module,ADDRESS_INTO_PRINTFORM.

    You should always include the FROMCOUNTRY parameter when formattingaddresses; otherwise, the senders address will be formatted according to theCOUNTRY parameter. For example, with postal codes, if the value of COUNTRY isGermany and the FROMCOUNTRY parameter is not included, the senders postalcode will be displayed as D-80801.

    Figure 69: Time, Date, and Decimal Formats

    Time, date, and decimal formats are user-specific.

    100 2004 SAP AG. All rights reserved. 2001/Q3

  • BC460 Lesson: Control Commands

    To modify the format of program and system symbols of this type, use the followingcontrol commands:

    SET TIME MASK: Controls the time field format. SET DATE MASK: Controls the date field format. SET COUNTRY: Provides a choice of country-specific date or decimal formats

    that differ from the user master data.

    To define format masks, use command lines.

    Figure 70: Page Break and Page Protection

    SAPscript automatically inserts a page break when the main window (MAIN) is full.

    To override the automatic page break in the main window and insert a manual pagebreak, you need to use the control command, NEW-PAGE.

    You can specify the subsequent page explicitly. If you do not specify the next page,the page defined in the form is used as the next page.

    To avoid unwanted page breaks, you need to use the PROTECT...ENDPROTECTcommands. All the text enclosed within these commands is printed on one page.

    If the text fits onto the current page, the text is printed on that page as if the PROTECTcommand had not been used. If there is no space on the page, the PROTECTcommand functions as a NEW-PAGE command and inserts a page break.

    2001/Q3 2004 SAP AG. All rights reserved. 101

  • Unit 4: Symbols and Control Commands BC460

    Figure 71: Conditional Text Output: Case Distinction

    You can specify that the text should be displayed only when certain conditions are met.

    To set such conditions, you n