Upload
hadieu
View
248
Download
7
Embed Size (px)
Citation preview
Printing Forms with Interactive Forms Based on Adobe Software
Jeff GeboSAP Labs LLCAugust 16, 2006
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 2
Prerequisites for the Workshop
Required:
• BC400 (ABAP Workbench: Basics)
• ABAP Programming background
Recommended:
• Knowledge of SAPscript and/or Smart Forms
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 3
Course Content: Overview
1. Overview2. Program3. Interface4. Context5. Designer: Overview6. Structuring a Form7. Static Elements8. Dynamic Elements9. Tables10. Mass Printing Optimizations
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 4
User's Perspective: Printing with PDF-Based Forms
21 Program Document
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 5
The Tools Involved (Design Time)
FUNCTION /1BCDWB/SM00000001.DATA: %OUTPAR TYPE SFPOUTPAR, %DOCPAR TYPE SFPDOCPAR,...
Form Template
Context Layout
Interface
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 6
What Happens at Run Time
Form description
Applicationprogram
Database
Data retrieval
PDF-basedform template
activate
ABAP function module
(generated)
Printout= Form= Document
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 7
Architecture
Web Services
Application Code (Java)
SOAP
SOAP
SAP Web Application ServerJ2EE Stack ABAP Stack
Post ProcessingFramework
Web ServicesWeb Services
Adobe Document ServicesCore Components
PDF Object (ABAP)
Document Service(EJB)
PDF Object (Java)
SAFPAPI
Application Code (ABAP)
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 8
Course Content: Program
1. Overview2. Program3. Interface4. Context5. Designer: Overview6. Structuring a Form7. Static Elements8. Dynamic Elements9. Tables10. Mass Printing Optimizations
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 9
Sections of the Application Program
* (1) Data retrieval and processingSELECT ... FROM ......
* (2) Find out name of generated function module
CALL FUNCTION 'FP_FUNCTION_MODULE_NAME'...
* (3) Start form processing
CALL FUNCTION 'FP_JOB_OPEN'...
LOOP AT ...* (4) Call function module dynamically
CALL FUNCTION <generated function module> ...ENDLOOP.
* (5) End form processingCALL FUNCTION 'FP_JOB_CLOSE'...
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 10
FP_FUNCTION_MODULE_NAME
DATA:form TYPE fpwbformname,fm_name TYPE rs38l_fnam,interface_type TYPE fpinterfacetype.
* (2) Find out name of generated function moduleCALL FUNCTION 'FP_FUNCTION_MODULE_NAME'
EXPORTING i_name = formIMPORTING
e_funcname = fm_namee_interface_type = interface_type.
SELECTNAME?OPENCALLCLOSE
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 11
Starting and Ending Form Processing
DATA:fp_outputparams TYPE sfpoutputparams.
...
* (3) Start form processingCALL FUNCTION 'FP_JOB_OPEN'...* set output parameters like printer, preview...
CHANGING ie_outputparams = fp_outputparams ...
...
* (5) End form processingCALL FUNCTION 'FP_JOB_CLOSE'...
SELECTNAME?OPENCALLCLOSE
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 12
Calling the Generated Function ModuleDATA:
fp_docparams TYPE sfpdocparams,fm_name TYPE rs38l_fnam,fp_result TYPE TYPE fpformoutput, ...
LOOP AT ...fp_docparams-langu = customer_language.
* (4) Call function module dynamicallyCALL FUNCTION fm_name
EXPORTING/1bcdwb/docparams = fp_docparamsbookings = it_bookings
IMPORTING/1bcdwb/formoutput = fp_result
EXCEPTIONSOTHERS = 1.
ENDLOOP.
SELECTNAME?OPENCALLCLOSE
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 13
Course Content: Interface
1. Overview2. Program3. Interface4. Context5. Designer: Overview6. Structuring a Form7. Static Elements8. Dynamic Elements9. Tables10. Mass Printing Optimizations
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 14
Interface: Properties
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 15
Form Interface
• ABAP types• Dictionary types
Double click →Dictionary
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 16
Course Content: Context
1. Overview2. Program3. Interface4. Context5. Designer: Overview6. Structuring a Form7. Static Elements8. Dynamic Elements9. Tables10. Mass Printing Optimizations
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 17
Form Properties
Click Properties
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 18
Context: Overview
Interface Context
Properties of interface field
Properties/details/conditions of context element
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 19
Using the Interface
1
2
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 20
Long Texts
Form 3Deutsche Bank Hamburg,
(BLZ 699 700 99) 099 55555SWIFT DEUT DESM 699
Vorstand: Chr. Sparwasser · Sharon BishopChantal Willemin · Hassan Chaatouf
Registergericht Heidelberg HRB 999-WWW
Please settle the invoice within two weeks.
Form 2
Form 1
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 21
Creating Text Modules
SAP Smart Forms Initial Screen
FormStyleText Module ADDR_FOOTER
4 Truckee Way, New York, NY 12345-678P.O. Box 16 05 29, New York NY 34573-134
Telephone (212) 990 Fax (212) 99 12 77
Text Management
* Left-justified BO Bold
• Package• Translation attributes• Style
CreateChangeDisplay
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 22
Including Text Modules
determined at runtime
determined at design time
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 23
Course Content: Designer Overview
1. Overview2. Program3. Interface4. Context5. Designer: Overview6. Structuring a Form7. Static Elements8. Dynamic Elements9. Tables10. Mass Printing Optimizations
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 24
Designer: Technical Prerequisites
• SAP GUI for Windows
• 6.40 GUI: make sure that Designer is installed and check on your hard drive. Default location:C:\Program Files\Adobe\Designer 7.1.
• Make sure latest 6.40 GUI patches are installed (LiveCycle Designer 7.1 requirement).
• Adobe Reader 7.0 (used to be Acrobat Reader), incl. update to 7.0.8
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 25
Caution: Loss of Changes
Changes are lost when the layout is in display mode.The following note is displayed once in the status line:“Changes to the layout cannot be saved in display mode!”
You can make changes − but these changes are lost when you leave the layout area.
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 26
Designer: Overview
Script Editor
PaletteWindow
Palettes
PaletteWindow
close/resize left side
Layout Editor
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 27
Course Content: Structuring a Form
1. Overview2. Program3. Interface4. Context5. Designer: Overview6. Structuring a Form7. Static Elements8. Dynamic Elements9. Tables10. Mass Printing Optimizations
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 28
Objects on a Master Page
Own address
Customer address
boilerplate objects
Dear Mr Smart,
content area
Thanks for your business.
topmost subform = body page
repeatable subform as headerLH400 11:00 AM 800 USD
Flight Time Price
repeatable subform
(static) text
boilerplate objectBank information
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 29
Inserting Several Master Pages
MP2 MP3MP1
Restrict pageoccurrence: max count = 1
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 30
Suggested Approach to Designing Forms
Create the master page first.• Look for data that belongs to the background of the page• Set your content area
Divide the form information / data into• Header (master page)
• Form content (body page)• Leaders / detail lines / trailers
• Footer (master page)
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 31
What Are Subforms?
• Can be laid down only in the content area of a master page.
• If of type Position Content, objects of subforms can be laid down at their exact position at runtime. (Hierarchy position of objects not relevant for layout position)
• If of type Flow Content, the objects will follow each other, depending on which space they require at runtime.
• Contents of subform can be protected against page break.
• Two consecutive subforms can be protected against page break.
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 32
What Are Body Pages, and When to Include Them?
Alternative: Top of Next Page
When should you insert a new body page?
• when you want to make clear that a new page starts here (make sure to say so!)
• when you want to make sure you want to lay down a subform on a particular master page
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 33
When to Include Subforms
Placing objects in a subform makes sense:
• if you want to output the element repeatedly (type Flow Content)
• if you want to visually group objects
• if you want to keep objects together (protect them against page break)
• if you want to hide several elements at once (scripting required)
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 34
Course Content: Static Elements
1. Overview2. Program3. Interface4. Context5. Designer: Overview6. Structuring a Form7. Static Elements8. Dynamic Elements9. Tables10. Mass Printing Optimizations
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 35
Inserting Static Images
1. Select page
2. Drag and drop static image
3. Browse image
4. Embed image in XML source
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 36
Course Content: Dynamic Elements
1. Overview2. Program3. Interface4. Context5. Designer: Overview6. Structuring a Form7. Static Elements8. Dynamic Elements9. Tables
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 37
Static Texts w/ Floating Fields
1 23
45
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 38
Course Content: Tables
1. Overview2. Program3. Interface4. Context5. Designer: Overview6. Structuring a Form7. Static Elements8. Dynamic Elements9. Tables10. Mass Printing Optimizations
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 39
Body Page Setup for Tables
The Body Page main subform Content property must be set to Flowed.
If this is not done, you will not have multiple pages print out!
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 40
Creating the Booking Table with Fields
1 2
3
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 41
Table Header Row
Tables can include header rows that hold the column headers.
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 42
Table Body Rows
Table body rows are bound to the data in the table.
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 43
Course Content: Tables
1. Overview2. Program3. Interface4. Context5. Designer: Overview6. Structuring a Form7. Static Elements8. Dynamic Elements9. Tables10. Mass Printing Optimizations
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 44
Available Performance Improvement: Bundling
Communication and initialization overhead is reduced by bundlingof several requests (only print scenarios).
Available starting in NW04s SP6, and only on SAP Web AS ABAP + J2EE system (J2EE Addin).
Forms Processing collects several output requests and calls ADS for a bundle of 50 documents
Only forms that are called within one FP_JOB_OPEN -FP_JOB_CLOSE section can be bundled (do not close the job after each form). Forms Processing can only bundle documents that are part of one OPEN/CLOSE section.
Bundling is disabled by default and needs to be enabled as followsActivation of bundling via general setting in database table FPCONNECT as described in the online documentationApplication program can override the database setting (bundling should be disabled for huge documents)
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 45
Form Bundling
Bundling transfers large amounts of dataMemory issues during SOAP communicationInefficient stream encoding
For print scenarios application data and ADS output is exchangedvia a common file system
Files are only written onceNo additional encodingAlmost no size limitation
This common file system (DIR_GLOBAL) exists in double-stack installations
Same system ID (<SID>, e. g. B20)ABAP and Java stack share the DIR_GLOBAL
Manual configuration requiredNo detection mechanism provided by SAP installation tool
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 46
Activation of Bundling (1)
System-wide activation of bundlingManual maintenance of table FPCONNECTIf simple and complex bundling are enabled complex bundling is used
Field Required Setting
DESTINATION Connection to ADS
DIR_GLOBAL X is a prerequisite for bundling
BATCHING X to activate simple bundling(1)
MBATCHING X to activate complex bundling(2)
CACHING Not relevant for bundling.
(1) Simple Bundling: All forms of a bundle have the same name and language(2) Complex Bundling: Forms of a bundle can differ in name and language
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 47
Activation of Bundling (2)
An application program can override the system settingsDeactivate bundling for very large documents (BUMODE = ‘-‘, see next slide)Activate bundling only for selected mass printouts (if default is ‘off‘)
BUMODE = ‘M‘ shall be used if different forms or forms in different locales (language+country) are usedBUMODE = ‘X‘ shall be used if all forms are identical (including locale)Difference between ‘M‘ and ‘X‘ is currently very small, so ‘M‘ should be used (it is more flexible)
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 48
When to bundle
According to Adobe‘s analysis the optimum bundle size is 200 pages
Forms processing run-time uses a bundle size of 50 forms
Recommendation for ERPOptimal average form size is 4 pagesPerformance decreases for larger documentsNevertheless bundling is recommended for forms with up to 10 pagesSome forms may have a lower optimal document size – this depends on used complex layout features (graphics, embedded fonts, shading etc.)If in doubt a performance analysis is required for critical scenariosBundling must be deactivated for scenarios where the print program must get the information back how many pages have been created for each form
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 49
Want to Learn More?
Want to Learn More about Adobe Print Form in ABAP?
Take SAP Class:
BC480
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 50
Copyright 2004 SAP AG. All Rights ReservedNo 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.Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, and Informix are trademarks or registered trademarks of IBM Corporation in the United States and/or other countries.Oracle is a registered trademark of Oracle Corporation.UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.HTML, XML, XHTML and W3C 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. MaxDB is a trademark of MySQL AB, Sweden.SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.
© SAP AG 2006, Printing Forms with Interactive Forms Based on Adobe Software / Jeff Gebo / 51
Copyright 2004 SAP AG. Alle Rechte vorbehaltenWeitergabe und Vervielfältigung dieser Publikation oder von Teilen daraus sind, zu welchem Zweck und in welcher Form auch immer, ohne die ausdrückliche schriftliche Genehmigung durch SAP AG nicht gestattet. In dieser Publikation enthaltene Informationen können ohne vorherige Ankündigung geändert werden.Die von SAP AG oder deren Vertriebsfirmen angebotenen Softwareprodukte können Softwarekomponenten auch anderer Softwarehersteller enthalten.Microsoft, Windows, Outlook, und PowerPoint sind eingetragene Marken der Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iSeries, pSeries, xSeries, zSeries, z/OS, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, und Informix sind Marken oder eingetragene Marken der IBM Corporation in den USA und/oder anderen Ländern.Oracle ist eine eingetragene Marke der Oracle Corporation.UNIX, X/Open, OSF/1, und Motif sind eingetragene Marken der Open Group.Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, und MultiWin sind Marken oder eingetragene Marken von Citrix Systems, Inc.HTML, XML, XHTML und W3C sind Marken oder eingetragene Marken des W3C®, World Wide Web Consortium, Massachusetts Institute of Technology. Java ist eine eingetragene Marke von Sun Microsystems, Inc.JavaScript ist eine eingetragene Marke der Sun Microsystems, Inc., verwendet unter der Lizenz der von Netscape entwickelten und implementierten Technologie. MaxDB ist eine Marke von MySQL AB, Schweden.SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver und weitere im Text erwähnte SAP-Produkte und -Dienstleistungen sowie die entsprechenden Logos sind Marken oder eingetragene Marken der SAP AG in Deutschland und anderen Ländern weltweit. Alle anderen Namen von Produkten und Dienstleistungen sind Marken der jeweiligen Firmen. Die Angaben im Text sind unverbindlich und dienen lediglich zu Informationszwecken. Produkte können länderspezifische Unterschiede aufweisen.In dieser Publikation enthaltene Informationen können ohne vorherige Ankündigung geändert werden. Die vorliegenden Angaben werden von SAP AG und ihren Konzernunternehmen („SAP-Konzern“) bereitgestellt und dienen ausschließlich Informationszwecken. Der SAP-Konzern übernimmt keinerlei Haftung oder Garantie für Fehler oder Unvollständigkeiten in dieser Publikation. Der SAP-Konzern steht lediglich für Produkte und Dienstleistungen nach der Maßgabe ein, die in der Vereinbarung über die jeweiligen Produkte und Dienstleistungen ausdrücklich geregelt ist. Aus den in dieser Publikation enthaltenen Informationen ergibt sich keine weiterführende Haftung.