How to receive and convert PDF-documents with SAP XI

Similar documents
Install TREX for CAF Version 1.00 March 2006

Do Exception Broadcasting

configure an anonymous access to KM

link SAP BPC Excel from an enterprise portal Version th of March 2009

How to Upgr a d e We b Dynpro Them e s from SP S 9 to SP S 1 0

How To Develop a Simple Web Service Application Using SAP NetWeaver Developer Studio & SAP XI 3.0

How To Extend User Details

How To Configure IDoc Adapters

Visual Composer - Task Management Application

A Step-By-Step Guide on File to File Scenario Using Xslt Mapping

How To Set up NWDI for Creating Handheld Applications in SAP NetWeaver Mobile 7.1

MDM Syndicator Create Flat Syndication File

SAP NetWeaver How-To Guide

How To Configure the Websocket Integration with SAP PCo in SAP MII Self Service Composition Environment Tool

How to Use Function Keys in Mobile Applications for Handhelds

Integrate a Forum into a Collaboration Room

How to Set Up and Use the SAP OEE Custom UI Feature

Configure TREX 6.1 for Efficient Indexing. Document Version 1.00 January Applicable Releases: SAP NetWeaver 04

Create Partitions in SSAS of BPC Version 1.00 Feb 2009

SAP GRC Access Control: Configuring compliant user provisioning (formerly Virsa Access Enforcer) into CUA Systems

How To... Reuse Business Objects and Override Operations of a Business Object

Consuming Web Dynpro components in Visual Composer.

How To Troubleshoot SSL with BPC Version 1.01 May 2009

How To... Promote Reports and Input Schedules Through Your System Landscape

Transport in GP. How-to Guide Beginning with SAP NetWeaver 2004s SPS06. Version 2.00 January 2006

How to Create a New SAPUI5 Development Component

How to Set Up and Use the SAP OEE Custom KPI Andons Feature

Configure SSO in an SAP NetWeaver 2004s Dual Stack

What s New / Release Notes SAP Strategy Management 10.1

How To... Configure Integrated Configurations in the Advanced Adapter Engine

How To Recover Login Module Stack when login to NWA or Visual Administrator is impossible

How To... Master Data Governance for Material: BADI USMD_SSW_PARA_RESULT_HANDLER to merge result of parallel workflow tasks

Create Monitor Entries from a Transformation routine

Extract Archived data from R3

How To... Master Data Governance for Material: BADI USMD_SSW_SYSTEM_METHOD_CALLER to create successor change request

How To...Configure Integration of CUP with SPM

Simplified Configuration of Single System Update in Maintenance Optimizer

Web Page Composer anonymous user access

Create Monitor Entries from an update routine

Send Multiple IDocs Within One XI Message

Data Validation in Visual Composer for SAP NetWeaver Composition Environment

How To Generate XSD Schemas from Existing MDM Repositories

How To Use Surveys with Mobile Sales for handheld Version 1.00 January 2007

Handle. How-to Guide SAP NetWeaver 2004s. Version 1.00 Sept 2006

SAP NetWeaver How-To Guide

How To...Use a Debugging Script to Easily Create a Test Environment for a SQL-Script Planning Function in PAK

Cache Settings in Web Page Composer

How-To... Add Sensitive Content into an Area

Quick Reference Guide SAP GRC Access Control Compliant User Provisioning (formerly Virsa Access Enforcer): HR Triggers

Process Control 2.5 Implementation Checklist

How to View Dashboards in the Self Service Composition Environment with Additional Metadata

Use Business Objects Planning and Consolidation (version for the Microsoft platform) BPF services in Xcelsius

Configure UD Connect on the J2EE Server for JDBC Access to External Databases

How To... Master Data Governance for Material: File Down- and Upload

How To Customize the SAP User Interface Using Theme Editor

Work with Variables in SAP NetWeaver Visual Composer Version 1.00 May 2006

SAP Composite Application Framework. Creating a Content Package Object

Introducing SAP Enterprise Services Explorer for Microsoft.NET

