You are on page 1of 225

BC460 SAPscript Formulardruck und Textmanagement

BC460
SAPscript: Form Printing and Text Management
© SAP AG 2001 © SAP AG

R/3 System Release 4.6C November 2000 5004 2180

© SAP AG

BC460

1-1

Copyright

Copyright 2001 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. All rights reserved.

© SAP AG 2001

Trademarks: Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft®, WINDOWS®, NT®, EXCEL®, Word®, PowerPoint® and SQL Server® are registered 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. HTML, DHTML, XML, XHTML are trademarks or registered trademarks of W3C®, World Wide Web 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, ABAP, SAP ArchiveLink, SAP Business Workflow, WebFlow, SAP EarlyWatch, BAPI, SAPPHIRE, Management Cockpit, mySAP.com Logo and mySAP.com are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other products mentioned are trademarks or registered trademarks of their respective companies.

© SAP AG

BC460

1-2

ABAP Workbench
Level 2
3 days BC402 ABAP Programming Techniques 3 days BC404 ABAP Objects: Object Oriented Programming in R/3 BC405 3 days Techniques of List Processing and InfoSet Query BC410 Programming User Dialogs BC400 5 days ABAP Workbench: Foundations and Concepts MBC40 2 days BC420 Data Transfer BC430 ABAP Dictionary 5 days

Level 3
BC414 3 days Programming Database Updates 2 days BC415 Communication Interfaces in ABAP BC425 3 days Enhancements and Modifications BC412 3 days Dialog Programming using EnjoySAP Controls BC490 3 days ABAP Performance Tuning

5 days 2 days

Managing ABAP Developments Projects

BC460 3 days SAPscript: Forms Design and Text Management BC470 2 days Form Printing Using SAP Smart Forms CA610 (Rel. 4.0) 2 days CATT:Test Workbench and Computer Aided Test Tool

Recommended supplementary courses are: Business Process Technologies CA925, CA926, CA927 BC095 (Business Integ. Techn.) BC619 (ALE), BC620, BC621

© SAP AG 2001

© SAP AG

BC460

1-3

ITS
Level 2 Level 2 Level 3 Level 3

BC400 5 days ABAP Workbench: Foundation and Concepts

ITS100 2 days Developing EasyWebTransactions

ITS050 3 days SAP Internet Transaction Server: Foundations

2 days ITS110 Developing Web Scenarios and MiniApps using ITS Flow Logic 2 days

ITS150

Corporate Identity Design ITS070 2 days SAP Internet Transaction Server: Administration
© SAP AG 2001

© SAP AG

BC460

1-4

knowledge from the following training course is necessary: BC 400 ABAP Workbench Basics © SAP AG 2001 © SAP AG BC460 1-5 .Prerequisites To take part in this course.

Target Group Participants: Project team Employees responsible for data processing Employees responsible for organization Duration: 3 days © SAP AG 2001 Hints to the user: These training documents are not meant to be used without corresponding classroom instruction. © SAP AG BC460 1-6 . Space is provided for you in the course documents to note this additional information.They are only complete when used in tandem with the comments of an SAP trainer.

Introduction: Contents Course goal Objectives Course content Course overview diagram Main business scenario Course introduction © SAP AG 2001 © SAP AG BC460 1-7 .

Course Goal This course will enable you to: Understand form printing in the context of the SAP R/3 System Make changes to SAP standard forms and SAP print programs Transport SAPscript objects © SAP AG 2001 © SAP AG BC460 1-8 .

Objectives To maintain forms using SAPscript tools To use SAPscript control statements and symbols To control print output using print programs To be able to change print programs and forms in the R/3 System To use font maintenance in the R/3 system © SAP AG 2001 © SAP AG BC460 1-9 .

Course Content Preface Unit 1 Unit 2 Unit 3 Unit 4 Unit 5 Introduction SAPscript Overview Form Elements The PC Editor and the Line Editor Symbols and Control Commands Unit 6 Unit 7 Unit 8 Unit 9 Unit10 The Print Program Styles The Next Generation Modifications Font Maintenance You find the exercises and solutions at the end of each unit Appendix © SAP AG 2001 © SAP AG BC460 1-10 .

Course Overview Diagram Adapt forms Invoice Maintain form elements Create and control texts 3 4 5 7 R/3 Newly created form. stored in the system 8 6 Adjust printer output to form Invoice © SAP AG 2001 © SAP AG BC460 1-11 .

Main Business Scenario All course participants will be responsible for performing print control actions on a changed form: Changing the layout of a form Changing the text of a form Creating a print program and controlling the text output sequence Understanding change scenarios in the R/3 System © SAP AG 2001 © SAP AG BC460 1-12 .

SAPscript Overview Contents: SAPscript in the R/3 System The purpose of SAPscript SAPscript components Forms and the print program The processing sequence © SAP AG 2001 © SAP AG BC460 1-13 .

in particular the print program and forms © SAP AG 2001 © SAP AG BC460 1-14 .Objectives At the end of this unit you: Have an insight into the overall structure of SAPscript See how SAPscript is integrated into the R/3 System Know the components of SAPscript Have an understanding of how SAPscript components interact.