Enterprise Portal Logon Page Branding

How to Translate a Visual Composer Model Part I

WDA - Custom themes for Web Dynpro ABAP applications without SAP Enterprise Portal integration

Configure Peripheral Drivers with Mobile Infrastructure

Setup an NWDI Track for Composition Environment Developments

Use the J2EE SOAP Adapter

Preview of Web Services Reliable Messaging in SAP NetWeaver Process Integration 7.1

Sample IDoc-XI Scenarios

Building a Composite Business Process from Scratch with SAP NetWeaver BPM Guide 2

SAP Learning Solution RKT ERP 2005 LSO 6.00

SAP NetWeaver How-To Guide How to use Process Execution Manager Using SAP Test Data Migration Server

SAP NetWeaver 04. Unification Terminology

SAP - How-To Guide MDG Custom Object Data Replication How to Configure Data Replication for MDG Custom Objects (Flex Option)

Building a Tax Calculation Application

SAP MII: Leveraging the Data Buffering Feature for Connection Error Handling.

Line Items in BI Integrated Planning

How to Browse an Enterprise Services Registry in Visual Composer

How To...Custom BADI for rounding off values in SAP BUSINESSOBJECTS Planning and Consolidation, version for SAP NetWeaver.

The test has been performed using a 64 Bit SAP NetWeaver Application Server Java 7.1 Enhancement Package 1 SP4 or greater system.

Visual Composer Build Process

How To Integrate the TinyMCE JavaScript Content Editor in Web Page Composer

View Time Security for crystalreports.com

Integrating a Web Service in a Composite Application. SAP Composite Application Framework

How-to Guide SAP NetWeaver 04. Web Dynpro Themes. Version Applicable Releases: SAP NetWeaver 7.0

Setting Up an Environment for Testing Applications in a Federated Portal Network

SDN Contribution HOW TO CONFIGURE XMII BUILD 63 AND IIS 6.0 FOR HTTPS

Extracting Product Attributes in XML using Web Service

Best Practices Using KMC Capabilities in an External Facing Portal Version 1.00 October 2006

How To Build the Carry Forward and Account Transformation Business Rules

Hardware Requirements

SAP Composite Application Framework. Creating an External Service type Callable Object in Guided Procedures

Backup & Restore with SAP BPC (MS SQL 2000)

Use the BI Java SDK in a Web Dynpro Application Version 1.01 July 2005

Modeling Considerations for BPC Time Dimensions

How To... Use the BPC_NW Mass User Management Tool

Value Help in Web Dynpro ABAP - Tutorial.

How-to Guide SAP EPM. How To Use Comments. Version 1.00 March Applicable Releases: EPM BPC 5.1 Microsoft & EPM BPC 7 Microsoft

How To... Configure Drill Through Functionality

How to Use Definitions in Rules Composer

How To Enable Business Workflow for SAP NetWeaver Gateway 2.0

Installation Guide Business Explorer

SAP NetWeaver How-To Guide. SAP NetWeaver Gateway Virtualization Guide

Transcription:

f How-to Guide SAP NetWeaver 04 How to receive and convert PDF-documents with SAP XI Version 1.00 Apr 2006 Applicable Releases: SAP NetWeaver 04 SP16

Copyright 2006 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. 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, 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. These materials are provided as is without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages. SAP NetWeaver How-to Guides are intended to simplify the product implementation. While specific product features and procedures typically are explained in a practical business context, it is not implied that those features and procedures are the only approach in solving a specific business problem using SAP NetWeaver. Should you wish to receive additional information, clarification or support, please refer to SAP Consulting. Any software coding and/or code lines / strings ( Code ) included in this documentation are only examples and are not intended to be used in a productive system environment. The Code is only intended better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, except if such damages were caused by SAP intentionally or grossly negligent.

1 Business Scenario...1 1. Prerequisites and assumptions...1 1.1 Example...1 2 Introduction...2 2.1 Template documents analysis...2 3 The Step By Step Solution...4 3.1 Create the Interface Objects in the Interface Repository...4 3.2 Create the New Parsing Project...5 3.3 Parsing using the IntelliScript...7 3.4 Parsing the grid...10 3.5 Running the parser inside the Editor...13 3.6 Exporting the Results to the Integration Server...14 3.7 Configuring the Communication Channel...15 4 Appendix: Documentation Links...16

1 Business Scenario 1. Prerequisites and assumptions To implement this example you need to have the Conversion Agent Studio installed in your PC and the engine deployed to your XI server. Also consider that the overall scenario will not be explained (for example, any possible functional ERP customizing, ALE or IDoc implementation, etc.). 1.1 Example Our company receives orders from customers that must be typed into the system. Some important customers (e.g. Happy Buyer Company Inc.) send a large amount of documents. All those documents have the same format (purchase orders in PDF files) and only transactional details change. We are going to create XI Interfaces and also use

SAP Conversion Agent by Itemfield to automatically create sales orders in our ERP system 2 Introduction Our first objective is to create the strategy and understand the input and output documents We will create a project in the SAP Conversion Agent by Itemfield to develop the purchase order (PO) parsers (bear in mind that from our company s point of view, this document will later become a sales order in our ERP system). Since the project is the key to produce the transformation in XI, projects will be very specific, it is necessary to indicate in its name both the partner and document. Depending also on the case, adding the technical transformation could be also useful. We will also try to contact Happy Buyer Company to help us fully understand the document and also gather a significant number of examples so as to be sure that our parser is robust enough to understand any PO and also try to handle automatically any version change in the source document format. Due to generation characteristics, we can experience some characters displacement, so we will use a mixture or positional parsing and pattern search techniques. The output from the parser is much more flexible since it will be defined as a general (or canonical) PO format (customer independent) that will be able to be translated into a sales order. 2.1 Template documents analysis Now we are going to take a closer look to our source document to determine all the required information. Since every customer has its own format it will be necessary to create a parser for each, but on the other hand the customer is implicit, so we are not taking into account the customer info. We will need to take from the header the number of the PO and also the date. Both fields are preceded by strings labels ( Order Number: and Date ). The first one is 10 characters long and the second is a date field in the format MM/DD/YYYY. The rest of the information, the items, is provided in a grid-like structure:

The grid ends when the total line appears. To find out the beginning of items on the document we will use the trailing part of the heading as marker, that is, the Net Value string. Later the Total net value excluding string will mark the end of the repeating items.

3 The Step By Step Solution Now it is time to implement the solution in our systems. 3.1 Create the Interface Objects in the Interface Repository 1. Access the XI Interface Repository and create the Data Type. 2. Create the Message Type based on the previous Data Type. 3. Export the Message Type XSD to a file.

4. Continue implementing your interface in the integration repository as usual. These steps go beyond the scope of this guide. 3.2 Create the New Parsing Project 5. Access the SAP Conversion Agent by Itemfield editor, open the required perspective and create a new blank project. Note that it is also possible to directly create a parser project using this wizard but we will create the project manually in this example. 6. Type the name and press finish. 7. Access the new project properties

8. Make sure to choose UTF-8 for input encoding 9. Now create a new parser 10. Name the parser, press Next 11. Name the Script, press Next 12. Select the example file, press Next

13. Add a sample PDF file and press Next 14. If the parser automatically detects the source example as PDF file it will automatically select the option, if not (shown in this example), leave the selected option and press Finish. 15. Add the XSD file you previously created into the project. 3.3 Parsing using the IntelliScript 16. Open the readpo.tgp script in your project and the IntelliScript will appear. On the right hand side a document preview will also come out. If the Wizard did not recognize the file format, the document preview will look quite strange.

17. To make the editor understand the file, it is necessary to expand the advanced properties of the example_source option by double clicking the >> sign. The pre_processor option will appear. Double click the sign and the list of processors will come out. Select the PdfToText_3_00. 18. To reload the example document right click in the first line of the parser and select Open Example Source 19. Now a text version of the document is displayed.