Large quantities of these documents may have to be produced. order confirmations. These documents are often created automatically. delivery notes. invoices.. The basic layout of the document is pre-defined. checks. such as address data or purchase order items. Form printing is usually a matter of large print runs of documents such as pay slips. This data might be entered manually by an employee.) all the time. or retrieved from a database table..The Purpose of SAPscript Mail • Entering text • Printing using forms Invoice © SAP AG 2001 Every company needs to routinely output documents with a uniformly defined layout (for example. reminders. but in many cases. and so forth. © SAP AG BC460 1-15 . . other data has to be merged with it.

SAPscript in the R/3 System Material Material management Management MM Human resources management HR Sales and Distribution SD Production planning SAPscript: Form printing and text management Controlling CO Financial accounting FI Customer Applications . online documentation..).. production planning... PP © SAP AG 2001 SAPscript has been developed to meet the above requirements. It is an integrated tool for text entry and form printing in many R/3 applications (accounting. sales and distribution. © SAP AG BC460 1-16 . .

Editor interfaces provide you with various necessary functions according to application. © SAP AG BC460 1-17 .SAPscript: Benefits Multilingual capability High performance when printing in large quantities Uniform corporate design in documents Word processing scalability R/3 transport and translation connections Platform independence © SAP AG 2001 The PC editor supports Asian languages among other things. SAPscript can be run on all front-ends supported by SAP. Form printing allows for different address layouts based on country and for simultaneous use of multiple currencies. SAPscript supports a unified design in all documents.

These can be stored centrally in the database.SAPscript from a User's Point of View User Application transactions Maintenance transactions Text editor Layout (forms. styles) Database ABAP Workbench Programming interface Composer © SAP AG 2001 A document's layout is defined in a form. You can generate documents automatically from an ABAP program using the SAPscript programming interface. © SAP AG BC460 1-18 . The Editor is used in various applications for entering texts such as letters. Most SAPscript users only come in contact with the Editor. Text modules are entered using the SAPscript Editor.

To make changes to your documents.. you can copy and customize existing forms. such as moving a piece of text. and tabs. Every SAPscript document uses a form. You can use these text modules for different applications. paragraph formats. © SAP AG BC460 1-19 . you only need to change the form.. © SAP AG 2001 A form specifies the appearance and structure of a document. choose Tools -> SAPscript -> Form from the main R/3 menu.Forms Form 1 Invoice Form 2 Document Form 3 Dear. or changing fonts. To create your own forms. To edit forms. Forms contain predefined text modules with space reserved for variable data.

controls the actual text output to the printer. their sequence. and so on © SAP AG BC460 1-20 . . . and their frequency.The Print Program Form 1 SAP DB Form 3 Form 2 Application transaction Print program © SAP AG 2001 The print program .selects data from the database or from user input. screen or fax. number of copies.determines the printer attributes such as output device. whether to print immediately. .selects a form and controls which texts should be printed.

the composer replaces these variables with data from the R/3 system. The composer receives layout information from the form specified in the print program. or with the user data selected by the print program. such as the current date. © SAP AG BC460 Invoice 1-21 . Every command entered using the SAPscript programming interface is transferred to the composer. The documents are formatted according to this layout information. The SAPscript print program initializes the printing process.Processing Sequence: The Composer SAP DB Form Document Invoice Application transaction Print program Composer © SAP AG 2001 The final appearance of your document depends on the interaction between your print program and its form. the composer places the completed document in the spool. The print program controls the completion of the form. If the documents contain variables. Once this is done.

© SAP AG 2001 © SAP AG BC460 1-22 . especially print program and form. Name the components of SAPscript. Understand how the components interact. Describe how SAPscript is integrated into R/3.Overview: Summary of the Unit You can now: Position SAPscript in the overall structure of R/3 applications.

Form Elements Contents: Windows and pages Paragraph formats Character formats Layout of forms © SAP AG 2001 © SAP AG BC460 1-23 .

Form elements: Objectives At the end of this unit you can: Describe the elements SAPscript offers to lay out a form Create and change form elements in R/3 © SAP AG 2001 © SAP AG BC460 1-24 .

00 USD AZ 0790 11/30/99 6:55 1644. Thank you for your booking. booking data). We are pleased to confirm the following flights: Flight Date Depart Price ----------------------------------AA 0017 11/24/99 13:15 799. 145 Apple Valley Ln..Address .80 USD Page 1 © SAP AG 2001 Page 2 A typical form contains the following details .Business transaction data (for example. © SAP AG BC460 1-25 .00 USD Yours faithfully . Dear Sir or Madam. NY 14850 Flight Date Depart Price 11/22/99 ----------------------------------LH 0400 12/29/99 6:07 398.00 USD LH 0400 12/28/99 6:07 398.00 USD AA 2017 12/21/99 21:55 799. Often the texts and data spread over several pages in a form. 4 Pittsburg.Example: Booking Confirmation Fly &&Smile Smile Fly 45 Pears Road Zeppelinstr.Body copy . PA 19078 10101 Fliegen Turnaround Inc.Sender . Ithaca..80 USD LH 0003 12/31/99 15:06 990.

Structuring Pages Using Windows Pages Windows © SAP AG 2001 The various output areas found on a form page are called windows. You can organize texts within your windows using text elements and paragraphs. © SAP AG BC460 1-26 .

Thank you for your booking. 145 Apple Valley Ln. Depart Price 13:15 799.Elements for Structuring Texts Fly & Smile 4 Truckee Way Durango. We are pleased to confirm the following flights: Flight Date AA 0017 07/20/98 AZ 0790 11/11/98 Yours faithfully .00 USD 6:55 1644.00 USD Paragraphs © SAP AG 2001 Various paragraph and character formats provide you with additional ways to structure the texts that you create. © SAP AG BC460 1-27 . NY 14850 07/15/98 Type Dear Sir or Madam... Ithaca. CO 85650 Turnaround Inc.

Paragraph formats .Forms: Elements Form Page layout Paragraph formats Character formats © SAP AG 2001 The following sub-objects allow you to structure forms in SAPscript: . © SAP AG BC460 1-28 .Character formats Use the Form Painter to edit the individual sub-objects of a form.Page layout .

© SAP AG BC460 1-29 . You must always enter a starting page in a form's header data.Forms: Pages Page format format Page format Page Staticpage page sequence Static page sequence Static sequence Page 1 Page 2 DIN A4 LETTER Next page Horizontal DIN A5 © SAP AG 2001 Next page A form can have one or more pages. SAPscript allows for automatic page numbering. LETTER or DIN A4). A specific page format is defined for each form (for example. You determine the page sequence of a document by simply entering the page that follows the one you are currently on.

Thank you for your booking. CO 85650 Turnaround Inc.80 USD USD USD USD Page 1 © SAP AG 2001 The output areas on a form page that might.Structuring Pages Using Windows Template Fly & Smile 4 Truckee Way Durango. output addresses or detail items are called windows.80 6:07 398.00 6:55 1644. We are pleased to confirm the following flights: Flight AA 0017 AZ 0790 LH 0400 LH 0400 Date 07/20/98 11/11/98 07/21/98 07/28/98 Depart Price 13:15 799. © SAP AG BC460 1-30 . for example. Ithaca. 145 Apple Valley Ln. NY 14850 07/15/98 Form: Windows Dear Sir or Madam.00 6:07 387.

Windows and Page Windows Windows Date Form: Page windows Sender Adressee Window with body text Page 2 Page 1 Footer © SAP AG 2001 Windows can appear on numerous pages within a single form. A window can have a different size and position on different pages. Texts that appear in page windows are defined for an entire form using that form's corresponding logical window. The user determines the placement of page windows on each page by entering their size and position. Therefore SAPscript differentiates between logical windows and physical page windows. © SAP AG BC460 1-31 .

0 windows of type CONST still exist. These windows behave in the same way as type VAR windows.MAIN . © SAP AG BC460 1-32 . In Releases < 4.Window Types Windows Date Sender Adressee Window type: VAR Window with body text Window type: MAIN Footer Window type: VAR © SAP AG 2001 Their are two different types of windows in SAPscript: . Any text that cannot be fully displayed due to the size of the window is lost. The text entered in their corresponding logical windows will. Windows of type VAR may vary in size and position for each page that they appear on. always be displayed on each page where the window occurs.VAR Windows of type MAIN are used to display text that goes on for multiple pages. however.

. for example all bookings of a specific customer.00 21:55 799. Main windows can have different heights and be positioned differently on pages where they appear. Dear Sir or Madam. SAPscript continues outputting body text in the main window on the next page. 145 Apple Valley Ln. however. always have the same width. they must. Whenever the output area of one page is filled. © SAP AG BC460 1-33 .00 6:55 1644.00 USD Turnaround Inc.80 USD LH 0003 08/16/98 15:06 990. NY 14850 Yours faithfully .00 6:07 398.80 USD USD USD USD Page 2 Page 1 © SAP AG 2001 In main windows. We are pleased to confirm the following flights: Flight AA 0017 AZ 0790 AA 2017 LH 0400 Date 07/20/98 11/11/98 12/21/98 12/28/98 Depart Price 13:15 799.Main Window Fly & Smile 4 Truckee Way Durango. texts of variable length are displayed. CO 85650 7/15/98 Flight Date Depart Price ----------------------------------LH 0400 07/28/98 6:07 398. Thank you for your booking. Ithaca..

Defining Page Windows Top edge Left edge Page window Height Width Page © SAP AG 2001 All forms have pre-determined page formats (for example LETTER or DIN A4). © SAP AG BC460 1-34 . The position of a page window is indicated by its distance from the top and the left-hand edges of the page. A page window's size is determined by its height and width. Both position and size can be given in various units of measure (for example in lines or in characters).

Fonts .First line indentation .Line spacing .Tabs . Paragraph formats define: .Vertical spacing: before and after .Paragraph Formats: Metric Sizes Left margin Dear Mr.Outline options © SAP AG BC460 1-35 . We are pleased to confirm the following bookings: Window © SAP AG 2001 You can modify the appearance of text in SAPscript by changing its paragraph and character formats. Smythe. Right margin Space after Space before Indent Thank you for your reservation.Paragraph alignment (such as left or centered) .Left margin/right margin .

NY 14850 Dear Sir or Madam. Bold.Underlining © SAP AG BC460 1-36 . bold Page 1 © SAP AG 2001 You can define the following character format attributes: .Character Formats Fly & Smile 4 Truckee Way Durango. We are pleased to confirm the following flights: Flight Date Depart Price AA 0017 07/20/98 13:15 799. 16 point Turnaround Inc. 14 point. CO 85650 07/15/1998 Bold. italic.00 USD Times. italic.Bold/italics .Font size . point. Thank you for your booking. Ithaca.Font . 145 Apple Valley Ln.00 USD AZ 0790 11/11/98 6:55 1644.

Editing Forms
Form Edit Goto Utilities Settings Environment System Help

Form Painter: Request

Form Language

S_BC460_DEMO_1 DE

Create

Subobjects
Header Page layout Paragraph formats Character formats Documentation

Display

Change

© SAP AG 2001

To edit forms, choose Tools -> Form printout ->SAPscript -> Form. Choose F4 at the form name field to display a list of all existing forms. You can edit the individual subobjects of a form directly: - Header - Page layout - Paragraph formats - Character formats - Documentation

© SAP AG

BC460

1-37

Editing Forms: The Form Painter

alphanumeric
Header data Windows Pages

Form Painter
Header data

graphical

Layout

Page windows Paragraph formats Character formats Paragraph formats Character formats

© SAP AG 2001

From Release 4.0 a new Form Painter with graphical interface is available for more intuitive and faster form creation. You can also keep using the alphanumeric Form Painter, if you so desire. All form creation functions are still available in the alphanumeric Form Painter. In the maintenance transaction of the graphical Form Painter the 'Windows', 'Pages', and 'Page windows' components from the alphanumeric Form Painter have been consolidated into a single component called 'Layout'. Note: The graphical Form Painter is available from Release 4.0 for front-ends with either a Windows NT 4.0 or Windows 95 operating system. Otherwise you are working with the alphanumeric Form Painter.

© SAP AG

BC460

1-38

Form Painter: Maintenance Screen Structure

Form element
List of elements Element 1 Element 2 ...

Element selected

List of attributes: Element 2 Attribute 1 Attribute 2 ...

© SAP AG 2001

The Form Painter maintenance screen is organized as follows: - Element types - Lists of elements - Lists of attributes for example, a page for example, a list of the windows for this page for example, a list of attributes for each window such as position,size, and window type

© SAP AG

BC460

1-39

Sub-Object Header Data

Headerdata data Header Page layout layout Page Paragraphformats formats Paragraph Characterformats formats Character Documentation Documentation

© SAP AG 2001

© SAP AG

BC460

1-40

A first page (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) . measurements are automatically converted to LPI (lines per inch) or CPI (characters per inch). © SAP AG BC460 1-41 . bold.A default paragraph format (the format's attributes can be edited using the Paragraph formats function). or underlined) When creating a new form. If you use the units CH (character) or LN (line).A short text describing the form . you should always assign a description of what your form is to be used for. .Font attributes (such as font.A default value for tabs . italic.Header Data: Organization Header data data Header Administrative data Administration information Language attributes Basic settings Set up page Default values for text formatting © SAP AG 2001 You must enter the following items in each form's header data: .Line spacing (LPI) and character spacing (CPI): Form attributes such as tab stops or line spacing can be defined using more than one kind of unit. font size. .

. Author. © SAP AG BC460 1-42 ..Not saved Active Revised .New: the form has just been created and is not yet ready to be printed. choose Form -> Activate. However. R/3 continues to use the 'Active' version of the form. client. .Saved . and language. Form (name) Description Status New . or the date on which it was last changed. Release © SAP AG 2001 Administrative information such as a form's name.Revised: forms that have been revised and saved are given the status revised. To set the status of a form to active. whenever you print. A form can have the following statuses: . .Header Data: Administrative Data Administrative data Administration info.Active: the form is ready to be printed. is displayed under 'Administrative data'. choose Utilities -> Reset. To undo any unwanted changes you have made to a form. Language attributes Language key Original language Translate to all languages to individual languages do not translate Classification Development class Client number Creation/ Change info Date.

Example: You want to use a default paragraph in a particular window. page format. © SAP AG BC460 1-43 .Header Data: Basic Settings Basic Settings Set up page Page format First page Orientation Portrait format Landscape format Lines/inch Characters/inch Spool Default values for text formatting Tab stop Font family Font size Default paragraph Bold Italic Underlined Spacing Thickness Intensity Font maintenance Form definition © SAP AG 2001 Standard settings such as first page. default paragraph. font family. and font size can be made under 'Basic settings'. the system automatically uses the default paragraph set in the header data. Both the first page setting and the default paragraph setting are mandatory and must be maintained by the user. tab stops. Header data settings only take effect if no other settings have been made for that component. If no default paragraph has been specified in the window's attributes.

Sub-Object Page Layout Headerdata data Header Page layout layout Page Paragraphformats formats Paragraph Characterformats formats Character Documentation Documentation © SAP AG 2001 © SAP AG BC460 1-44 .

Graphical Form Painter: Page Layout Page FIRST Address page Form .00 CM CM CM CM MAIN* Design window Window height 6.. In the design window.60 1.. © SAP AG BC460 1-45 . WINDOW1* WINDOW2* Window Graphic Window ADDRESS Description Address Main window Administrative window Default paragraph Left margin Upper margin Window width 1. you can determine the size and position of display areas using drag and drop functionality. The most important attributes of the current page and its windows are displayed in the administrative window.00 Design / Text © SAP AG 2001 Options Page layouts can be edited in both the administrative window and the graphic design window.60 9.

A document's page sequence is controlled statically by the 'First page' value entered in its header data and by the 'Next page' value entered in its 'Page attributes'. then form printing ends with the current page. Standard functions such as Create page. and Delete page are made available to you here.. menu or in the form of a pushbutton on the screen itself. If no next page is specified. Use the Layout function from the initial Form Painter screen to call the graphical Form Painter. From the 'Page layout' screen you can now define the pages you need.. Copy page. Additional attributes can be entered for all those pages found in the list box display.Page Layout: Pages Current Currentpage page Call: Call: Attributes Attributes of of current current page page Page FIRST Address page Page Page overview overview Next Next page page Create Create Delete Delete Window Graphic Rename Copy Rename Copy Start Startpage page © SAP AG 2001 Forms can have multiple pages defined for them. either in the Edit -> Page. © SAP AG BC460 1-46 .

or double-sided. 'Page counter'. remain the same. as well as whether you want printout to be single. or revert to their initial value.Pages: Attributes Attributes Page Page Description Address page Page Page 1 Next page NEXT Description Address Page Page counter Next page Page 2 Mode Page counter Mode counter Initialize Initializecounter counter Increase Increase counter Keep counter unchanged Non-changing counter Numbering Numbering Numbering Numberingtype type Output length Output length Uppercase Upper case Print attributes Print attributes Resource name Resource name Print mode Print mode © SAP AG 2001 Page attributes FIRST NUMBERING NUMBERING TYPES TYPES ARABIC ARABIC Arabic Arabicnumerals numerals CHAR CHAR Fixed Fixedcharacter character LETTER LETTER Letters Letters ROMAN ROMAN Roman Romannumerals numerals For For example: example: Output Output length 4 Output length -> Outputlength length-> 4 -> Page Page 1: 1: 0001 0001 Page 1: -> Page 1:0001 0001 Paper Paper tray traychoice choice One-sided One-sidedor ordouble-sided double-sided printing default printing default S Simplex S Simplex mode mode D Duplex D Duplexmode mode T Tumble T Tumble mode mode Page attributes include 'Next page'. The counter settings determine whether page numbers should increase. and 'Print attributes'. The print attributes allow you to choose which paper tray you want to use. © SAP AG BC460 1-47 .

In addition. and default paragraph are displayed. important attributes such as position on the page. Current Current window window Windows Window ADDRESS Description Address Main window Default paragraph Left margin Upper margin Window width 1. Delete window and so forth. For each window. text mode displays the individual window texts.. In design mode.60 1. A number of standard window editing functions are also available on this screen including Create window. the Design / Text pushbutton allows you to switch between design mode and text mode in the design window.00 Pushbuttons Pushbuttons for for editing editing Design / Text Options © SAP AG 2001 The 'Window' list box displays a list of all windows found on the current page..Page Layout: Windows and Page Windows Page . window type. © SAP AG BC460 1-48 .00 CM CM CM CM Attributes Attributes of of the the page window page window Window height 6. Copy window.60 9. you can use your mouse to work with windows. window size.

you can choose to have your window aligned automatically to the grid.. Options Zoom 118% Windows Window ADDRESS 50% 200% Description Address Main window Default paragraph Left margin Upper margin Window width 1.00 CM CM CM CM Grid Step width 4....60 1. © SAP AG BC460 1-49 . In addition.Page Layout: Options Page .5 0 Unit of measur. 10 MM Window height 6. You can also choose what size the individual units of your design window grid should be in a unit of measure of your choice. Design / Text Options © SAP AG 2001 The Options pushbutton allows you to zoom in on a specific section of your page.00 Align automatic .60 9.

Windows and Page Windows: Attributes

Attributes: Windows Window Description Window type ADDRESS Address VAR

Attributes: Page Windows Window Description Window type Left margin Upper margin Window width Window height ADDRESS Address VAR 1.60 1.60 9.00 6.00 CM CM CM CM

Default paragraph BF

1

2

1
ADDRESS

Units Units of of measurement: measurement:
CH CH CM CM MM MM IN IN PT PT TW TW Characters Characters Centimeters Centimeters Millimeters Millimeters Inches Inches Points Points Twips Twips

2
© SAP AG 2001

Windows and page windows are dealt with separately in the alphanumeric Form Painter. You can define logical windows in a form by specifying the name and type of window. To specify the main window, which can contain text extending across more than one page, use MAIN. To specify the other windows of a form, use VAR or prior to Release 4.0 CONST: - CONST: The window has the same dimensions on all pages where it occurs - VAR: The height and width of the window can vary To create text for individual windows of the form, choose Text elements. The text you create is divided into text elements that are stored together with the form. You will find out about the Text Editor in the next chapter. You can set a default paragraph for any window, which then applies to all text elements within it. You can assign logical windows to any pages of your form. You define the distribution of page windows on a page by specifying the size and position of the windows. To print labels, or to print documents with more than one column, you can define more than one main window on any one page by choosing Edit -> Windows -> Create -> Main window.

© SAP AG

BC460

1-50

Sub-Object Paragraph Formats

Headerdata data Header Page layout layout Page Paragraphformats formats Paragraph
Standard attributes Font attributes Tabs Outline attributes

Characterformats formats Character Documentation Documentation
© SAP AG 2001

© SAP AG

BC460

1-51

Paragraph Formats: Standard Attributes
Alignment: Alignment:
Standard attributes Paragraph Left margin Right margin Indent 1st line Space before Space after HD 1.00 1.50 2.00 1.50 Description CM CM CM CM Alignment Line spacing Header 1 LEFT 1.00 LN BLOCK BLOCK justified justified CENTER CENTER centered centered LEFT aligned LEFT aligned left left RIGHT aligned RIGHT alignedright right

No blank lines Page protection Next paragraph same page

Units Units of of measurement: measurement:
LN LN CM CM MM MM IN IN PT PT TW TW Lines Lines Centimeters Centimeters Millimeters Millimeters Inches Inches Points Points Twips Twips

Left margin

Right margin Space after Space before

Indentation Window
© SAP AG 2001

You can specify the following standard paragraph attributes: - Left / right margin - Paragraph indentation - Line spacing - Vertical spacing: space before / 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. Choose Standard, Font, Tabs, or Outline to switch between the different groups of attributes.

© SAP AG

BC460

1-52

Paragraph Formats: Font Attributes

Font attributes Paragraph Family Font size HD COURIER 12,0 Point Description On Bold Italic Underlined Header 1 Off Retain Adopt Adopt values values from fromheader headerdata data

SAPscript SAPscript font font maintenance values maintenance values

Override Override header header data data values values

© SAP AG 2001

Font attributes for paragraphs include: - Font family, such as COURIER, HELVETICA, or TIMES - Font size (in tenths of a point) - Bold - Italics - Underlining, including the following additional options: spacing, thickness, intensity You can take a particular font attribute from the general form attributes and use it in the current paragraph by changing your setting values to the following: Font family = space, font size = 0, bold, italic, and underline all set to Retain.

© SAP AG

BC460

1-53

use the following tab positions: LEFT. select SIGN or DECIMAL. or DECIMAL. sign. To define the position of numbers in a paragraph. DECIMAL lets you align decimal points with any tab position. The standard tabs are available in addition to the tabs of a paragraph format. This leaves room for a minus sign or implied blank space at the end of the number.50 CM CM Alignment: Alignment: CENTER CENTER centered centered DECIMAL DECIMAL aligned alignedto todecimal decimal character character LEFT aligned LEFT alignedleft left RIGHT aligned RIGHT alignedright right SIGN +/SIGN +/-sign. SIGN.25 2. aligned alignedright right Units Units of of measurement: measurement: CH CH CM CM MM MM IN IN PT PT TW TW © SAP AG 2001 Characters Characters Centimeters Centimeters Millimeters Millimeters Inches Inches Points Points Twips Twips Scroll Scroll pushbuttons pushbuttons Tab attributes control the tab positions in a paragraph. RIGHT.Paragraph Formats: Tabs Tabs Paragraph Number 1 2 3 HD Descript. You can define as many tab positions as you wish. © SAP AG BC460 1-54 . CENTER. SIGN lets you define numbers right aligned at the tab position. To align a paragraph. Alignment LEFT LEFT Header 1 Tab position 1.

.. To number paragraphs automatically. sub-chapters... Characters Charactersare are formatted formattedwith withthe the format format entered entered Example: Example: Output Outputlength length4 4-> -> Page Page1: 1: 0001 0001 © SAP AG 2001 You can use the outline attributes provided by SAPscript to divide text into units such as chapters.... linked to first level 1. Second level.. and sections. III . linked to first level 2.. You can also number text units by creating consecutive numbering levels : 1.1. c * .2. . Second level. First level [..Paragraph Formats: Outlines Outline attributes Paragraph Outline Outline level Number margin Left delimiter Right delimiter Number chaining ( ) BF N1 01 Numbering type Fixed character Output length Uppercase Character string Description Numbering 1 Numbering Numberingtypes types ARABIC ARABIC arabic arabic numerals numerals CHAR fixed character CHAR fixed character LETTER LETTER letters letters ROMAN ROMAN roman roman numerals numerals LETTER Display: (a) (b) First of all .... select one of the following numbering types: Arabic numerals: Roman numerals: Letters Fixed characters: 1 I a * 2 II b * 3 .] © SAP AG BC460 1-55 . . First level 1.

Sub-Object Character Formats Headerdata data Header Page layout layout Page Paragraphformats formats Paragraph Characterformats formats Character Standard attributes Font attributes Documentation Documentation © SAP AG 2001 © SAP AG BC460 1-56 .

Hidden: The character string is not printed .Superscript: The character string is printed one half line space above the line .Barcode: The character string is encrypted and printed as a barcode.Protected: The character string cannot be broken up and the entire string will be printed on one line . © SAP AG BC460 1-57 .Character Formats: Standard Attributes Standard attributes String BF Description Protected Hidden Superscript Subscript Boldface On Marker Bar code Off Retain Adopt Adopt header header data or data or paragraph paragraph format formatsettings settings Symbolic Symbolic name name of of a a bar code from SAPscript bar code from SAPscript font fontmaintenance maintenance Override Override header header data data or or paragraph paragraph format format settings settings © SAP AG 2001 Standard character format attributes include: .Subscript: The character string is printed one half line space below the line .

bold. choose Retain or leave the values for 'Font family' and 'Font size' blank. © SAP AG BC460 1-58 . To override a previously defined form header or paragraph format.Character Formats: Font Attributes Font attributes String Family Font size BF COURIER 12. italics.' If you want the font attributes you have selected for a specific paragraph to be valid for the remainder of the form. choose 'On' or 'Off. font size.0 Point Description Bold Italic Underlined On Boldface Off Retain Adopt Adopt header header data data or or paragraph paragraph format format settings settings SAPscript SAPscript font font maintenance values maintenance values Override Override header header data data or or paragraph paragraph format format settings settings © SAP AG 2001 You can define font attributes by specifying font. or underlining.

Sub-Object Documentation Headerdata data Header Page layout layout Page Paragraphformats formats Paragraph Characterformats formats Character Documentation Documentation © SAP AG 2001 © SAP AG BC460 1-59 .

When you choose this pushbutton. List of all text elements MAIN . text elements. © SAP AG BC460 1-60 .ITEM_HEADER MAIN .ITEM_LINE .. and so forth) is displayed. You can maintain form documentation using the Form documentation pushbutton. windows.... you can enter long texts documenting the individual components. On this screen. © SAP AG 2001 Any changes that you make to a form should be documented accordingly. a list of form components (pages.Form Elements: Documentation List of all pages PAGE_1 PAGE_2 . Editor Enter long texts List of all windows WINDOW_1 MAIN ...

Form Elements: Summary of the Unit You can now: Name the elements that SAPscript provides for structuring your form. Create these elements in the system and change them. © SAP AG 2001 © SAP AG BC460 1-61 .

SAPscript: The PC Editor and the Line Editor Contents: How the PC editor and the line editor work Entering text using the editors Outputting text to the screen or a printer Simple text operations Text formatting © SAP AG 2001 © SAP AG BC460 1-62 .

you can: Describe the structure of the PC editor and the line editor Create texts in the PC editor and the line editor List which text operations and formatting possibilities are available Explain text elements © SAP AG 2001 © SAP AG BC460 1-63 .SAPscript Editors: Objectives At the end of this unit.

The SAPscript Editor TheSAPscript SAPscriptEditor Editor The Formelement: element:Text Textelement element Form © SAP AG 2001 © SAP AG BC460 1-64 .

0 or Windows95 installed on it.o © SAP AG 2001 Two different editors are available in SAPscript for entering text: The PC editor and the line editor... In order to use the PC editor. your operating system must meet several requirements...PC Editor and Line Editor Standard text: Request Settings PC editor... From the 'Standard Text: Request' screen you can choose which editor you want to work with.+..4.. SAPscript .+. Line editor ....+ User-specific settings * This is a normal text..+. PC Editor Graphical PC editor PC editor This is a normal text.. © SAP AG BC460 1-65 .. Choose Goto -> Change editor from within one editor to change to the other.+...2..... The PC editor also requires various DLL and OCX files that are automatically installed by the SAP GUI.3.. Users do not have to worry about installing these themselves........ Your front-end must have either Windows NT 4.. A dialog box simply asks you if the most current versions of these DLL and OCX files should be installed..1..

SAPscript navigation commands are also automatically tested using an integrated syntax check. paragraph formats are assigned using the tag column. From Release 4. In the line editor. The attributes of individual formats must be displayed using the menu. standard texts. Text can be selected by double clicking on it or by using a special pushbutton. © SAP AG BC460 1-66 . Special text structures are also identified in the tag column. The major advantage of the PC editor is that all its functions can be reached either by mouse click or by using pushbuttons. Character formats can be found in the menu. Paragraph and character format assignments can be made using pushbuttons and any changes made are immediately displayed on the screen.PC and Line Editor Operations PC editor Paragraph and character formats visible on the screen Paragraph and character format selection using pushbuttons Functions can be reached using mouse or pushbuttons Line editor Paragraph formats in format column using F4 Character format selection using menu Text area selection using pushbutton or by double-clicking Special text structures such as SAPscript navigation commands are identified in the format column Integrated syntax check for SAPscript navigation commands Special text structures displayed separately Integrated syntax check for SAPscript navigation commands © SAP AG 2001 Use the PC editor and the line editor for entering texts such as long texts in applications (for example materials texts). or texts in forms. an integrated syntax check is also available in the line editor.0A.

The paragraph format and character format pushbuttons allow you to assign your text paragraph and character formats according what is selected. in contrast to line editor operations. © SAP AG BC460 1-67 .The PC Editor Text Edit Goto Format Include System Help Paragraph formats Character formats Reset character formats Display formats Paste Copy Cut Print preview Display/Change © SAP AG 2001 The PC editor is similar to other common text editors and functions according to the WYSIWYG principle (What You See Is What You Get). PC editor operations are called. using pushbuttons and menu functions.

your text automatically wraps when it reaches the right edge of your window. Within a paragraph. the new paragraph is formatted according to the default paragraph setting. New line This is a normal text. use SHIFT + ENTER. Otherwise the new paragraph assumes the format of the one immediately preceding it. position the cursor and press ENTER.o This is a normal text in a new line in the same paragraph. © SAP AG BC460 1-68 . To insert a line break within a paragraph. If no paragraph format has been used up to this point. To create a new paragraph.o This is a normal text in a new paragraph.o Shift + © SAP AG 2001 The editor provides automatic word wraparound.Entering Texts in the PC Editor New paragraph This is a normal text.

Select the text you want to format by holding down your left mouse button and pulling the cursor over the area that you want to select.Character. In order to reset the new format to what it previously was.o C Centered H Bold font Assign new paragraph or character format This is a normal text in a new centered paragraph. or by choosing Format Paragraph and Format . © SAP AG BC460 1-69 . choose Edit -> Selected area -> Last character format and Edit -> Selected area -> Last paragraph format. either by using your mouse to click the corresponding pushbutton on your screen. Release the mouse button and the text that you chose should be selected. The paragraph and character formats available are visible on the screen in the PC editor. Now choose the paragraph or character format you want for that bit of text.o © SAP AG 2001 You can use the PC editor to format paragraphs.Assigning Paragraph and Character Formats Select text with mouse This is a normal text in a left-justified paragraph.

.Outputting Texts Using the PC Editor Standard text: Request Standard text . .. PC Editor Text .. you can specify various print parameters. Print . Print preview © SAP AG 2001 Print To output a text. the number of copies or pages.. Spool request . Print: General Standard Text .. © SAP AG BC460 1-70 .. choose Text → Print from the PC editor or Standard text -> Print from the Standard Text: Request dialog box. and several parameters for print control (for example. To start printing on the selected output device. In the subsequent dialog window. Output device . such as the output device.. choose Print on this display. To display the output on the screen. Print .... From the PC editor menu you can choose between Printing or Print preview.. choose Print preview..o Output options Print immediately Delete after printing New spool request ..... print immediately). This is a normal text...

The tag column contains the format ID or 'tag' that determines how the text will be formatted for output........ including: ...+...The Line Editor Ruler * ....The form currently being edited .The last paragraph and character formats used © SAP AG BC460 1-71 . The status bar provides status information about various editing functions..+.5. Enter desired paragraph formats here.The texts currently selected .3..+.......1/ 1 ---------- © SAP AG 2001 The title bar in the line editor displays the name of the current editing action and of the text being edited. Format column Text Status line --------------------------System--------------------Lines 1 .....2....+.....+.1. The menu bar offers users various application functions such as 'Save' or 'Print'..4.+ This is a normal text..6.The line segment (screen line / total number of lines) ....+..

... .1. position the cursor and press ENTER.3.2......press ENTER ... A slash (/) in the tag column indicates this line break.+.. Use blank spaces to overwrite the key in the tag column 2...+.1........ . use F6..choose Format To merge two paragraphs: 1.+..2. Choose Format To delete blank lines or merge separate lines: 1.......... Choose Format © SAP AG BC460 1-72 . To insert a line break within a paragraph...Entering Text in the Line Editor New paragraph New line F6 . * * * * / © SAP AG 2001 To create a new paragraph.+........3.choose a menu function . An asterisk (*) in the tag column indicates the default paragraph format... Use blank spaces to overwrite the format key '/' 2....+.2.+..1..+.choose a function key ..+.....3.+..... The new paragraph has the same format as the preceding one... The editor provides automatic word wraparound when you: ...

..... The Insert mode displays blank lines.. © SAP AG BC460 1-73 . To exit the Insert mode.....+. The system returns to the original mode and inserts the new text at the cursor position..4.3.....+.....3.......+. position the cursor and choose Insert...+.....2.. The paragraph format stays the same when text is inserted.4.+.+...+..+ * F5 Insert Insert new text ....1.Inserting Text in the Line Editor .1..+. choose End insert. although you can change this if you wish... The title bar shows that the Insert mode is active.........2......+ F5 F3 * End insert © SAP AG 2001 To insert text. Enter the text to be inserted.

... Selected text is highlighted in a different color. When using the Select pushbutton....3....+.....+ End Select F2 * © SAP AG 2001 You can select text in the line editor using either the Select pushbutton or the by double clicking on it..Selecting Text in the Line Editor ..3.+.. Next place your cursor at the end of the text you want to select and choose the Select pushbutton..4. The system automatically starts the select mode after you have set the first select marker with your cursor...2....+....+.....4.... Additional clicks in the tag column incrementally increase the size of the area you have selected.... The area you have selected is also displayed in the status bar at the bottom of the page.2...1.. © SAP AG BC460 1-74 .....1....+... You can also select whole lines by simply double-clicking on that line's entry in the tag column.+.... place your cursor at the beginning of the text you want to select and then choose the pushbutton. This selects the area you want to edit..+..+ * Begin Select F2 ...+.

...... * this is any normal Paste (this is . Choose Goto → User Clipboard. position the cursor and choose Paste. © SAP AG BC460 1-75 . continuous text....... Cutting and Copying Text Select .. When you choose Cut or Copy.+..When you cut or copy text..1.Selecting. ) continuous text Cut or copy © SAP AG 2001 The select function allows you to delete or copy entire text passages with relative ease. the text you have selected is copied to the clipboard: .+.3.....+.2..Copy does not delete the marked text . There are three user clipboards that you can use to save text. To insert the contents of the clipboard. the previous contents of the clipboard are deleted.. To copy text to a different editor.. use the clipboard.Cut deletes the marked text .

.+........ When you mark an entire section... To display a list of possible paragraph formats choose F4. choose Last character format or Last paragraph format....4.. To apply paragraph and character formats. NN stands for a one or two character key. The dialog box displays the format key. When marking a character sequence.3.. Enter paragraph keys in the tag column...+....... © SAP AG BC460 1-76 .+..+.4..+.. choose Format → Paragraph or Format → Character.</>....1...+.. To format a character string enter <NN>..+ Format character ...2.+ Description Highlighted Underlined Raw character string B © SAP AG 2001 You can organize text using the paragraph and character formats that are available in the current form.... ensure there is no blank space between the last word to be marked and the cursor.... To reapply the format last used within marking mode.+.+....+ L Format: Character Form Character format H U ( .3....2...+...+..1....1..Paragraph and Character Formatting Format paragraph ...4.....2.+..... the system formats the word at the cursor position. You can change or delete format keys that have already been entered.3..........+.. In this dialog box.. its description and its attributes...... you can display the attributes of the different formats..

© SAP AG BC460 1-77 .. The data is inserted during preparation for printing.<)> &N.N&. the default positions of the underlying layout set are used. To protect an extended line from the previously defined line format..<)>. See also section 4.</> . To move a piece of text to the next tab position..N& Character string Tab character Hidden special characters Symbol Paragraph New line Raw line Line feed + raw line Default paragraph Comment line Extended line Line feed with extended line Command line NN / ( /( * /* = /= /: © SAP AG 2001 To suppress special character recognition. <(>. To format symbols. enter =.. enter /: in the tag column. set a double comma (. To add a comment line which is ignored when the text is formatted. enter /* in the tag column. the commands are not interpreted until the document is processed by the composer.. use <(>. To use a SAPscript control command.. If you do not define tabs. enter &N...Special Characters <NN>.. Symbols consist of spaces reserved for variable data. This function also suppresses the implicit blank space in the Editor at the end of the previous line. Control commands do not affect editor formatting.. Chapter 4 contains further details about this topic. You can define tab positions in paragraphs.) at the beginning of the text you want to move...

Form Element: Text Element The SAPscript SAPscripteditor editor The Formelement: element:Text Textelement element Form © SAP AG 2001 © SAP AG BC460 1-78 .

NY 14850 Dear Sir or Madam.80 USD Page 1 © SAP AG 2001 The various output areas that appear on form pages are called page windows. 145 Apple Valley Ln.00 USD AZ 0790 11/11/98 6:55 1644.80 USD LH 0400 07/28/98 6:07 398. Ithaca.Structuring Pages Using Forms Template Fly & Smile 4 Truckee Way Durango. © SAP AG BC460 1-79 . CO 85650 07/15/98 Form: Page window Turnaround Inc. Thank you for your booking. We are pleased to confirm the following flights: Flight Date Depart Price ----------------------------------AA 0017 07/20/98 13:15 799.00 USD LH 0400 07/21/98 6:07 387. Page window texts can be structured using text elements.

and data for the individual detail positions. column headers. Thank you for your booking.Windows Template Dear Sir or Madam.80 USD LH 0400 07/28/98 6:07 398. © SAP AG BC460 1-80 . We are pleased to confirm the following flights: Flight Date Depart Price ----------------------------------AA 0017 07/20/98 13:15 799. wraparound text.00 USD AZ 0790 11/11/98 6:55 1644. This body text contains the opening form of address.80 USD Window Dynamic body text © SAP AG 2001 The main window of a form should always output body text as a default.00 USD LH 0400 07/21/98 6:07 387.

Thank you for your booking.. one for the table header. For more information about these functions. Madam. The sequence in which these elements are output is controlled by the print program.80 USD Dynamic body text List List of of text text elements elements in in window window MAIN: MAIN: INTRODUCTION Dear Dear Sir Sir or or Madam. and one for the individual item data. texts within the main window such as the table header can be displayed multiple times in different areas within the window on different pages. one for the form of address and subsequent text. .00 USD 6:55 1644. In addition. © SAP AG BC460 1-81 . .. © SAP AG 2001 The text in the example above has been divided into three different text elements.00 USD 6:07 387. refer to the print program chapter. Thank Thank you you for for your your booking.Text Elements Template Window Dear Sir or Madam. We We are are pleased pleased to to confirm confirm the the following following flights flights: : ITEM_HEADER Flight Flight Date Date Depart Depart Price Price --------------------------------------------------------------------------------------------ITEM_LINE . You can also use the print program to determine if you want certain texts to be displayed at all. booking.. We are pleased to confirm the following flights: Flight Date Depart Price ----------------------------------AA 0017 07/20/98 AZ 0790 11/11/98 LH 0400 07/21/98 13:15 799.

&VAR2&.. The names of text elements that have already been created by users are displayed in bold print in the PC editor and the entire background of the line is gray.Text Elements in the Line Editor Format ID Text element named INTRODUCTION /E AS AS INTRODUCTION Dear Sir or Madam.. The name by which the text element is identified is highlighted in red in the line editor. © SAP AG BC460 1-82 .. Use the format ID /E in the format column of the line editor to denote the beginning of a text element. The end of a text element comes when a new text element is started using /E in the format column.Date. . .Departure. ... we would to confirm the following bookings: /E LI /: /E LP © SAP AG 2001 Beginning End ITEM_HEADER Flight.Price uline(30) ITEM_LINE &VAR1&.

but no /E text element is defined in the tag column.Text Element Types Text elements per window Named text elements Can have as many as you want per window Identified by name Output when chosen in print program Output sequence controlled by print program Default text elements Only one per window allowed Must be the first text specified Printed automatically © SAP AG 2001 SAPscript differentiates between default text elements and text elements with names. an address in a window other than a main window or a page number). which means that no print control functions are available. In contrast to named text elements. default text elements are output automatically. © SAP AG BC460 1-83 . You can tell that you are dealing with a default text element whenever you have body text at the beginning of a window (for example.

.. Use either the dialog box Form: Change Page Layout (graphical Form Painter) or the dialog box Form: Change Windows (alphanumeric Form Painter) to maintain these elements.... © SAP AG BC460 1-84 .. ..... Windows Window Maintain Maintaintext textelements elements Call editor Description Call editor Address ADDRESS .Maintaining Text Elements in the Form Painter graphical Form Painter Windows Graphic Window ADDRESS Description Address alphanumeric Form Painter .. Choose either Edit -> Text elements or the corresponding pushbutton (see slide above) to branch to the editor for that text element. Maintain Maintain text textelements elements Call Call editor editor © SAP AG 2001 You can use the Form Painter to maintain all text elements in any given window. .

SAPscript Editor: Summary of the Unit You can now: Understand the structure of the PC editor and the line editor. Enter texts in the PC editor and in the line editor. © SAP AG 2001 © SAP AG BC460 1-85 . Name the functions SAPscript provides for the layout of your text. Use text elements.

standard forms are altered to reflect the needs of individual customers. Activities Object Name of the print program to be used Name of the form to be used Name of the form to be created Development class Note: ## is your group number Name / Description SAPBC460D_01 SAPBC460D_FM_03 Z_BC460_EX3_## $TMP 1 Make a copy of the Form SAPBC460D_FM_03 and review the output on your monitor. BC460 1-86 © SAP AG .Exercises Unit: The PC Editor and the Line Editor • • • • Changes to SAP standard forms Layout using the graphical Form Painter and the alphanumeric Form Painter Text changes Print preview using the print program In most cases.

2 Perform multiple modifications to your form.Copy . Add a new column called “Discount. 2-1 Change the text of the letter (in the MAIN window) as desired. In the window Object Catalog Entry select Local Private Object. Test your form as described in 1-3. 2-5 2-6 2-7 © SAP AG BC460 1-87 . Use bold for the flight number mentioned in the letter. 1-3 Run the print program SAPBC460D_01 for your form name. Save and activate the form. Enter the discounts in this column.Paste Note that the PC Editor allows you to work in a way that is very similar to other text editors. Move the DATE window to the same line as the ADDRESS window. Choose Screen Display. Then observe the results in the line editor. In the next dialog window choose Print Preview. Use the following functions in the editors: .Select . Note: The graphical Form Painter allows you to easily move a window to a different place on a page. 2-2 2-3 2-4 Change the address in your form. Use the Form -> Copy to copy the form SAPBC460D_FM_03. Make a change in one and observe the change in the other. Choose Save. Create a paragraph format to write justified text in a bold format.1-1 1-2 Create a new form with the name Z_BC460_EX3_xx. Choose Activate.Insert . It is very important that you use both the line editor and the PC Editor tools. Suppress the page number on the first page.” Define new tabs for the appropriate paragraph formats.Cut . To toggle between the two editors choose Goto->Change editor. Apply this character format while in the PC Editor. Add some text using this new paragraph type.

Solutions Unit: PC Editor and Line Editor • • • • Changes to SAP standard forms Layout using the graphical Form Painter and the alphanumeric Form Painter Text changes Print preview using the print program In most cases. 1-2-1 Choose Save. 1-2-2 In the dialog window Create object catalog entry choose Local object. 1-1-6 To copy the form choose Form –> Copy. 1-1-4 Choose Create. standard forms are altered to reflect the needs of individual customers. © SAP AG BC460 1-88 . 1-1-5 Enter a Description. 1 Copy form SAPBC460D_FM_03 and check the output on the screen. 1-1-3 Enter the name of the new form: Z_BC460_EX3_xx. 1-1-2 Choose Tools –> SAPscript –> Form. 1-2-3 To activate your form choose Form –> Activate. 1-1 Create a new form named Z_BC460_EX3_xx. 1-1-1 Choose Copy to copy form SAPBC460D_FM_03. 1-2 Save and activate the form.

1-3-4 In the subsequent dialog window choose Print preview.1-3 For your form name. 2-2-2 Choose Text. 2-1-6 Use the following functions in the editors: . 2-1-3 Choose Layout. 1-3-3 Enter the form name and choose Screen display. In the form maintenance transaction choose the graphical Form Painter (Tools –> SAPscript –> Form. Use the PC Editor as well as the Line Editor.Insert . 2-1-1 Make sure to use the graphical Form Painter. © SAP AG BC460 1-89 . 2-1-4 In the dialog window select the MAIN window with the mouse.Select . 2-2 Change the address in your form. 1-3-1 Choose System –> Services –> Reporting.Copy . 2-2-3 Make changes. and then Settings –> Form Painter). 2-2-4 To activate the form choose Form –> Activate and to test it choose Form –> Check. 2 Make the changes to your form. 1-3-2 Enter the program name and choose Execute. 2-1-2 Return to the form in change mode. Test the form as described in 1-3.Cut . 2-1 Change the letter text (in the MAIN window). Make a change in one editor and look at the change in the other. 2-1-7 To activate the form choose Form –> Activate and to test it choose Form – > Check. execute the print program SAPBC460D_01. 2-2-1 Switch to the ADDRESS window.Paste Note that you can work with the PC Editor as with any other word processing editor. To toggle between the two editors choose Goto –> Editor. 2-1-5 Choose Text.

2-5-3 Enter a two-character key and a description. 2-4-1 Return to the graphical Form Painter. 2-5-1 To switch to the paragraph view choose Goto –> Paragraph formats. 2-4 Move the DATE window to the same level as the ADDRESS window. Note: For the DATE window. 2-5-8 Insert a new paragraph. 2-5-4 Set the alignment to JUSTIFIED. 2-5-5 Choose Font to activate bold printing and to select a font family.2-3 Suppress the page number on the first page. 2-5-10 Choose Goto –> Editor to switch to the Line Editor. 2-5-6 To return to the layout view choose Goto –> Layout. 2-5-7 Edit the text elements of the MAIN window as before. 2-4-4 Keep the left mouse button depressed and move the DATE window to the same level as the ADDRESS window. Enter text that uses the new paragraph format. 2-4-3 Select the DATE window using the mouse. 2-5-2 To create a new paragraph choose Edit –> Create element. 2-3-1 Return to the graphical Form Painter. 2-5 Create a paragraph format that allows you to write text justified and bold. Note: With the graphical Form Painter. 2-5-11 To activate the form choose Form –> Activate and to test it choose Form –> Check. © SAP AG BC460 1-90 . 2-4-2 Make sure to be on the FIRST page. you can assign the same upper left coordinates as defined for the ADDRESS window. Have a look at the paragraph tag. 2-3-3 Switch to the window PAGENO. 2-4-5 To activate the form choose Form –> Activate and to test it choose Form –> Check. you can move a window using Drag&Drop. 2-3-4 Choose Form –> Change page layout and then Delete. 2-5-9 Position the cursor on the paragraph and use the mouse to select the newly created paragraph format. 2-3-2 Make sure to be on the FIRST page.

2-6 In the PC Editor use bold for the flight number specified in the letter. 2-6-1 Edit the text elements of the MAIN window as before. 2-7-10 Do the same for paragraph IL. © SAP AG BC460 1-91 . 2-7-7 Choose Goto –> Paragraph formats to go to the paragraph maintenance. To activate the form choose Form -> Activate and to test it choose Form –> Check. 2-7-4 Go back to the PC Editor. The tab there appears as a double comma (. 2-7-3 Go to the Line Editor. 2-7-2 In the header line after the price insert a tab and enter “Discount”. Define new tabs for the relevant paragraph formats. 2-7 Add a new column named “Discount”. 2-7-5 Insert a tab and enter discounts for several item lines. 2-6-4 Go to the Line Editor to see how the character format appears there. 2-6-3 Choose character format Bold. 2-7-1 Edit the text elements of the MAIN window as before. 2-7-6 Choose Back.. 2-6-2 Double-click on the flight number in each line to mark it.). Then look at the result in the Line Editor. 2-7-9 To modify the tabs choose Tabs and enter your own alignment and position for the discount column. 2-7-8 Choose paragraph IH. Enter the discounts in this column.

Symbols and Control Commands Contents: Using symbols Types of symbols Formatting options with symbols Control commands in the SAPscript Editor © SAP AG 2001 © SAP AG BC460 1-92 .

Objectives At the end of this unit you can: Use SAPscript symbols Describe the difference between the types of symbols Include the various formatting options Control the output of a SAPscript text using control commands in the editor © SAP AG 2001 © SAP AG BC460 1-93 .

.6.2....+... VA 20654 © SAP AG 2001 Symbols are placeholders for values that are inserted during print formatting. Capital City.+. Symbol names may not contain a blank space....4..+......... VA 20654 .....Using Symbols Jane Smith 81 Third Ave. * / / / &Name& &Street& &City& &Name& &Street& &City& Jane Smith 81 Third Ave.4/ 1 ---------- Capital City. © SAP AG BC460 1-94 ... The use of symbols allows you to output the most current values from SAP tables in the form of text modules. and that are not case sensitive.+...3..+. Symbols are identified by names surrounded by ”&” characters at beginning and end....they are not allowed to wrap to the next line of text.+...1... ---------------------System-------------Zeilen 1 . Symbols must always completely fit on a single text line--...5.

Standard symbols .Program symbols .Types of Symbols System symbols Standard symbols Program symbols Text symbols © SAP AG 2001 SAPscript uses four different types of symbol: .System symbols . You can select symbols by choosing Include → Symbols.Text symbols These symbol types differ in the way in which values are assigned to them. © SAP AG BC460 1-95 .

© SAP AG BC460 1-96 .System Symbols DATE DAY NAME_OF_DAY MONTH NAME_OF_MONTH YEAR TIME HOURS MINUTES SECONDS PAGE NEXTPAGE DEVICE SPACE ULINE VLINE Date Day Name of day Month Name of month Year Time Hours Minutes Seconds Page number Number of next page Output device Blank space Underline Vertical line © SAP AG 2001 SAPscript provides standard system symbols that are automatically replaced with data from the R/3System when a document is printed. is also available to users. which contains system symbols.5 A. the table TTXSY. From Release 4. You can use system symbols in any document. choose Include → Symbols → System. To choose a system symbol.

or by choosing Tools → SAPscript → Administration → Settings. 60 characters © SAP AG 2001 Standard symbols are application-defined. Standard symbols are language-specific. 22 characters Value: max.&MFG& for the closing salutation: "Yours faithfully" © SAP AG BC460 1-97 .. You can use standard symbols in any document.&SGDH& for the opening salutation: "Dear Sir/Madam:" . You can display or change standard symbols either by choosing System → Services → Tablemaintenance → Extended table maint.Standard Symbols Table TTDTG Symbols are user-defined Symbols are language-dependent Name: max. They are maintained centrally in table TTDTG. Examples of standard symbols are: .

This symbol is valid only in the text module for which you have defined it. The system displays all available text symbols in the current text and/or -form..Use DEFINE. This value is not saved together with the text.Text Symbols Value is defined in the text module DEFINE &symbol& = ’value’ Name: max. © SAP AG BC460 1-98 . To do so.. The value assigned to the symbol is saved when you save the text module. You can assign any value to the symbols. use DEFINE every time you assign a new value. . To assign several different values to the same symbol. 32 characters Value: max. The value assigned to a text symbol is only temporary. choose Include → Symbols → Text symbols .Use a standard text symbol. You can assign values to a symbol in the following two ways: . 60 characters © SAP AG 2001 You can define a text symbol for any text module.

STRAS& &KNA1 . Program symbols are for contents of data base fields or global program symbols. NAME1 PSTLZ ORT01 STRAS Jane Smith 80801 Capital City. DATA: COUNTRY LIKE . The data objects must be filled with values by the print program... The editing of the values effected via SAPscript in accordance with in the ABAP Dictionary or in the program defined characteristics. CA 80801 USA &KNA1 . * Data selection .PSTLZ&&KNA1 .Program Symbols KNA1 ABAP TABLES KNA1. Capital City.. SELECT OPTION etc.. © SAP AG BC460 1-99 . Global program symbols can be defined in the print program over DATA.NAME1& &KNA1 .. CA 81 Third Ave Form Jane Smith 81 Third Ave.ORT01& &COUNTRY& © SAP AG 2001 Program symbols are substitute symbols for values. which originate from the ABAP program. The necessary data base fields must be defined in a table or a structure in the ABAP Dictionary and be defined in the print program with a TABLES statement. * Start of form printing ..

. Choose Goto -> Print program -> Symbol definition with dialog in order to be able to jump to various print programs using the dialog box that this function calls........ © SAP AG BC460 1-100 .Program Symbols and Symbol Definition Text Edit Goto Format Include System Help Text Edit Goto Format Insert System Help Program symbols ... sflight.. Choose the Symbol definition pushbutton or Goto -> Print program -> Symbol definition to branch to a specific data object's definition screen in the print program.. . choose Insert -> Symbols -> Program symbols.. TABLES: spfli... You can add these symbols to your text simply by clicking on them. DDIC fields Short description . Programm symbols Program Symbolsymbols definition Symbol definition Print program for form Print for form Description Printprograms programm Print report RIPRAT01 RIPRAT01 ..... . In order to assign additional print programs to a form. SPFLI SFLIGHT CRTX .. Symbol definition REPORT riprat01..... Global data .... © SAP AG 2001 Choose the Program symbols pushbutton or Insert -> Symbols -> Program symbols to display a detailed list of program symbols for your corresponding print program. Here choose Append print prog. DATA: sums LIKE . A dialog box called Print program for form appears..

S . use the following additional options: . nothing is output Leading zeros are suppressed .R . Offset always refers to the formatted value. However.Length Data of a specified length is output .Offset Output begins here.(x.Z If the field has initial value. refer to the online documentation.C Several consecutive blank spaces are compressed into a single blank space. blank spaces at the end of the value are cut off.I . . You can also combine formatting options. Leading blank spaces are suppressed. © SAP AG BC460 1-101 . . To change the symbol display.2)& Decimal format &抰 ext1扴YMBOL’text2’& Text before and after © SAP AG 2001 The value of a symbol is displayed in full. for example: &’text1’SYMBOL’text2’&. For more formatting options.y) The output is right-justified The sign is hidden Decimal notation: the data has x length with y decimal places Text can also be inserted before or after a symbol.Formatting Options &SYMBOL& Offset &SYMBOL+4& &SYMBOL(5)& Length &SYMBOL(I)& Suppress initial value &SYMBOL(Z)& Suppress leading zeros &SYMBOL(C)& Compress blank spaces &SYMBOL(R)& Right-aligned output &SYMBOL(S)& Suppress operators &SYMBOL(*)& Dictionary length &SYMBOL(8.

You can also check syntax manually using Text -> Check.. symbols. Those commands and symbols inserted using the dialog box undergo a syntax check before they are inserted into your text.. These structures can be deleted or changed by placing your cursor on the appropriate line and choosing either Edit -> Delete command or Edit -> Change command.. © SAP AG 2001 Delete command Display command Delete command Change command Change command Insert command Insert command You can insert commands. and text elements in the PC editor by using Edit -> Insert command. © SAP AG BC460 1-102 .5A you can also check unknown symbols in form texts. From 4. The structures you insert appear in fields on the screen. ..Creating Additional Information in the PC Editor Text Edit Goto Format Include System Help Text Edit Goto Format Insert System Help Creating Create Additional Additional Information Information Symbols Symbols Command Command Text Text element element Comment Comment SAP SAP character characters .

. These commands allow you to: ..include text in a document .. ENDPROTECT NEW-PAGE IF . ENDCASE .evaluate conditions To enter a command.Control Commands /: /: /: /: /: /: /: INCLUDE DEFINE ADDRESS .start or suppress a page break .assign values to text symbols .. use the format key /: in the format column... © SAP AG 2001 You can use control commands to modify text output.. The length of a command must not exceed one line.. ENDADDRESS PROTECT .reset outline paragraphs .. © SAP AG BC460 1-103 .. ENDIF CASE .

. Smith ?S.and so on.Text Modules Text name: ADRS_FOOTER OBJECT: TEXT ID: ADRS XYZ Bank (Bank Number 699 700 99) 099 55555 SWIFT XYZ DESM 699 Language: E Executive Board: T. . For example.that is.Text objects are divided into text IDs to permit a more precise classification of text types.choose Tools -> SAPscript -> Standard text. such as "Item Text: Purchasing Document". Jones ?C. Smith ?S. the category "Sales and Distribution Texts" is a subcategory of "Materials Texts". H.T. Richards © SAP AG 2001 A form often contains predefined text modules such as materials lists. T.A text object describes the context of a document. the names of the executive board members. or a company footer that includes bank account numbers.K. Richardson Invoice Letter XYZ Bank (Bank Number 699 700 99) 099 55555 SWIFT XYZ DESM 699 Executive Board: T. "Materials Text".T.A.A. Williams ?S. Jones ?C. Such texts can be used for more than one application. Smith ?S.K. K. The text object and text ID are used to classify texts. text object and text ID. language.You can use a text module in more than one form To identify a text. specify the client. all texts allocated to Object TEXT . © SAP AG BC460 1-104 . or "Standard Text". Williams ?S. Williams ?S. Richards XYZ Bank (Bank Number 699 700 99) 099 55555 SWIFT XYZ DESM 699 Executive Board: T.H. name. You enter and store these text modules separately. .You can combine and display these modules in a form . To work on any standard document .H. customer descriptions. Jones ?C.A.

In either case. to include standard texts.LANGUAGE .ID . © SAP AG BC460 1-105 .. ID and LANGUAGE parameters. You must specify the name of the text you want to include. You can specify additional key fields for the text using the OBJECT..Including Text Modules / : INCLUDE ADRS_FOOTER OBJECT TEXT ID ADRS . INCLUDE name [parameter] parameter: ... Use Insert -> Text -> Standard . Enter the name of the text that you want to include in the dialog box that appears. If you use the PARAGRAPH parameter to specify a paragraph format in a form. Form: RVINVOICE01 Window : FOOTER / : INCLUDE &T001G-TXTFU& OBJECT TEXT ID ADRS ... use INCLUDE.OBJECT .PARAGRAPH © SAP AG 2001 You can include text modules from the current client in any window in a form. You can also include text modules in other text modules. this will be used as the default format in the inserted text.

To assign values to text symbols.. © SAP AG 2001 You must specify values for text symbols explicitly.. Text symbols are retained in the document. use DEFINE before the text symbol is displayed for the first time.Defining Text Symbols Form: RVINVOICE01 Window: FOOTER / : DEFINE &SYMBOL& = 'String1 String2 String3' . © SAP AG BC460 1-106 . you can easily change the value of a text symbol that appears repeatedly in your text. The DEFINE command allows you to anchor the value you assign in a text. In addition. This means that the text symbol remains in the text module the next time you call it.

with postal codes. otherwise the sender's address will be formatted according to the COUNTRY parameter. For additional information.Formatting Addresses Form Form routines for formatting addresses according to country /: ADDRESS DELIVERY PARAGRAPH AD /: NAME &KNA1-NAME1& /: STREET &KNA1-STRAS& /: POSTCODE &KNA1-PSTLZ& /: CITY &KNA1-ORT01& /: COUNTRY &KNA1-LAND1& /: FROMCOUNTRY 慏E /: ENDADDRESS Composer Jane Smith 10 Jones Rd. The composer calls the function module ADDRESS_INTO_PRINTFORM when formatting addresses and transfers the appropriate format parameter from the text to the function module. Butte. refer to the online documentation for function module ADDRESS_INTO_PRINTFORM. the sender's postal code will be output as D-80801. You can assign both literals and symbols to the parameter. The corresponding reference fields are described in structure ADRS. You should always include the FROMCOUNTRY parameter when formatting addresses. © SAP AG BC460 1-107 . For example. MT 80801 USA International postal standards © SAP AG 2001 The ADDRESS-ENDADDRESS command formats addresses according to the postal norms of the recipient's country as defined in the COUNTRY parameter. if COUNTRY = Germany and no FROMCOUNTRY parameter is included.

and decimal format are user-specific...... date. use command lines.. © SAP AG BC460 1-108 ./: SET TIME MASK = ?. /: SET DATE MASK © SAP AG 2001 Time.. To modify the format of program and system symbols of this type. use the following control 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.

If there is not enough room on the page. To override the automatic page break in the main window and insert a manual page break..ENDPROTECT.. /: ENDPROTECT © SAP AG 2001 SAPscript automatically inserts a page break when the main window (MAIN) is full. © SAP AG BC460 1-109 . the PROTECT command acts as a NEWPAGE command and inserts a page break.. If the text lines fit onto the current page. All text lines enclosed by these commands are printed on one page. You can specify the subsequent page explicitly. If you do not. use the control command NEW-PAGE.. the page defined in the form is used as the next page. use PROTECT.Page Break and Page Protection Start new form page: /: NEW-PAGE [page] Protection against page break: /: PROTECT . To avoid unwanted page breaks.. .. they are printed on that page as if the PROTECT command had not been used.

. OR comparison operators .ENDIF.. The following comparison operators are permissible for the logical expression: . If the logical expression within the IF command is evaluated as being true.. Otherwise.= . the text lines enclosed by IF . they are ignored.. only one symbol can be tested for equivalence with different values. AND.< . use ELSE and ELSEIF within IF. © SAP AG BC460 1-110 .ENDIF. For the various cases.. ENDIF are printed. To set such conditions. use IF. CASE is a special type of multilevel case distinction using IF commands..Conditional Text Output: Case Distinction Conditional text output: / : IF condition : : / : ENDIF / : CASE symbol / : WHEN value : : / : ENDCASE Case distinction: © SAP AG 2001 You can specify that text lines should be output only when certain conditions are met.> EQ equal LT less than GT greater than >= GE <> NE greater than or equal not equal NOT. To distinguish between dual-level and multilevel cases.<= LE less than or equal These comparisons are text comparisons only.

The FRAME addition determines what line thickness the frame has. and SIZE allow you to output windows and individual text passages in a box or frame or with a shaded background. . The INTENSITY addition shades background area contained within the frame. Lines. The WINDOW addition sets the values for the top and left margins to those of the current window. and Shading Form Window1 Window1 [/ : POSITION WINDOW ] [/ : SIZE WIDTH 2 CM HEIGHT +40 TW] / : BOX FRAME 10 TW Window2 / : BOX INTENSITY 10 Window2 Window3 Window3 / : BOX HEIGHT 0 CM FRAME 20 TW / : BOX WIDTH 0 CM FRAME 20 TW © SAP AG 2001 The SAPscript commands BOX.Frames. size. . use appropriate units of measurement. and frame thickness. YPOS] (left upper corner of the frame in relation to the values contained in the POSITION command). shading should be entered in percent. The PAGE addition sets the values for the top and left margins to those of the page currently being displayed. POSITION./: BOX [XPOS] [YPOS] [WIDTH] [HEIGHT] [FRAME] [INTENSITY] for a frame of size WIDTH and HEIGHT at position [XPOS./: POSITION [XORIGIN] [YORIGIN] [WINDOW] [PAGE] to fix the source coordinates XORIGIN and YORIGIN for the XPOS and YPOS parameters in the BOX command. Use the following syntax: . © SAP AG BC460 1-111 . Position./: SIZE [WIDTH] [HEIGHT] [WINDOW] [PAGE] to define the WIDTH and HEIGHT values for the BOX command for the current WINDOW or PAGE.

ABAP Dictionary REPORT <prog>. Parameters transferred back to SAPscript from internal tables in programs are received by the PERFORM command as text symbols using the keyword CHANGING.. . The structure ITCSY is composed of two fields. Have a program in customer namespace Z read the data and then use the PERFORM command in SAPscript to call the program. © SAP AG 2001 ABAP report Use the PERFORM command to transfer SAPscript data to programs and program data into SAPscript without having to change your print program. The variables listed under the PERFORM command are symbols... Example: You want to use data from a SAPscript database table that cannot be read by the print program assigned to it. . FORM <form> TABLES in_tab STRUCTURE itcsy out_tab STRUCTURE itcsy. .. Text fields are transferred into the NAME field and text field contents into the VALUE field. ENDFORM.Calling ABAP Subroutines Form /: PERFORM <form> IN PROGRAM <prog> /: USING &invar1& /: USING &invar2& 厖 ? /: CHANGING &outvar1& 厖 . . All symbols (parameter name and contents) that are transferred from SAPscript to the program being called are listed in the PERFORM command using USING. /: ENDPERFORM IN_TAB structure ITCSY NAME invar1 invar2 VALUE . NAME and VALUE. © SAP AG BC460 1-112 .. The form routine called during this procedure has to use an internal table based on the structure ITCSY.

Symbols and Control Commands: Summary of the Unit You can now: Include SAPscript symbols Differentiate between the various symbol types Include several different formatting options Use control commands in the editor to prepare a SAPscript text for output © SAP AG 2001 © SAP AG BC460 1-113 .

standard forms are altered to reflect the needs of individual customers. Choose Form -> Copy (see Exercises: PC Editor and Line Editor). 2 Change the greeting in Element INTRODUCTION of Window MAIN to print the customer’s name. The print program does not have access to this information.Exercises Unit: Symbols and Control Commands • • • • Changes to SAP standard forms Layout using the graphical Form Painter and the alphanumeric Form Painter Text changes Print preview using the print program In most cases. Use a text symbol which you fill using your own program. Activities Object Name of the form to be creates Name of the form to be used Name of the print program to be used Name of the program to be created Development class Note: ## is your group number Name / Description Z_BC460_EX4_## SAPBC460T_FM_04 SAPBC460D_01 Z_BC460_EX4_## $TMP 1 Create a separate form called Z_BC460_EX4_xx to be used in this exercise. 1-1 Make a copy of the sample form SAPBC460T_FM_04. © SAP AG BC460 1-114 .

3-1 3-2 Select the SENDER window and choose Text. Read the name of this customer from table SCUSTOM in a form routine of an ABAP program. 3-3 3-4 3-5 © SAP AG BC460 1-115 . Use the SIZE command to set the width and height at ‘+0. Write the ABAP program Z_BC460_EX4_xx. 2-2 2-3 2-4 2-5 2-6 Test your changes using program SAPBC460D_01.4’ cm.2’ cm. You may want to use the DEBUG mode to check the values of INTTAB and OUTTAB. This positions the top left corner of the box . 3 Put a box around the SENDER window. Test your changes using program SAPBC460D_01. Use the PERFORM command in SAPscript to pass the date from your own program into the form.2-1 Use the DEFINE command to assign the value ‘00000022’ to a new symbol &CUST& in the MAIN window. ENDFORM. Remember. it must have a structure that looks like this: REPORT Z_BC460_EX4_##. Use the POSITION command to set the x and y origin to ‘-. *read the entry of the imported internal table *select the desired record from table SCUSTOM using the customer ID in *the field inttab-value(8)) *write the selected record back into the internal table to be exported.2 cm left and . This should be just a little larger than the window so that it will not touch any of the text inside the window.) Assign this value to the new symbol &NAME&. Use the BOX FRAME command to draw the box using a line width of 10 TW. Change the Greeting by using the symbol &NAME& now.2 cm to the window width and height. This makes up for the upper position and adds another 0.2 cm up from the top left corner of the window. (The performed program will be created below. FORM GET_NAME TABLES INTTAB STRUCTURE ITCSY OUTTAB STRUCTURE ITCSY.

4-2 4-3 4-4 4-5 © SAP AG BC460 1-116 . 4-1 Create a standard text module using Tools->SAPscript->Standard text. Include this text in your form. Test your changes using program SAPBC460D_01. Change the Text ID to SDVD (Standard text for SD forms). Note: Do not select any paragraph format because you want to control the paragraph formatting from the form. Note: To easily insert your newly created text module. Add the parameter PARAGRAPH to select the appropriate paragraph tag to make the text use CENTER alignment for printing. Use the INCLUDE command to select the standard text to be printed in your form.4 Create a standard text module with a name of Z_BC460_EX4_## and Text ID of SDVD. choose Insert->Text>Standard. Enter a few lines of text and save. Print the text with an alignment of CENTER.

because the print program cannot access the customer name. 2 In the text element INTRODUCTION in the MAIN window change the salutation to print the customer name. Use a text symbol that you must fill from within your own program. 1 For this exercise. 1-1-1 The solution form is called SAPBC460S_FM_04. 2-1 In the MAIN window use the DEFINE command to assign the value ‘00000022‘ to the new symbol &CUST&. standard forms are altered to reflect the needs of individual customers. Choose Command and enter the following: DEFINE &CUST& = ‘00000022‘ 2-1-2 Alternatively. 1-1 To copy form SAPBC460T_FM_04 as a template choose Form –> Copy (see Exercise: PC Editor and Line Editor). create a new form named Z_BC460_EX4_##. 2-1-1 In the PC Editor in the MAIN window for text element INTRODUCTION choose Edit –> Insert command. enter the following command in the Line Editor: /: DEFINE &CUST& = ‘00000022‘ © SAP AG BC460 1-117 .Solutions Unit: Symbols and Control Commands • • • • Changes to SAP standard forms Layout using the graphical Form Painter and the alphanumeric Form Painter Text changes Print preview using the print program In most cases.

in the Line Editor enter the follwing command: /: Dear Mr &NAME&. * Write the selected record back into the internal table to be exported ENDFORM. * Read the entry of the imported internal table * Select the desired record from table SCUSTOM using the customer ID in field inttab-value(8). 2-2-1 Immediately after the DEFINE command add the following command lines: /: /: /: /: PERFORM GET_NAME IN PROGRAM Z_BC460_EX4_## USING &CUST& CHANGING &NAME& ENDPERFORM 2-3 Change the salutation by using the symbol &NAME&. Note that the program must have the following structure: REPORT Z_BC460_EX4_##. FORM GET_NAME TABLES INTTAB STRUCTURE ITCSY OUTTAB STRUCTURE ITCSY. Assign this value to the new symbol &NAME&. 2-3-3 Position the cursor on that place in the line at which you want the name to appear. 2-3-4 Choose Edit –> Insert command. 2-3-1 Go to the PC Editor to the MAIN window under text element INTRODUCTION. In SAPscript use the PERFORM command to pass data from your own program into the form. © SAP AG BC460 1-118 . 2-4 Now write the ABAP program Z_BC460_EX4_##. 2-3-5 Choose Symbols and enter the following: &NAME& 2-3-6 Alternatively. 2-3-2 Delete the text you want to replace.2-2 Read the name of the customer form table SCUSTOM in a form routine of an ABAP program. (You will later create the executed program).

ENDFORM. MOVE scustom-name TO outtab-value. MODIFY outtab INDEX sy-tabix. MOVE 'no name' TO outtab-value. *&----------------------------------------------* *& Form GET_NAME *&----------------------------------------------* FORM get_name TABLES inttab STRUCTURE itcsy outtab STRUCTURE itcsy.2-4-1 The solution program is called SAPBC460S_04. IF sy-subrc = 0. " GET_NAME © SAP AG BC460 1-119 . READ TABLE outtab INDEX 1. MODIFY outtab INDEX sy-tabix. * select from scustom and modify outtab with new data SELECT SINGLE * FROM scustom WHERE id = inttab-value(8). ELSE. TABLES: scustom. READ TABLE outtab INDEX 1. ENDIF. * read first line of inttab READ TABLE inttab INDEX 1. The program coding reads as follows: REPORT sapbc460s_04 .

2-5 2-6 Use program SAPBC460D_01 to test your changes. position the upper left corner of the frame by 0.2‘ CM YORIGIN ‘-0. To do this choose Debugger –> Exit. Use the debugging mode to check the values of INTTAB and OUTTAB. 3 Put a frame around the SENDER window. © SAP AG BC460 1-120 . 2-6-2 In transaction SE71 activate the SAPscript Debugger (Tools –> SAPscript – > Form and then Utilities –> Activate debugger). 3-1 3-2 Select the SENDER window and choose Text. To do this position the cursor on the incorrect text and choose Change command.4‘ cm. If necessary correct the syntax. This levels out the upper position and adds 0. 2-6-4 You can deactivate the debugger only while it is running. Starting from the upper left corner of the window.2 cm to the top. 3-3-1 Insert the following command: /: SIZE WIDTH ‘+0. 3-2-1 Use the following command: /: POSITION XORIGIN ‘-0.4‘ CM 3-4 Use the BOX FRAME command to draw a frame with a line thickness of 10 TW.2-4-2 To make a syntax check of the text modifications choose Form –> Check – > Texts.4‘ CM HEIGHT ‘+0.2 cm to the left and by 0. 2-6-1 The ABAP Debugger is no subject of this course and will therefore not be described here. 3-4-1 Insert the following command: /: BOX FRAME 10 TW 3-5 Use program SAPBC460D_01 to test your changes. 2-6-3 Execute the program and check the form in the debugger.2‘ CM 3-3 Use the SIZE command to set the width and the height to ‘+0.2‘cm each. Use the POSITION command to set the origins of x and y to ‘-0.2 cm to the window width and height. Make it slightly larger that the window in order not to overlay any text.

Change the text ID to SDVD (standard texts for SD forms). Copy this text into your form. Note: You can include your newly created standard text by choosing Include -> Text -> Standard. 4-3 Use the INCLUDE command to include the text you want to print in your form. © SAP AG BC460 1-121 . 4-1 Choose Tools –>SAPscript –> Standard text to create a standard text. Add PARAGRAPH C after LANGUAGE EN. Print the text justified. Note: Do not select a paragraph format since you want to control paragraph formatting from within the form. 4-1-1 Text name: 4-1-2 Text ID: 4-2 Z_BC460_EX4_## SDVD Enter a few lines of text and save them. 4-4-1 To add the PARAGRAPH parameter choose Change command.4 Create a standard text named Z_BC460_EX4_## with the text ID SDVD. which means that you want to use the default. 4-5 Use program SAPBC460D_01 to test your changes. The default can be overruled from within the form. 4-3-1 Note that you can search for your text with Search (F4). 4-3-2 After using Include –> Text –> Standard to include the text the command reads as follows: /: INCLUDE Z_BC460_EX4_## OBJECT TEXT ID SDVD LANGUAGE EN 4-4 Enter the PARAGRAPH parameter to select the paragraph format that prints the text justified. 4-2-1 Use * as paragraph tag.

The Print Program Contents: Tasks of the print program and the composer Structure of the print program Important function modules Printing text elements Processing headings Composer procedure © SAP AG 2001 © SAP AG BC460 1-122 .

The Print Program: Objectives At the end of this unit. you can: Explain the structure of print programs in SAPscript Explain how print programs and forms work together Name the most important SAPscript function modules Write text element output in forms Describe how the SAPscript composer works © SAP AG 2001 © SAP AG BC460 1-123 .

number of copies.- © SAP AG 2001 In the R/3 System. The print program is either an ABAP report (type 1 program) or a module pool (Type M Program).300. Form ABAP program Application DB data tables: scustom. .50. monitor.selects the output device.. Smith 7 Second Ave. and pages to be printed. Date Invoice No..... J... the composer controls formatting of the document... both the print program and the form are needed to print documents.chooses a form for printing .. select * from scustom.. No..retrieves R/3 application data from the database . or fax ..defines the form processing logic (the order and repetition of text elements) .4 123-45-556-678 Composer Art.sets print attributes such as immediate output. call function 'START_FORM' ...: 0 81 5 4711 Ba nk No.... The print program .150. especially: . 47110 XYZ City Place. call function 'WRITE_FORM' .. During the actual print process. such as printer.line and page breaks in the form .The Print Program and Composer Print program report jh_form_01. © SAP AG BC460 1-124 .the page description for the spool request (Final Format or OTF). 00345 00379 02378 00458 Total XYZ Bank Acct.: 00 00 00 00 0 Price 200..700.the inclusion of long texts in a document .No.formatting of SAPscript control commands and symbol variables .. call function 'OPEN_FORM' ..

. sbook. call function 'START_FORM' . and MM are supplied with standard forms and print programs that can be customized.... call function 'OPEN_FORM' exporting form = . window = ...retrieving data from the R/3 System ... A print program can also print several forms which are either administered individually as separate spool requests or combined into a single spool request. ..printing out text onto the form Every time you print a form. © SAP AG BC460 1-125 .starting and ending form printing ..The Structure of a Print Program Retrieves data Opens form printing Closes form printing © SAP AG 2001 program rstxexp1.. call function 'CLOSE_FORM' . Changes to another form Prints output on form R/3 applications such as FI.. call function 'START_FORM' .. .. Within the print program you must distinguish between: . . use START_FORM and END_FORM. call function 'WRITE_FORM' exporting element = .... you must use the paired function modules OPEN_FORM and CLOSE_FORM.. select * from . call function 'END_FORM' . use WRITE_FORM... To combine forms into a single spool request... .... ... call function 'END_FORM' ..... To print text elements in form windows.changing to different forms ... . CO. . .. use CONTROL_FORM. To transfer control commands to a form. tables: scustom.

. You cannot print the text if you use this value. you can obtain status information and the print and fax parameters from the RESULT parameter (structure ITCPP). = ... . . To end form printing. ...use the OPTIONS parameter (structure ITCPO). To specify attributes for printing or faxing . use the FORM and LANGUAGE parameters. CALL FUNCTION 'CLOSE_FORM' IMPORTING RESULT = . You must call OPEN_FORM before you can work with any of the other form function modules. To control the output channel. .. such as the name of the device in DEVICE = PRINTER or DEVICE = TELEFAX.Beginning and End of Form Printing CALL FUNCTION 'OPEN_FORM' EXPORTING FORM = LANGUAGE = DEVICE = OPTIONS = DIALOG = IMPORTING LANGUAGE = EXCEPTIONS . use the DIALOG parameter. use the DEVICE parameter with: . ... . and so on . = ... Once the form printing has finished.PRINTER for print output using spool . immediate output.TELEFAX for fax output using spool or SAPconnect .. ..such as the number of copies.. use the CLOSE_FORM function module.. © SAP AG 2001 The function module OPEN_FORM initializes form printing. © SAP AG BC460 1-126 ....... To suppress the dialog box for output device parameters. EXCEPTIONS .SCREEN for monitor output using GUI. To specify the form and the desired language. .

The function modules for each form are called between START_FORM and END_FORM. EXCEPTIONS . Use either START_FORM or CLOSE_FORM after END_FORM.... Note: END_FORM cannot replace CLOSE_FORM.. Before using START_FORM for the first time. you must call OPEN_FORM.. begin each form using START_FORM and end it using END_FORM. EXCEPTIONS . = . © SAP AG BC460 1-127 .Outputting Several Forms Using a Single Spool Request CALL FUNCTION 'START_FORM' EXPORTING FORM = ... IMPORTING LANGUAGE = . use the FORM and LANGUAGE parameters... STARTPAGE = . LANGUAGE = . To choose a start page other than the default start page...... use the STARTPAGE parameter. To specify the form under START_FORM. © SAP AG 2001 To print several identical forms containing different data within a single spool request.. END_FORM does not end the printing process.. = ... CALL FUNCTION 'END_FORM' IMPORTING RESULT = .

. You must specify the desired text element using the ELEMENT parameter.. .. The FUNCTION parameter specifies whether text is to be appended.. it is determined by the print program. The order in which text elements are printed corresponds to the order in which WRITE_FORM is called... © SAP AG BC460 1-128 .Output Options for Text Elements CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = FUNCTION = TYPE = WINDOW = EXCEPTIONS .. Main window (MAIN) • To append text • To define headings • To delete headings Non-main window • To append text • To replace text • To delete text © SAP AG 2001 To output text elements in the window of a form. use the function module WRITE_FORM... . . replaced or deleted. ... The TYPE parameter specifies the output area of the main window. The WINDOW parameter specifies the window in which the text element is output.. In other words. = .

BODY. The top and bottom areas of the main window allow you to create headers (titles) and footers (similar to creating page headers and footers in ABAP during print list generation). The size of the top and bottom areas depends on the size of the text contained in the field. The amount of space needed for this text is deducted from the BODY area. © SAP AG BC460 1-129 . SAPscript automatically outputs the current contents of these areas on every page that contains a main window. BODY or BOTTOM. and BOTTOM areas dynamically during form output. You can enter and change the contents of the TOP.Main Windows TOP BODY MAIN BOTTOM © SAP AG 2001 You can output text in the main window (type MAIN) in one of three areas: TOP.

This is the default value.- WRITE_FORM element = 'ITEM_LINE' window = 'MAIN' Art.. 00345 00379 MAIN Price 200. To do so.- MAIN © SAP AG 2001 To print text elements in the main window of a form. go directly to the LINES parameter and specify the text to be printed. The TYPE parameter must be set to BODY. EXCEPTIONS .. The order in which text elements are printed corresponds to the order in which WRITE_FORM is used in the print program. The output of text elements in the main window triggers a page break as soon as the current page window is full.. The FUNCTION parameter is not relevant here.Outputting Text Elements in the Main Window CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = . © SAP AG BC460 1-130 . = ..No.No. &vbdpa-netpr& Art... The WINDOW parameter must be set to MAIN. use WRITE_FORM. You can also use the WRITE_FORM_LINES function module. /E ITEM_HEADER Art. You must specify the desired text element using the ELEMENT parameter.. 00345 Price 200...150. This is the default value.Price /E ITEM_LINE &vbdpa-matnr&.No.

Output heading to current page Write heading in TOP area Delete heading from TOP area for next page © SAP AG 2001 You can add headers to main windows using WRITE_FORM. the header is first output in the BODY area and then output in the TOP area on subsequent pages. If text has been entered in the BODY area. call function 'WRITE_FORM' exporting element = 'ITEM_HEADER' function = 'DELETE' type = 'TOP' window = 'MAIN' . call function 'WRITE_FORM' exporting element = 'ITEM_HEADER' type = 'BODY' window = 'MAIN' call function 'WRITE_FORM' exporting element = 'ITEM_HEADER' function = 'SET' type = 'TOP' window = 'MAIN' . a line item from an invoice) are output to the main window using WRITE_FORM.. no header can be subsequently deleted from the TOP area. TYPE = 'TOP'. a form of address and short text appear on the first page before the headers are output. the text elements that are to be output underneath it (for example.. In other words. call function 'END_FORM' . With many application forms. This deletion first takes effect on the following page. After these text elements have been output in their entirety... © SAP AG BC460 1-131 . This is why. TYPE = 'TOP'... the header is output for the first time at the beginning of the next page. .. After a header has been created.Creating and Deleting Headings call function 'START_FORM' . If no text has been entered in the BODY area.. in the example above. the header is deleted by calling WRITE_FORM.. This output can be several pages in length.. FUNCTION = 'DELETE'. FUNCTION = 'SET'. the header is output to the current page. if there is already text present in that BODY. TYPE = 'BODY'.

the order in which text elements are printed corresponds to the order in which WRITE_FORM is used in the print program.700. Unlike text inserted into the main window.No. = . As with the main window.. You must specify the name of the text element in the ELEMENT parameter. any text that does not fit into the current page window is lost.. 00345 00379 02378 00458 Total Price 200. © SAP AG BC460 1-132 .- WRITE_FORM element = 'INFOTEXT2' function = 'APPEND' window = 'INFO' Art. INFO INFOTEXT1 INFO INFOTEXT1 INFOTEXT2 Art.50.150. 00345 00379 02378 00458 Total Price 200.- © SAP AG 2001 To add a text element to a non-main window. FUNCTION = 'APPEND' WINDOW = 'INFO' EXCEPTIONS . use WRITE_FORM with FUNCTION = ’APPEND’.300.. The FUNCTION parameter must have the value ‘APPEND’.150. You must specify the name of the non-main window in the WINDOW parameter.300.50.No.700. The TYPE parameter is not relevant here....Adding Text Elements to Non-Main Windows CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = .

.No.150. use WRITE_FORM with FUNCTION = ’SET’.50.700. 00345 00379 02378 00458 Total Price 200. 00345 00379 02378 00458 Total Price 200.- INFO INFOTEXT3 WRITE_FORM element = 'INFOTEXT3' function = 'SET' window = 'INFO' Art.300..50.300. © SAP AG BC460 1-133 .- © SAP AG 2001 To replace the current content of a non-main window with a text element... The FUNCTION parameter must have the value ‘SET’ (which is its default value)..Replacing Text Elements in Non-Main Windows CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = .No. You must specify the name of the window in the WINDOW parameter. = .150. The TYPE parameter is not relevant here.. INFO INFOTEXT1 INFOTEXT2 Art.700. You must specify the name of the text element in the ELEMENT parameter. FUNCTION = 'SET' WINDOW = 'INFO' EXCEPTIONS .

You must specify the text element in the ELEMENT parameter. You must specify the window in the WINDOW parameter. 00345 00379 02378 00458 Total Price 200.- © SAP AG 2001 To delete a text element from a non-main window.Deleting a Text Element in a Non-Main Window CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = FUNCTION = WINDOW = EXCEPTIONS .700.. use WRITE_FORM with FUNCTION = ’DELETE’. 00345 00379 02378 00458 Total Price 200. The FUNCTION parameter must have the value ‘DELETE’. INFO INFOTEXT1 INFOTEXT2 Art.- INFO INFOTEXT1 WRITE_FORM element = 'INFOTEXT2' function = 'DELETE' window = 'INFO' Art..300. © SAP AG BC460 1-134 . 'DELETE' 'INFO' . = ..150.No.50.No..50.150.. The TYPE parameter is not relevant here.300..700.

00345 00379 02378 00458 Total Price 200. To print text elements in the TOP. A page break can be triggered by: .50.- XYZ Bank Acct.- Page break in the main window Art. BODY and BOTTOM areas. © SAP AG BC460 1-135 . use WRITE_FORM.a NEW-PAGE command in the main window (manual) The main window of a form is divided into the TOP. The text elements of non-main windows are not processed until a page break. or in non-main windows.an overflow of the main window (automatic) .:0815 4711 Bank No.150.700. A default text element at the beginning of a non-main window is printed once in the window as soon as the window is processed. No. Text elements in non-main windows are processed at page breaks or at the end of the layout set.300. default text elements in the main window do not appear in the main window of the subsequent page. Symbols in non-main windows are replaced when a page break occurs J. Date Invoice No.How the Composer Works The main window controls page breaks. 00345 00379 02378 00458 Total Price 200. Symbols in the TOP or BOTTOM area are replaced with data whenever changes are made to that area. 4 123-45-556-678 Art. BODY or BOTTOM area of the main window.700. following a page break.No. 47110 XYZ City Place. Symbols in the BODY area of the main window are replaced with data immediately.:000000000 © SAP AG 2001 The main window controls the page break.50.150. However. Smith 7 Second Ave.300.No.

© SAP AG BC460 1-136 . ITEM_LINE © SAP AG 2001 The function module CONTROL_FORM allows you to create SAPscript control statements from within an ABAP program. CALL FUNCTION 'CONTROL_FORM' EXPORTING COMMAND = 'ENDPROTECT'. = . . Normally. ENDPROTECT in SAPscript (see Chapter 4: Symbols and Control Commands). ...... hence the contents of text element ITEM_LINE are always output in one block on a single page. In the example above. CALL FUNCTION 'WRITE_FORM' EXPORTING ELEMENT = 'ITEM_LINE'. . . Enter the SAPscript statement you want to use to control output in the COMMAND parameter of the function module without the ‘/:‘ addition. . CALL FUNCTION 'CONTROL_FORM' EXPORTING COMMAND = 'PROTECT'. ABAP program . . EXCEPTIONS . you would have to have to execute the SAPscript statement PROTECT . ... .Calling Commands Using a Program CALL FUNCTION 'CONTROL_FORM' EXPORTING COMMAND = . text element ITEM_LINE is page protected..

Output text elements in forms. © SAP AG 2001 © SAP AG BC460 1-137 . Name the most important SAPscript function modules. Understand how the SAPscript composer works. Understand how the print program and the form interact.The Print Program: Summary of the Unit You can now: Describe the structure of print programs in SAPscript.

NOTE: Choose Pattern to adopt function modules. Take a look at the form in the Form Painter first so that you know in which sequence the print program should display the form's text elements. In some cases. standard forms are altered to reflect the needs of individual customers. the print program must also be altered to reflect these needs. © SAP AG BC460 1-138 .Exercises Unit: The Print Program • • • • Calling function modules for form printing Controlling printing using print programs Enhancements to print programs Print preview using the print program In most cases. Activities Object Name / Description Name of the form to be used Name of the print program to be created Development class Note: ## is your group number SAPBC460D_FM_03 Z_BC460_EX5A_## $TMP 1. Allow users to determine which page printout should begin with by including a selection screen on which they can enter a page number. 2. Write a print program that outputs form SAPBC460D_FM_03.

and fill the form with data. 1-1-2 Enter the program name SAPBC460T_05 and choose Program –> Copy. 1-1 Copy program SAPBC460T_05. It may also be useful to check the MAIN window of form SAPBC460D_FM_05. consult the training documentation for more information about the basic structure of print programs. 1-1-3 Enter Z_BC460_EX5_## and choose Copy to copy source code and text elements.Activities Object Name / Description Name of the form to be created Name of the form to be used Name of the print program to be used as a template Name of the print program to be created Development class Note: ## is your group number Z_BC460_EX5_## SAPBC460D_FM_05 SAPBC460T_05 Z_BC460_EX5_## $TMP 1 Copy print program SAPBC460T_05 and complete the report by inserting function module calls that open. 1-1-4 Choose the Local object function from the Create object catalog entry window. 1-2 Edit the source code of report Z_BC460_EX5_##. If you have problems determining the proper sequence of the function calls. The sections where code must be inserted are marked as follows: *CALL FUNCTION **************************************** * fill in missing statements **************************************** NOTE: Choose Pattern to adopt function modules. 1-1-1 Choose Tools –> ABAP Workbench –> Development –> ABAP Editor. © SAP AG BC460 1-139 . Such a check will show you the order of text elements. start. This report contains a print program whose function module calls for SAPscript form output is marked by asterisks. Complete the report by inserting function modules calls.

ENDIF. © SAP AG BC460 1-140 . Use the command IF . Choose Add print program. ELSE .. 2-1 Copy form SAPBC460D_FM_05 using Form –> Copy (see the exercises on the PC editor and the line editor) 3 Use Program symbols to add your program to the print program list.) 4-3 5 If your destination is NEW YORK.. 4-1 Add a tab and the destination city to the end of the line item. (Note: Merely going back to your selection screen is not enough. 4 Add a field to form Z_BC460_EX5_## for destination city (text element ITEM_LINE). Do not change the value SAPBC460D_FM_05 suggested in this example. If you have a printer. choose Print preview. 4-2 Add the new column to the text elements for item headers as well (ITEM_HEADER). display the following message in bold type after the line item: ”Please be aware of delayed check-in times in New York due to an American air traffic controllers strike!” 5-1 Print this text in a separate line after the line item. Insert the program symbol for destination city from table SPFLI. reduce output length using formatting options. The FORM parameter has to be supplied with the name of the SAPscript form used for printing.1-3 Test your finished program. If not enough space is left at the end of the line item. 2 Create a new form with the name Z_BC460_EX5_## that is to be used by your program. Activate the form and execute print program Z_BC460_EX5_## with your new form. 3-1 3-2 3-3 Choose Include –> Symbols –> Program symbols. you can even print the form out. Define a new tab position to position the field. To check form output. Run your program using Program –> Execute... Enter the name of your print program.

ENDPROTECT. In this exercise you may use ‘US‘ as land of origin. © SAP AG BC460 1-141 . Add FROMCOUNTRY as a subcommand to the ADDRESS control command.5-2 6 In order to prevent a page break from occurring between the line item and the message. Insert the program symbol for the customer's country after COUNTRY. If the customer's country is DE. If the customer's country is US. 6-1 Add COUNTRY as a subcommand to the ADDRESS control command in the ADDRESS window. 6-2 When you test this.. then 'Germany' should appear in the last line of the address. use the commands PROTECT . then no country should appear in the last line of the address. address output should appear in one of two different ways. The corresponding program symbol can be found in table SCUSTOM.. Add country names to customer addresses if the country of the sender differs from that of the customer.

1 The solution program for the first exercise is called SAPBC460S_05A. standard forms are altered to reflect the needs of individual customers.Solutions Unit: The Print Program • • • • Calls of function modules for form printing Output control via print program Enhancement of the print program in cooperation with the related form Print preview using the print program In most cases. PARAMETERS: stpage(10) DEFAULT 'FIRST'. -------------------------------------------------------------* * Open form printing © SAP AG BC460 1-142 . In some cases the print program must be altered to reflect these needs. *&-----------------------------------------------------------* *& Report SAPBC460S_05A * *------------------------------------------------------------* & Example print program for training course BC460. unit 5 * &------------------------------------------------------------* REPORT sapbc460s_05a .

CALL FUNCTION 'OPEN_FORM' EXPORTING form EXCEPTIONS OTHERS IF sy-subrc <> 0. = stpage * Write text element INTRODUCTION CALL FUNCTION 'WRITE_FORM' EXPORTING element EXCEPTIONS OTHERS = 1. = 1. WRITE: 'Error in OPEN_FORM'(001). ENDIF. = 'INTRODUCTION ' © SAP AG BC460 1-143 . WRITE: / 'Error in START_FORM'(002). = 'SAPBC460D_FM_03' * Select start page CALL FUNCTION 'START_FORM' EXPORTING startpage EXCEPTIONS OTHERS IF sy-subrc <> 0. = 1. ENDIF.

ENDIF. ENDIF. WRITE: / 'Error in WRITE_FORM. WRITE: / 'Error in WRITE_FORM. element ITEMS'(004). = 1. = 'CLOSING_REMARK' * End form printing CALL FUNCTION 'END_FORM' © SAP AG BC460 1-144 . WRITE: / 'Error in WRITE_FORM. = 1. element INTRODUCTION'(003). element CLOSING_REMARK'(005). * Write text element ITEMS CALL FUNCTION 'WRITE_FORM' EXPORTING element EXCEPTIONS OTHERS IF sy-subrc <> 0. ENDIF.IF sy-subrc <> 0. = 'ITEMS' * Write text element CLOSING_REMARK CALL FUNCTION 'WRITE_FORM' EXPORTING element EXCEPTIONS OTHERS IF sy-subrc <> 0.

= 3. WRITE: / 'Error in END_FORM'(006). ENDIF. ENDIF. © SAP AG BC460 1-145 . * Close form printing CALL FUNCTION 'CLOSE_FORM' EXCEPTIONS unopened = 1 bad_pageformat_for_print = 2 OTHERS IF sy-subrc <> 0. WRITE: / 'Error in CLOSE_FORM'(007). = 3.EXCEPTIONS unopened = 1 bad_pageformat_for_print = 2 OTHERS IF sy-subrc <> 0.

forcurkey LIKE sbook-forcurkey. © SAP AG BC460 1-146 . DATA: BEGIN OF sums OCCURS 10. forcuram LIKE sbook-forcuram. TABLES: scustom. SELECT-OPTIONS: s_id FOR scustom-id DEFAULT 200 TO 200. Any added program lines are highlighted. PARAMETERS: form LIKE thead-tdform DEFAULT 'SAPBC460D_FM_05'. END OF sums.unit 5 *&----------------------------------------------------------* REPORT sapbc460s_05b . s_fli FOR sbook-carrid DEFAULT 'LH' TO 'LH'. DATA connections LIKE spfli OCCURS 1000 WITH HEADER LINE. DATA customers LIKE scustom OCCURS 100 WITH HEADER LINE. DATA bookings LIKE sbook OCCURS 1000 WITH HEADER LINE. *&----------------------------------------------------------* *& Report SAPBC460S_05B * *&----------------------------------------------------------* *& Example print program for training course BC460. sbook. spfli.2 The solution program of the second exercise is called SAPBC460S_05B.

DATA BEGIN OF options. SELECT * FROM sbook INTO TABLE bookings WHERE customid IN s_id AND carrid IN s_fli AND forcurkey NE space ORDER BY PRIMARY KEY. DATA BEGIN OF result. WHERE id IN s_id ORDER BY PRIMARY KEY. INCLUDE STRUCTURE itcpo. INCLUDE STRUCTURE itcpp. options-tddelete = '*'. CALL FUNCTION 'OPEN_FORM' EXPORTING device © SAP AG = 'PRINTER' BC460 1-147 . DATA END * Get data SELECT * FROM scustom INTO TABLE customers OF result. * Open print job options-tddest = '*'. options-tdnewid = 'X'. options-tdimmed = '*'. SELECT * FROM spfli INTO TABLE connections FOR ALL ENTRIES IN bookings WHERE carrid = bookings-carrid AND connid = bookings-connid ORDER BY PRIMARY KEY. DATA END OF options.

* Set customer address scustom = customers. © SAP AG BC460 1-148 . ENDIF. EXIT. * Print form for all customers LOOP AT customers. = 'X' = options = 1 = 2 = 3 = 4 = 5 = 6. WRITE 'Error in START_FORM'(002).dialog options EXCEPTIONS canceled device form options unclosed OTHERS IF sy-subrc <> 0. * Open form of respective customer CALL FUNCTION 'START_FORM' EXPORTING form EXCEPTIONS OTHERS = 1. = form IF sy-subrc <> 0. WRITE 'Error in OPEN_FORM'(001).

element ITEM_HEADER'(004). EXIT. * Output introduction text CALL FUNCTION 'WRITE_FORM' EXPORTING element EXCEPTIONS OTHERS IF sy-subrc <> 0. = 'ITEM_HEADER' = 1. ENDIF. ENDIF. * Set column headings into TOP area of main window for * subsequent pages = 1. ENDIF. * Output column headings of main window CALL FUNCTION 'WRITE_FORM' EXPORTING element EXCEPTIONS OTHERS IF sy-subrc <> 0. WRITE 'Error in WRITE_FORM.EXIT. WRITE 'Error in WRITE_FORM. EXIT. element INTRODUCTION'(003). = 'INTRODUCTION' © SAP AG BC460 1-149 .

* Customer bookings CLEAR sums. REFRESH sums. spfli = connections. ELSE. * Get departure time READ TABLE connections WITH KEY carrid = bookings-carrid connid = bookings-connid. LOOP AT bookings WHERE customid = customers-id. WRITE 'Error in WRITE_FORM. © SAP AG BC460 1-150 . = 'ITEM_HEADER' = 'SET' = 'TOP' IF sy-subrc = 0.CALL FUNCTION 'WRITE_FORM' EXPORTING element function type EXCEPTIONS OTHERS IF sy-subrc <> 0. top element ITEM_HEADER'(005). ENDIF. sbook = bookings. ENDIF. CLEAR spfli. EXIT. = 1.

" at bookings * Delete column headings from TOP area of main window CALL FUNCTION 'WRITE_FORM' EXPORTING element function type EXCEPTIONS OTHERS IF sy-subrc <> 0. ENDLOOP. EXIT. WRITE 'Error in WRITE_FORM. = 1. EXIT. delete element ITEM_HEADER'(007). element ITEM_LINE'(006). . © SAP AG BC460 1-151 = 'ITEM_HEADER' = 'DELETE' = 'TOP' = 1. COLLECT sums. WRITE 'Error in WRITE_FORM. ENDIF.* Print item CALL FUNCTION 'WRITE_FORM' EXPORTING element EXCEPTIONS OTHERS IF sy-subrc <> 0. = 'ITEM_LINE' * Add current position to corresponding entry in table sums MOVE-CORRESPONDING sbook TO sums.

" at sums = 1. = 'CLOSING_REMARK' © SAP AG BC460 1-152 . WRITE 'Error in WRITE_FORM. EXIT. element CLOSING_REMARK'(008). element SUM'(009). ENDIF. MOVE-CORRESPONDING sums TO sbook. ENDLOOP. * Print sum LOOP AT sums.ENDIF. * Print final remark CALL FUNCTION 'WRITE_FORM' EXPORTING element EXCEPTIONS OTHERS IF sy-subrc <> 0. ENDIF. WRITE 'Error in WRITE_FORM. EXIT. = 'SUM' = 1. CALL FUNCTION 'WRITE_FORM' EXPORTING element EXCEPTIONS OTHERS IF sy-subrc <> 0.

The solution form is called SAPBC460S_FM_05. ENDIF. LEFT. = result " at customers = 1. EXIT.&SBOOK-FORCURKEY&.&SBOOK-FORCURAM&.&SBOOK-FLDATE&...&SBOOK-CONNID&. /E IM = = ITEM_LINE &SBOOK-CARRID&. The text element ITEM_LINE is defined as follows: = 1.. EXIT. * close print job CALL FUNCTION 'CLOSE_FORM' IMPORTING result EXCEPTIONS OTHERS IF sy-subrc <> 0. &SPFLI-DEPTIME&.. WRITE 'Error in CLOSE_FORM'(011).* Close customer form CALL FUNCTION 'END_FORM' EXCEPTIONS OTHERS IF sy-subrc <> 0.. &SPFLI-CITYTO(8)& © SAP AG BC460 1-153 .. WRITE 'Error in END_FORM'(010). ENDLOOP. ENDIF. 1 2 Copy the paragraphs IL to IM and add a sixth tab position: 15 CM.

The text element ITEM_HEADER is defined as follows: /E IJ ITEM_HEADER Flight... Destination 5 The text element ITEM_LINE reads as follows: / Delayed departures at New York Airport due to strikes of the American flight controllers!</> /: ENDPROTECT /: ELSE IM &SBOOK-CARRID&.&SBOOK-CONNID&... Depart...&SBOOK-FORCURAM&.&SPFLI-DEPTIME& = ..&SBOOKFLDATE&. 6 The ADDRESS window is defined as follows: /: ADDRESS PARAGRAPH AS /: TITLE &SCUSTOM-FORM& /: NAME &SCUSTOM-NAME& /: STREET &SCUSTOM-STREET& /: POSTCODE &SCUSTOM-POSTCODE& /: CITY &SCUSTOM-CITY& /: COUNTRY &SCUSTOM-COUNTRY& /: FROMCOUNTRY 'DE' /: ENDADDRESS © SAP AG BC460 1-154 .&SBOOKFORCURKEY&... Price. LEFT.&SPFLI-CITYTO(8)& /: ENDIF Activate the form and execute Z_BC460_EX_## with your new form.3 4 Copy the paragraphs IH to IJ and add a forth tab position: 15 CM. Date..

Styles Contents: Defining and using styles © SAP AG 2001 © SAP AG BC460 1-155 .

Styles: Objectives At the end of this unit. you can: Create and maintain styles Use styles © SAP AG 2001 © SAP AG BC460 1-156 .

To make temporary style changes within a document.... change styles....+... find existing styles or display all available styles..+. choose Format -> Change style... underlined G1 Outline level 1 Outline level 2 Outline level 3 F4 G2 G3 © SAP AG 2001 You define paragraph and character formats in styles that are then available independently of the existing forms...+.... The format definitions in the form have no effect then. in the editor.. To access it from within form maintenance or standard text maintenance. To access the style maintenance transaction... such as those for electronic mail messages or online documentation.4.....+ You have assigned a style to this text.2. You can assign a style to any text.1/ 1 ----------CU Italic.. You use the style maintenance transaction to create new styles. To display all formats defined in a style. choose Environment -> Style. When you assign a style.+.. this is an additional method to format text.. B You have assigned a STYLE to this text...... Besides the definitions in the form. This is an outline: => First level => Second level => Third level ----------MYSTYLE---------System-------------Lines 1 ..3.. SAPscript provides several standard styles.+.+.. choose Format -> Character and Format -> Paragraph.6.. the paragraph and character format definitions used in this style override those of the current form. choose Tools -> Form printout -> SAPscript -> Style... Description G3 AS B Outline level 3 Standard paragraph Bold CU This is an outline: G1 G2 G3 Format column(1) 6 En... First level Second level Third level F. © SAP AG BC460 1-157 .5.... To do so..1... use the control command /: STYLE..Styles: A Formatting Aid .

Styles: Summary of the Unit You can now: Create and maintain styles Use styles © SAP AG 1999 © SAP AG BC460 1-158 .

Form Printing: The Next Generation Contents: Objectives and advantages of SAP Smart Forms © SAP AG 2001 © SAP AG BC460 1-159 .

The Next Generation: Unit Objectives At the conclusion of this unit. you will be able to: List the objectives and advantages of SAP Smart Forms © SAP AG 2001 © SAP AG BC460 1-160 .

This eliminates the maintenance effort in the print program. © SAP AG BC460 1-161 . The Form Builder gives you an overview of all components used in the form (see next slide). the system automatically generates the associated ABAP code in the form of a function module. When you activate your SAP Smart Form.SAP Smart Forms: Objectives • Clear representation of the form logic • Reduced maintenance effort (by approximately 50%) • Automatic generation of the ABAP code © SAP AG 2001 SAP Smart Forms are maintained in the SAP Form Builder. You integrate this module with your data retrieval program.

Areas of the SAP Form Builder Form Edit Goto Utilities Environment System Help SAP Form Builder: Change Form ZBC470_INVOICE FormZBC470_INVOICE Global settings Pages and windows FIRST First page LOGO Company logo MAIN Main window INTRO Salut. The individual form elements (such as pages or graphics) are represented by nodes. This screen has several tabs on which you set and change the attributes of the node currently selected. you use the graphical SAP Form Builder. The Form Painter is used to define the layout of a page. You can select nodes to edit by double-clicking them in the navigation tree or the Form Painter. You can also enter text with the editor or use the Table Painter to determine the layout of a table. © SAP AG BC460 1-162 . In the middle: The maintenance screen. ADDRESS MAIN Main window Navigation tree © SAP AG 2001 Maintenance screen Form Painter To edit forms using SAP Smart Forms. This tree graphically displays the hierarchy of the SAP Smart Form. On the right-hand side: The Form Painter. You can additionally display the field list with variables below the navigation tree. The SAP Form Builder is divided into three areas: On the left-hand side: The navigation tree. You can hide the Form Painter if you wish: Utilities → Form Painter on/off. attributes Output options Cond. ADDRESS Address INFO Clerk SENDER Sender NEXT Next page Window Description MAIN Letter text SENDER INFO Gen. such as the position and size of text windows and graphics.

displaying items in complex tables requires a large number of tasks to be performed in the form and print program. © SAP AG BC460 1-163 . In SAP Smart Forms.SAP Smart Forms: Advantages • No control commands required • Table processing using SAP Smart Forms • Clearly defined interface between the form and the application program © SAP AG 2001 The technology of the SAPscript control commands is replaced with a new concept in SAP Smart Forms. In SAPscript. For example. This new concept is more intuitive and has been necessary because the function module is generated automatically. SAP Smart Forms also support the output of documents in XML format. you can use SAP Smart Forms to display the items with a dynamic table grid. this is automated using nodes.

Tables and Templates Table Your bookings: Flight Date AA017 12/16/2000 AA017 12/31/2000 Sum for AA LH400 11/17/2000 LH402 11/17/2000 LH403 12/12/2000 Sum for LH Total Template Name of passenger (not transferrable) Issued YILMAZ/E MS Price 1.860. are completely defined in the Form Painter.00 USD USD USD DEM DEM DEM DEM To Carr. © SAP AG BC460 1-164 . Templates. This means that the type and the number of their cells cannot be modified at application program runtime. DEM 402.59 Please do not write on or stamp this field. they are both designed with the Table Painter tool.00 1. The most important difference between them is how their layout is determined: The precise layout and the length of tables can only be determined at runtime.59 • Layout • Size © SAP AG 2001 Only at runtime • Layout fixed • Size fixed Tables and templates have several things in common.00 Tax 3344563125667 DEM 2. You therefore use templates primarily for external forms.200.00 1.860.00 610.00 2. 6NOV00 Flight Cl.00 DEM Total 52. however.00 USD 1.00 669. For example.200. and they use different line types. Date Time FRANKFURT BERLIN TXL Flight price LH LH 2362 2351 L 27NOV 1840 L 28NOV 1910 Form and serial number DEM 350. depending on the type and the number of records read by the application program from the database.400.00 581.400.

However. In the long term. © SAP AG BC460 1-165 . you should therefore convert your SAPscript forms into SAP Smart Forms. SAP provides continued support for SAPscript forms. SAP does not plan to further develop SAPscript.Future of SAPscript • SAP provides continued support for SAPscript forms • You can continue to use SAPscript forms • You can use SAPscript text modules in SAP Smart Forms © SAP AG 2001 You can use SAPscript forms simultaneously with SAP Smart Forms.

© SAP AG BC460 1-166 . the display of tables in SAPscript is primarily implemented using the print program.6C • SAPscript forms and SAPscript styles can be converted into SAP Smart Forms and Smart Styles (using the migration tool.6C. some adjustments may be required) © SAP AG 2001 You can find the function to convert SAPscript forms into SAP Smart Forms in the Utilities menu of the SAP Smart Forms maintenance transaction as of Release 4.SAPscript to SAP Smart Forms Migration • SAP Smart Forms are available as of Release 4. Since. for example. you must adjust such functions to the new SAP Smart Forms technology after migrating the form.

The Next Generation: Unit Summary You are now able to: List the objectives and advantages of SAP Smart Forms © SAP AG 2001 © SAP AG BC460 1-167 .

Modifications

Contents:
Assigning print programs to forms Change procedure Transporting SAPscript objects

© SAP AG 2001

© SAP AG

BC460

1-168

Modifications: Objectives

At the end of this unit you can: Assign print programs to forms during Customizing Explain what changes made to the SAP Standard mean to the end user List considerations when you correct and transport SAPscript objects

© SAP AG 2001

© SAP AG

BC460

1-169

Form Printing Procedure

RVADOR01 Create purchase order Transaction SAPMV45A VA01 Order confirmation
Print program

RVORDER01 Form Printer

Assignment stored in Customizing
Art. BA00 BA00 Medium Program 1 RVADOR01 2 RVADOR01 Form RVORDER01 RVORDER01

© SAP AG 2001

Forms can be printed automatically from a customer request, such as a purchase order. The above example is a simplified representation of just such a process. The customer submits an order. The system creates a purchase order. Order confirmation is generated when the purchase order is saved and this is sent to the customer to confirm that his order is being processed. The name of the form that is created, together with its print program, is stored in the corresponding application component during Customizing. If you want to use a different form or print program for printing, you should store it in your application component during Customizing.

© SAP AG

BC460

1-170

Enhancements to the SAP Standard

SAP delivers standard forms for all applications SAP also delivers corresponding print programs for these forms Sometimes forms must be altered to conform to customer needs Often forms can be changed to meet customer needs without having to alter the corresponding print program

© SAP AG 2001

SAP delivers standard forms for all applications as well as the corresponding print programs for these forms SAP standard forms can be altered to meet customer needs Often forms can be changed to meet customer needs without having to alter the corresponding print program

© SAP AG

BC460

1-171

Only make changes to an SAP print program after having seriously considered whether the modifications are absolutely necessary.When is it necessary to alter the print program? Additional data is needed Structural changes New text elements are needed Print program used to print different form © SAP AG 2001 Whenever SAP objects are altered. it is necessary to use a copy of the print program delivered by SAP when making changes to it. Modified objects are not protected from changes made during upgrades. Hence. Reasons to change an SAP print program: Need Structural changes New text elements are needed Print program used to print additional forms Additional data needed Action Change necessary Change necessary Change necessary Change may be performed if desired © SAP AG BC460 1-172 . this is called a modification.

Making Changes (1) Which new fields and which new tables are needed? Do these fields already exist in the tables already available or are new fields and tables necessary? Which program and which form are affected? © SAP AG 2001 Sometimes you need more data than is provided to you by the standard. Are these fields already available in the tables already being used or do you need additional tables? Have the table fields that you need already been supplied with data? Open up your application component in Customizing and note the forms and programs you are currently using to fulfill your needs. Before making any changes. try to get a clear overview of exactly which additional fields you need. © SAP AG BC460 1-173 .

Making Changes (2) Does the print program have to be changed or only the form? Can the data you need be delivered by another program using a PERFORM statement? Do SAP enhancements already exist in the shape of customer exits? © SAP AG 2001 Consider carefully whether it is necessary to change the print program. Be aware that additional data can be retrieved using the PERFORM command in SAPscript. Execute the PERFORM command in your form and write the subroutine called in a separate program in the customer namespace. The subroutine then retrieves the additional data you want. Such customer exits remain intact during upgrades and do not need to be subsequently adjusted. In some cases. or if it will be sufficient to simply alter your form. includes already exist that have been created by SAP application developers and that you can use to include your enhancements. © SAP AG BC460 1-174 .

To do this. © SAP AG BC460 1-175 . Whenever a form's structure has been altered. its print program will likely require changes as well. Store your newly created forms and print programs in Customizing.Making Changes (3) • Copy SAP standard forms and. When making changes to an SAP standard form. Test your changes. make a copy of it in one of the customer namespaces (Z or Y) and then make your changes to the copy. print programs to the customer namespaces Z and Y • Change copies • Store new forms and print programs in Customizing • Test changes © SAP AG 2001 Avoid making modifications if at all possible. copy the print program to one of the customer namespaces (Z or Y) and then make your changes to the copy. Use the SAP standard as a model for enhancements. if necessary.

forms are only available in the client in which they were created. as a matter of course. whenever your form is not available in the current client. If the form exists in client 000. SAP standard forms are. it is then made available in the current client. all stored in client 000. © SAP AG BC460 1-176 . Forms in client 000 have a special status. Whenever a form is not available in the current client. the system will automatically access the version available in client 000. You can make use of this kind of cross-client form access by storing your forms in client 000. Then.Requesting Forms Form request RVORDER01 Form request RVORDER01 Client 400 RVORDER01 is not available in clients 400 and 401 Client 401 All SAP forms are available in client 000 Client 000 © SAP AG 2001 Forms are client-dependent. the system checks to see if the form exists in client 000. This means that. except for the SAP standard forms stored in client 000.

In order to copy a SAP standard form. Enter the name of the form to be copied and choose a name for the target form in the current client. Call the form maintenance transaction (SE71) and choose Utilities -> Copy from Client. Client 000 is entered as the default source client. © SAP AG BC460 1-177 .Copying Forms Between Clients Program Edit Goto System Help Copying Forms Between Clients Form name Source client Target form x RVORDER01 000 ZRVORDER01 Original language only Action log © SAP AG 2001 SAP standard forms are client-dependent. it must be available in the current client.

. After you have made the changes you want. Source program Target program Copy RVADOR01 ZZZDOR01 © SAP AG 2001 To copy print programs.... call the ABAP Editor from the ABAP Workbench.. © SAP AG BC460 1-178 . Now you can edit the program you have copied. In the dialog box. insert the new print program at the appropriate point in Customizing.. Program .Copying Print Programs Program Edit Goto Utilities Environment System Hilfe ABAP Editor: Request Program Sub-objects RVADOR01 Create Source text Variants .. enter the name of the copied program in customer namespace Z or Y and choose Copy . Enter the name of the program you want to copy and choose Copy .

Test Printing

Delivery note
XXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX

Date
XXXXXXXXXX

Number
XXXXXXXXXXXXXXXXXXXXX

Print preview of the form maintenance screen (without print program)

/E HEADER_DATA ... IF &VBDKL-INC01& NE &SPACE&
Terms of delivery
XXX XXXXXXXXXXXXXXXXXXXX

... /E HEADER_TEXT INCLUDE SD_RVADDN01 OBJEKT ... ... ...

© SAP AG 2001

You always use a print program when printing a form. If you want to preview your document before printing it without actually starting the print program, choose Utilities -> Test print in the form maintenance transaction. The print preview that you get using this function is, however, not an exact representation of what your form will look like when it is output to a printer. Symbols that are filled by a program at runtime are represented by 'x's, for example, and the sequence of text elements with names is not the same during a test print as in a 'real' printing. Also, control commands are displayed in a test print. Starting with 4.6C, graphics are displayed in the preview.

© SAP AG

BC460

1-179

Transporting SAPscript Objects

SAP System

SAP System

Jane Doe 14 Wildman Way Moscow, ID 80801 USA

Transport with Workbench Organizer or Customizing Organizer

Jane Doe 14 Wildman Way Moscow, ID 80801 USA

Object list
PgmID Obj Object name R3TR Form ZRVORDER01 ...
© SAP AG 2001

From Release 3.0A, the SAP transport system is available for transporting forms and styles. The first time an object is saved, a dialog box connected to the Workbench Organizer (WBO) is displayed. Workbench Organizer functionality allows you to transport objects out of development clients and into other clients without hassle. Client 000 is the default target client for such transport. By transferring your forms and styles to this client, you make them available to all clients (see the slide on Requesting Forms). From Release 4.0, texts administered by SAPscript (standard texts, for example) can be transported using the Customizing Organizer. Prior to Release 4.0 please use the Workbench Organizer for such transport. If you want to transport documents of this type, they must first be manually attached to a transport request in the Customizing Organizer. Enter the following after double-clicking on the task number: R3TR TEXT <OBJECT>,<NAME>,<ID>,<L> (OBJECT = text object, NAME = text name, ID = text ID, L = text language) After attaching your document a transport request, all standard transport functions of the Customizing Organizer are available.

© SAP AG

BC460

1-180

Client-Specific Transport

SAP System

SAP System

Source system
Jane Doe 14 Wildman Way Moscow, ID 80801 USA

Target system

Export

Jane Doe 14 Wildman Way Moscow, ID 80801 USA

Import
Client xxx

Client 000 and development client or other arbitrary client

© SAP AG 2001

SAPscript texts, styles and forms are client-specific. During transport request export, make sure that your SAPscript objects are available in the client where the transport request is released. From Release 3.0, export takes place from the source system client where the transport request is released. Prior to Release 3.0 export takes place from source system client 000. From Release 4.0, all transports are made into target system client 000 as well as into an additional client that can be either a development client or another client explicitly specified during the import process (using transport control program TP). In Release 3.0x/3.1x, all transports are made into target system client 000 or into another client explicitly specified during the import process (using transport control program TP).

© SAP AG

BC460

1-181

Modifications: Summary of the Unit

You can now: Understand the concepts behind assigning a form to a print program during Customizing. Handle changes to the SAP Standard. Understand the considerations you have to make when correcting and transporting SAPscript objects.

© SAP AG 2001

© SAP AG

BC460

1-182

The purpose of this exercise is to familiarize you with a real SAP print program and SAP form.Exercises Unit: Modifications • • Example of possible changes that could be made to the SAP standard Illustration of how forms are assigned a print programming in Customizing In most cases. standard forms are altered to reflect the needs of individual customers. 1 Find in Customizing configuration area that assigns forms and print programs for SD Order output documents. In some cases. 1-3 What are the names of the program and of the form for the BA00 Order Confirmation? BC460 1-183 © SAP AG . Choose Tools -> Business Engineer -> Customizing -> Execute project ->SAP Reference IMG Follow the following path within the IMG 5 5 5 5 5 5 Sales and Distribution Basic Functions Output Control Output Determination Output Determination Using the Condition Technique Maintain Output Determination for Sales Documents 1-2 0 Σ Maintain Output Types Then select Output type BA00 and a processing routine. 1-1 See Appendix A. the print program must also be altered to reflect these needs.

2-2 2-3 3 What is the screen field name for the PO number? 3-1 3-2 3-3 On the Display Sales Order screen choose Enter. Find the PO number on the overview screen Position your cursor on the field. This is common. select Execute again. 2-1 Choose Logistics->Sales and Distribution->Sales Order->Display Enter the order number. but not a rule. What is the screen field name? 4 Display the form for the sales confirmation. switch to the Form Painter. the field name is the same. 4-2 © SAP AG BC460 1-184 . Choose F1 and then Technical information. 4-1 Which window on the FIRST page corresponds to the area on the printout that contains the PO number? What is the field name? Note that the table name is different from the screen name in exercise 3. Find the program symbol that is used to display the PO number. To do this. Your instructor will provide a sales order number for you. Print the screen output using Sales document->Issue output to->Screen Select output type BA00 and choose Execute When the Issue Output screen displays. use the same sales order as in 2. Note the PO number. 2-4 What is the PO Number? This is also known as the reference number.2 Display the sales confirmation for an order on your screen. however.

On the Display Sales Order Overview screen choose Goto->Header->Purchase order data What is the field name on the screen? What would the symbol name be in the form? What other things would you have to consider when adding this field to the window? 7-2 7-3 7-4 © SAP AG BC460 1-185 . Develop a strategy for accomplishing this. It should be placed in the same window as the PO number. 7-1 This field can be found on the order.5 Display the print program for the sales confirmation. 6-1 Some of the sales order tables are VBAK (header). 5-1 In the coding start at FORM PROCESSING and observe the following structure of the program: Get the data for the form. To do this. Are they available in the program? Is the transparent table that contains the PO number in 3 available to the program? Can you find the structure table that the form uses to display the PO number? 6-2 6-3 7 The business unit would like the sales confirmation to include the telephone number of the person that placed the order. switch to the ABAP Editor. VBAP (item). and VBKD (business data). Observe the following structure of ITEM_PRINT: Print Item header information Loop record-wise through an internal table (tvbdpa) Create print condition of various items for the form. Review the structure. Endloop 5-2 6 Observe that the transparent tables for the Sales Order are not available to the print program. Open the form. Print header information Print item information Print ending information Close the form.

The sales document tables are NOT available in the program. © SAP AG BC460 1-186 . The window of page FIRST that contains the PO number is INFO (see print preview). standard forms are altered to reflect the needs of individual customers. The field name in window INFO is VBDKA-BSTKD. The names of the program and the form for the order confirmation are: Program: Form: RVADOR01 RVORDER01. If there is not enough space. Make sure that there is enough space in the window to insert an additional line.Solutions Unit: Modifications • • Example of possible changes that could be made to the SAP standard Illustration of how forms are assigned a print programming in Customizing In most cases. The transparent table VBKD is NOT available in the program. The field name on the screen for the phone number of the ordering customer is VBAK-TELF1. The PO number depends on the sales order. The screen field name for the order number is VBKD-BSTKD. the print program must also be altered to reflect these needs. Table VBDKA is available in the program. In the form. In some cases. If you want to insert only one line. you must enlarge the window. the symbol is called VBDKA-TELF1. there is no need to adapt the sizes of other windows.

Font Maintenance Contents: System fonts and printer fonts System barcodes and printer barcodes © SAP AG 2001 © SAP AG BC460 1-187 .

Font Maintenance: Objectives At the end of this unit you can: Explain differences between system fonts and printer fonts Maintain system fonts and printer fonts © SAP AG 2001 © SAP AG BC460 1-188 .

There is also a flag to show whether the fonts are proportional or equidistant. screens. They are independent of available output devices. Printer fonts are the fonts available to SAPscript on existing device types (printers. choose Tools -> Word Processing -> Administration -> Font. telex machines and so on). To access this transaction. © SAP AG BC460 1-189 . The usable font names for system and printer fonts are entered in font families.Font Maintenance: Overview R/3 SAPscript Font Maintenance Font families Text entry in fonts used by SAPscript System fonts Printer fonts/AFM metrics System barcodes Printer barcodes © SAP AG 2001 All fonts and barcodes used in SAPscript are administered in the SAPscript font maintenance transaction. System fonts represent the font selections that can be used for styles and forms.

To enable this conversion. or to convert a number of different system fonts for a single printer device. © SAP AG BC460 1-190 . Conversions between system fonts and printer fonts are displayed in font maintenance. The control sequences are mostly defined using print controls. You can. output text format) into control sequences that can be interpreted by printers. The printer is controlled by various printer drivers who convert the internal SAPscript output format (OTF. choose to convert a given system font for a number of different printer devices. You assign drivers to devices types in the spool administration transaction. for example.System Fonts and Printer Fonts R/3 Maintain system fonts Fonts for text layout Maintain printer fonts Combination of system fonts and device type Driver Conversion of system fonts to printer specific fonts © SAP AG 2001 SAPscript provides for automatic conversion between system fonts appearing in a given document and printer fonts installed on a particular printer. you need to maintain replacement fonts for each font family.

called the bar code suffix. To access this transaction.System and Printer Bar Codes R/3 Maintain system barcodes Display using the character string attribute barcode Maintain printer barcodes Opens connection to print controls Driver Converts system barcodes to printer specific control sequences © SAP AG 2001 The character string attribute Barcode allows you to output barcodes using SAPscript. © SAP AG BC460 1-191 . Finally. You maintain the various bar code types independently of any device as system bar codes. an 8-digit number). choose Tools -> CCMS . a print control called the bar code prefix is first sent to the printer. the printer bar code establishes a connection with the device-specific control sequence known as a print control. When a bar code is printed. For printer types which support bar code printing. You maintain print controls using the spool administration transaction. is sent. Spool -> Spool administration. This is followed by the bar code data (for example. another print control.

© SAP AG BC460 1-192 . only the symbolic name of the print control is entered for printer fonts and printer bar codes. Print controls are responsible for controlling printer fonts and printer bar codes. In the font maintenance transaction.Print Controls R/3 HPLJ4 Courier Font maintenance Printer fonts 120 X _ 10 CPI SF003 SF003 Printer bar codes HPLJ4 EAN8 SBP01 SBS01 Spool Management HPLJ4 HPJL4 SBP01 SBS01 xxxxxxxx yyyyyyyy Printer command for setting Bar codes on / off Printer command for font conversion HPLJ4 © SAP AG 2001 SF003 zzzzzzzz A print control is a control sequence for an output device that is addressed using a symbolic name. You use the spool administration transaction to maintain print controls for individual device types.

Maintain system and printer fonts.Font Maintenance: Summary of the Unit You can now: Understand the differences between system fonts and printer fonts. © SAP AG 2001 © SAP AG BC460 1-193 .

This information is not part of the standard training course. parts or all of it may not be used during the course. Therefore. © SAP AG 2001 © SAP AG BC460 1-194 .Appendix This unit contains additional information you can reference.

Appendix A: SAPscript Programming Interface Contents: SAPscript programming interface functions Initializing and changing text Searching for text Updating text Saving text directly © SAP AG 2001 © SAP AG BC460 1-195 .

save. change. Describe how application transactions work that use SAPscript texts.Appendix A: Objectives At the end of this unit you can: Name the functions and purposes of the most important SAPscript function modules (read. © SAP AG 2001 © SAP AG BC460 1-196 . Understand how to save SAPscript texts using the update procedure. delete) in document administration.

and administer SAPscript text. Typical functions include: .reading. Deletes Changes Database SAPscript text © SAP AG 2001 The programming interface consists of a range of function modules used to create. change.initializing and changing text using the Editor .generic searching for text . Saves.updating text in the database © SAP AG BC460 1-197 . and deleting text .Programming Interface Functions Text header Text lines Communication using function modules STXL Initializes Searches Reads. saving.

use EDIT_TEXT. When you create a new text. © SAP AG BC460 1-198 . The line table contains the text lines. The text header contains all administration data belonging to a document. use the parameter SAVE = SPACE. To call the long text Editor. You can control numerous functions. © SAP AG 2001 You should prepare a text header and line table for every document to be edited by an applications program. To transfer the text to be edited to the function module EDIT_TEXT. using input parameters. which allows you to enter data into a new or existing text. The command CLEAR HEADER is not sufficient. EDIT_TEXT: calls the Editor. the function module SAVE_TEXT is automatically called. To suppress this function. When you choose Text → Save while using EDIT_TEXT. initialize the work areas using INIT_TEXT. use HEADER and LINES.Initializing and Changing Texts Work areas for SAPscript text in the print program: HEADER: Text header (field string with Dictionary structure THEAD) LINES: line table (internal table with Dictionary structure TLINE) INIT_TEXT: initializes work areas in the program required to create a new text. such as the display or change mode. The LINES are deleted. The HEADER and LINES serve as transfer parameters. The HEADER is filled with administration data.

Text ID .Text name . The text key contains four components: OBJECT ID NAME LANGUAGE . © SAP AG BC460 1-199 .Text language You can select text generically with SELECT_TEXT by using an asterisk “*”. SAPscript texts are client-specific. Displays a text catalog Entry: Output: Text key (generic entries are permitted) Table with header information on all texts found © SAP AG 2001 The function module SELECT_TEXT generates a table with the text headers of all text modules corresponding to the search key.Text object .Searching for Text SELECT_TEXT: Selects text on the basis of the search criteria given by the user.

that is. The R/3 Update concept is explained fully in the R/3 Documentation. of all documents allocated to a particular text object. all function modules work with the text memory. To store changes to a text in the database: .The Text Update Process READ_TEXT Database Tables RE AD _T EX SA T VE _T EX T COMMIT WORK T1 T2 T3 T4 T5 T4 Insert Delete Update Delete T1 DELETE_TEXT COMMIT_TEXT Table of updated orders Text Memory © SAP AG 2001 Most SAPscript documents in the application programs are saved via the update procedure. The backup mode (V=update. all text changes are lost and the update is terminated.Use COMMIT_TEXT . The text memory contains all of the text changes made in the applications program. © SAP AG BC460 1-200 . The developer defines this mode in a separate transaction (Tools -> SAPscript ->Administration -> Settings). D=direct without update) is an attribute of an entire document class. When you save a text via the update procedure.Use the ABAP/4 command COMMIT WORK If you fail to follow the two steps above.

and Deleting Text READ_TEXT: Reads a single text from the text memory or database in the work area Entry: Text key Output: HEADER and LINES SAVE_TEXT: Stores a single text from the work area in the text memory or database Entry: HEADER and LINES DELETE_TEXT: Deletes one or more texts in the text memory or database Entry: Text key (can be generic) © SAP AG 2001 The function module READ_TEXT reads a text from the text memory or database into the internal work areas HEADER and LINES.I = New text .ID .Object . Generic entries for the text key are permitted.U = Changed text .D = Deleted text To delete text from the text memory or database. use SAVE_TEXT. use DELETE_TEXT. Texts are either deleted immediately or recorded in the text memory. © SAP AG BC460 1-201 . To define the text key you must specify: . To store a text module in the text memory or database.Name .Reading. Saving.Language Generic entries are not permitted. The parameter FUNCTION returns one of the following: . which are parts of the print program. depending on the text object.

If you fail to execute either COMMIT_TEXT or COMMIT WORK. © SAP AG BC460 1-202 .Updating Texts COMMIT_TEXT: Updates text from the text memory in the update file Text memory is empty after successful call COMMIT WORK: Call from within an application program (ABAP command) Necessary for storing texts in the database © SAP AG 2001 When the R/3 System saves texts (or data in general) via update. You can call COMMIT_TEXT and COMMIT WORK only once per logical unit of work (LUW). and you must do so at the end of the procedure. To store text changes for the text update procedure: . the text memory is empty.Use COMMIT_TEXT . all text changes are lost. After COMMIT_TEXT has been executed. namely the update task.Use the ABAP/4 command COMMIT WORK COMMIT_TEXT does not replace the ABAP/4 command COMMIT WORK. this takes place asynchronously in a separate process.

To make use of this temporary mode under SAVE_TEXT or DELETE_TEXT. of all texts allocated to a particular text object. use the parameter SAVEMODE_DIRECT. This applies to all texts whose text object has the backup mode D. When you define SAVEMODE_DIRECT = ’X’. © SAP AG BC460 1-203 . or company reorganization). the function modules SAVE_TEXT and DELETE_TEXT proceed as shown above.Saving Text Directly TTXID TTXOB INIT_TEXT REA D_TE XT XT EDIT_TEXT SAV E_TE DELETE_TEXT Database Tables © SAP AG 2001 SAPscript Editor As an alternative to the update file. NOTE: Do not mix “normal” updates with SAVEMODE_DIRECT under any circumstances. that is. you can save texts directly in the database. for a single call of the corresponding function module. you can specify the backup mode temporarily as D. D=direct without update) is an attribute of an entire text class. For mass processing of texts (such as transport. The developer defines this mode in a separate transaction (Tools -> SAPscript -> Administration -> Settings). client copies. SAVEMODE_DIRECT works only once. The backup mode (V=update.

Describe how application transactions work that use SAPscript texts. delete) for text administration. Understand how to save SAPscript texts using the update procedure.Appendix A: Summary of the Unit You can now: Name the functions and purposes of the most important SAPscript function modules (read. © SAP AG 2001 © SAP AG BC460 1-204 . save. change.

Appendix B: Customizing R/3 Forms Contents: Customizing Form Overview Invoice form (SD) Order form (MM) Account statement (FI) © SAP AG 2001 © SAP AG BC460 1-205 .

From this menu. The Enterprise Implementation Guide (IMG) is a subset of the SAP Reference IMG (from which it is generated). Logistics General or Sales and Distribution). then SAP Reference IMG. © SAP AG BC460 1-206 .Navigating to Form Customizing Implementation Guide Edit Goto Additional information Utilities System Help Display Implementation Guide Implementation Guide for R/3 Customizing Global Settings Enterprise Structure Cross-Application Components Financial Accounting Treasury Controlling Investment Management Sales and Distribution Materials Management Logistics . choose Tools → Business Engineer → Customizing.General © SAP AG 2001 To access the R/3 Customizing Implementation Guide. you can branch to the appropriate application (such as Financial Accounting.

... © SAP AG 2001 To assign print programs to forms within SD... © SAP AG BC460 1-207 . choose Sales and Distribution → Basic Functions → Output Control → Output Determination → Output Determination Using the Condition Technique → Maintain Output Determination for Sales Documents → Maintain Output Types. Maintain Output Determination for Sales Documents Maintain Condition Tables Maintain Output Types .Invoice Form SD (1) Implementation Guide Edit Goto Additional information Utilities System Help Display Implementation Guide Sales and Distribution Basic Funktions Output Control Output Determination Output Determination Using the Condition Technique Maintain Output Determination for ..

© SAP AG BC460 1-208 .Invoice Form SD (2) Table view Edit Goto Additional information Utilities System Help Display view 揙 utput types": Overview Output types V1 Outtut types Output program Out Name BA00 Order confirmation © SAP AG 2001 Select an output type and double-click on Output programs.

you should enter your own object (or a modified object) at this point. The message type indicates the type of form to be used. The medium indicates how the message is to be sent. the assignment of print program and form is determined.Invoice Form SD (3) Table view Edit Goto Additional information Utilities System Help Display view 揙 utput programs? Overview Output types Output type Application BA00 V1 Output program Output programs Med 1 2 6 Name Print output Telefax .. © SAP AG BC460 1-209 . Column 3 contains the entries for the standard print programs. Prog RVADOR01 RVADOR01 Form ENTRY ENTRY Form RVORDER01 RVORDER01 © SAP AG 2001 Here..according to the message type. If you want to change the print program or the form.

© SAP AG BC460 1-210 .Order Form MM (1) Implementation Guide Edit Goto Additional information Utilities System Help Display Implementation Guide Messages Texts for Messages Forms (Layout Sets) for Messages Adjust Form for Purchasing Documents Assign Form and Output Program for RFQ Assign Form and Output Program for Purchase Order © SAP AG 2001 To assign print programs to forms within Materials Management (MM).Messages → Forms for Messages → Assign Form and Output Program for Purchase Order. select Materials Management → Purchasing →.

dunn.. AUFB MAHN NEU Name Sales conf.. © SAP AG BC460 1-211 . enter your own object on this screen. Med Prog SAPFM06P SAPFM06P SAPFM06P Form Form ENTRY_AUFB MEDRUCK ENTRY_MAHN MEDRUCK ENTRY_NEU MEDRUCK Dunning Sales order Text © SAP AG 2001 Text Depending on the output type. If you want to change the print program or the form.Order Form MM (2) Implementation Guide Edit Goto Additional information Utilities System Help Change view 揙 utput: Output programs? Overview Text Out. The overview contains the entries of the standard programs. you use this view to assign a print program to a form.

an account statement).Account Statement FI (1) Implementation Guide Edit Goto Additional information Utilities System Help Display Implementation Guide Financial Accounting Financial Accounting Global Settings Correspondence Define Correspondence types . choose Financial Accounting → Financial Accounting Global Settings → Correspondence → Define Form Names for Correspondence Print.. © SAP AG BC460 1-212 . Define Form Names for Correspondence Print © SAP AG 2001 To assign print programs to correspondence within FI modules (for example..

© SAP AG BC460 1-213 .Account Statement FI (2) Implementation Guide Edit Goto Additional information Utilities System Help Change view Forms for correspondence? Overview Prog Prog FoID Form F140_PAY_CON_050 F140_PAY_CON_051 F140_PAY_CON_052 F140_ACC_STAT_03 RFKORD00 Print program: Payment confirmation 50 RFKORD00 Print program: Payment confirmation 51 RFKORD00 Print program: Payment confirmation 52 RFKORD10 Print program: Account statement Position VB © SAP AG 2001 Use this screen to assign print programs to forms The entries of the standard programs are recorded.

© SAP AG BC460 1-214 . choose Financial Accounting → Accounts Receivable and Accounts Payable → Business Transactions → Outgoing Payments → Automatic Outgoing Payments → Payment Method/Bank Selection for Payment Transaction → Set Up Payment Program.Outgoing Payments FI (1) Implementation Guide Edit Goto Additional information Utilities System Help Display Implementation Guide Accounts Receivable and Accounts Payable Business Transactions Outgoing Payments Automatic Outgoing Payments Payment Method/Bank Selection for Payment Transaction Set Up Payment Program © SAP AG 2001 To change the entry of the print program and the form to outgoing payments within FI.

: Countries Company codes Country AR AT AU BE BR Name Argentina Austria Australia Belgium Brasil © SAP AG 2001 From here on out.Outgoing Payments FI (2) SAP R/3 CtryPaymentMeth. a different menu path must be chosen to change print programs and forms: To change the print program. choose Ctry payment methods. Maintain Payment Program Config. © SAP AG BC460 1-215 . Double-click to select the desired country. The subsequent dialog window displays the available countries.

List Country Method 1 DE Germany Name (in national language) TRLO: individual payment A C Bank direct debit check (with checkmanagement) E Automatic debit © SAP AG 2001 Double-click to select the payment method from those displayed. In our example above.Outgoing Payments FI (3) Maintain Payment Program Config. payment method C (check) has been selected.: Country Pmnt Methods . © SAP AG BC460 1-216 .

: Country Payment Methods ...Outgoing Payments FI (4) Payment method Edit Goto Utilities System Help Maintain Payment Program Config. ... ... type for payment ..... box ...Details Country key Payment method DE C Germany Check Payment method classification Check will be created .. .... Bill/exchange ... LIST1S 01 Enter changes to your print program here.. Allowed for personnel payments Required master record specifications Check/bill of exchange . Doc.O.. © SAP AG BC460 1-217 ... . ... Update specifications Street. P. . Form printout Name of print program Name of print dataset © SAP AG 2001 RFFOUS_C Key in code line .

choose Paying company codes. the payment method is Check. In the example above. © SAP AG BC460 1-218 .: Company Codes Countries Country 0001 AR01 AT01 AU01 Company name SAP AG Template AR Template AT Template AU City Walldorf Argentina Austria Australia © SAP AG 2001 To change your form. Choose the appropriate entries.Outgoing Payments FI (5) SAP R/3 Paying CCs Maintain Payment Program Config. The dialog window displays the company codes. The same payment method is displayed as in the print programs. Double-click to select a company code.

: CC Pmnt Methods-General Data Form data Maintain Payment Program Config.: CC Pmnt Methods-Form data Paying co.code Payment method Forms DE01 C Country Template Check (with checkmanagement) F110_PRENUM_CHCK Form for payment transfer Next form Correspondence sort variant Paid items printout Display form Line items per form Pmnt adv.Outgoing Payments FI (6) Maintain Payment Program Config. © SAP AG BC460 1-219 . choose Form data. if form is full Extra form if form is full Line items sort variant © SAP AG 2001 99 To go to the entry for the payment medium.

and FI © SAP AG 2001 © SAP AG BC460 1-220 .Appendix B: Unit Summary You are now able to: Navigate in Customizing to assign forms to print programs for SD. MM.

Appendix C: Inserting Graphical Elements Contents : Inserting a company logo using program RSTXLDMC Inserting bitmaps © SAP AG 2001 © SAP AG BC460 1-221 .

Choose Edit -> Graphic -> Create graphic. As of Release 4. . You can upload BMP files directly from the graphic administration into a standard text. define a new window into which you insert the graphic as text module (after uploading it into a standard text).5 you can include graphic administration into the page layout of the form maintenance. note the following: . Choose Import to import your graphic into R/3.Requirements Access TIFF graphic file on frontend Upload PC file as text module using ABAP report RSTXLDMC Define new window in form Incorporate existing text element in a new window © SAP AG 2001 To insert a graphical element into a form using program RSTXLDMC (before Release 4.0 format (Tag Image File format). use the ABAP report RSTXLDMC.5).The graphic to be inserted must be available on the front-end in TIFF 6. Your graphic must be a BMP file. © SAP AG BC460 1-222 . In the form maintenance initial screen choose Environment -> Administration -> Graphic. To upload the TIFF file into a standard text.In the form.

see the documentation on the report RSTXLDMC. . If you make no specifications. . so the resulting name is ZHEX-MACROBMON. BCOL=color) Resolution for graphic (dpi) Graphic resident in printer Parameters for standard text /tmp/file.You can specify the exact positioning of the graphic when uploading... 132 Parameters for positioning the TIFF graphic . .The system generates a suggested name for the text: ZHEX-MACRO-*. © SAP AG 2001 Procedure..tif BMON Text name Text language Text ID Text title Line width for text Absolute positioning Absolute x position Absolute y position ZHEX-MACRO-* ST .To check the resulting change to the form.Use RSTXLDMC to save the TIFF file on your frontend as text module. © SAP AG BC460 1-223 . Use the ID "ST" and the logon language. . The asterisk denotes the file type. In our example the file is BMON.. the system prints the graphic in the current page window. choose Utilities → Test print.For more information on input parameters.RSTXLDMC: Creating Graphical Elements Program Edit Goto System Help Uploading TIFF Graphics into SAPscript Texts File name and parameter for TIFF conversion File name Type (BMON=b/w. . Print the spool request created with the test print on a printer that is capable of printing graphics.

All graphics imported are managed in the SAPscript graphics administration transaction. Import the graphic and position the graphic window at the desired position in the form. © SAP AG BC460 1-224 . recreate the graphic in the form and specify a lower resolution.Page Layout: Graphic Page . To start graphics administration. graphics are displayed in the print preview. choose Tools -> Form printout -> Administration -> Graphic. Enter the file path and the name the graphic should have in the R/3 System. You do not have to reimport the graphic into R/3. Starting with Release 4. Using the SAPscript control command BITMAP you can also insert graphics dynamically. See the OSS note no...00 Design / Text Options Import graphic © SAP AG 2001 Starting with Release 4. Graph.00 CM CM Left margin Upper margin Window width Window height 0. Include graphic Stored on.. 307414. Name Name Description Logo1 ID BMAP Object Graphics Black and white grid screen Color grid screen Technical attributes DPI Resolution 0. If you want to resize the graphic in the form.6C. you choose the Create pushbutton on the Graphic tab and then the Import pushbutton on the dialog box that is displayed next.6 you can import graphics and include them in your form using the Graphic tab in the Form Painter.. To do this.

© SAP AG 2001 © SAP AG BC460 1-225 .Appendix C: Summary of the Unit You can now: Insert graphical elements using program RSTXLDMC.