20. To identify the position of the order number label, highlight it, press a right mouse click on it and select, Insert Marker This will advance the parser cursor to that position 21. Now we want the parser to read the number. To do that, add a Content anchor step in the editor. 22. To make our parser robust, we will implement a PatternSearch operation for the value option and a regular expression to identify the 10 numbers ([0-9]{10}) that represent the PO. 23. To assign the number to the output XML, double click the data holder option and then select the proper element. You will repeat this procedure every time you create a new Content anchor.

24. Repeat the steps for the date (adding a nice regex) and the result should look like this: Also the markers and contents should be highlighted on the right panel. Tip: Pressing right-click on the anchors and selecting the option View Marking the editor will show you the place where the content is found on the example document. 3.4 Parsing the grid 25. To find the grid on the document, let s advance the marker to the end of the heading, defining the Net Value string as marker. 26. Every line is preceded by a cr+lf character set (new line), and ends with another, so every 2 cr+lf character set, there is logically a whole grid line enclosed. We will apply this logic to parse each line. 27. Insert a Repeating Group anchor, indicating that the separator (a new line search) is positioned before the data, and after a second separator the line ends. 28. The Item number is always located at the beginning of the line, and is 5 characters wide. To parse it, create a Content anchor indicating the corresponding offset. You can easily do that, selecting the characters, from the sample document and pressing right click on them. Finally, select Insert Offset Content as shown.

29. To finish the step specify the proper data holder as usual. 30. Since we are interested in the material code but not in the description, we will repeat the previous operation, now on the material code, and using a pattern instead of the offset search. 31. A new issue comes up when parsing the quantity. Due to generation concerns, the columns are shifted. 32. Define an offset Marker anchor, just before the quantity column starts, skipping the maximum material description area. The offset is calculated from the last marker (the cr+lf character set on the previous line). Tip: Use the editor to help you find the number, since (in this particular example) it concurs with the line position.

33. To clearly identify the quantity, you can use a regular expression to locate the number and the unit of measure that follows. In this case the unit of measure indicates the beginning of the marking. Use the Content anchor as indicated. The parser will locate 3 alphabetic characters (regex: [A-Za-z]{3}) and a preceding number (xs:double). 34. To identify the Unit of Measure repeat the pattern search technique of the Content anchor. 35. To parse both the Unit Price and the Net Value, use the TypeSearch technique of the Content anchor, indicating number format values (xs:double). 36. To identify the end of the grid, insert a marker anchor outside the scope of the RepeatingGroup anchor. In this example use the Total net value excluding tax string.

37. By now your script panel should look like this: 38. To mark the whole grid, select IntelliScript Mark Example 39. Now the grid should look like this: The markers appear in yellow and the content in gray. 40. Make sure you assigned the data_holder value for each Content anchor. 3.5 Running the parser inside the Editor 41. To run the example parser, choose Run Run HappyBuyerCompany (the name of your parser)

42. To view the results, expand your project s results and double click the output.xml document. 43. Internet browser will show the xml result. 3.6 Exporting the Results to the Integration Server 44. To deploy the content, choose Project Deploy

45. Complete the form, indication the startup component if necessary. To find the results, read the location at the bottom. Tip: You can indicate the startup component in the IntelliScript editor right-clicking the parser heading and selecting Set as Startup Component. 46. Copy the whole contents of the project directory to your ServiceDB Integration Server directory. 3.7 Configuring the Communication Channel 47. To configure the communication channel, log in the Integration Directory and edit the channel. 48. To activate the conversion, add the module localejbs/sap.com/com.sap.nw.cm.x i/cmtransformbean in the first position and the parameter Transformation name to specify the name of your project.

49. Now you should be able to receive documents in PDF format! 4 Appendix: Documentation Links Itemfield in the SAP Service Marketplace http://service.sap.com XI SAP XI in Detail SAP XI 3.0 Connectivity Connectivity SAP XI 3.0 Itemfield.

www.sdn.sap.com/irj/sdn/howtoguides