SAP PI to HANA Connectivity
Applies to: SAP Netweaver PI.
Summary The document describes about a scenario where the requirement is to establish a direct connection from SAP PI to HANA system for faster response. Author:
Anumeha Khandelwal
Company: SAP GD, Gurgaon. India. Created on: 7 on: 7 July 2012
Author Bio Anumeha Khandel wal is a consultant at SAP S AP GD, GD , India. I ndia. She Sh e is a part of SAP PI team t eam and has been part of many PI implementation projects.
SAP COMMUNITY NETWORK © 2011 SAP AG
SDN - sdn.sap.com | BPX - bpx - bpx.sap.com .sap.com | BA - boc.sap.com | UAC - uac.sap.com 1
SAP PI to HANA Connectivity v1.0
Table of Contents Purpose ............................................................................................................................................................... 3 Abstract ................................. .................. .................. ................. ................. .................. ................. .................. ... 3 Description .......................................................................................................................................................... 3 Using the SAP HANA Studio .......................................................................................................................... 3 Using the JDBC Driver .................................................................................................................................... 6 Installing the JDBC Driver ............................................................................................................................... 6 Loading the JDBC Driver ................................................................................................................................ 6 Connection URL ................. ................. .................. ................. ................. .................. ................. .................. ... 7 Configuring JDBC adapter in SAP PI ................. ................. .................. ................. ................. .................. ...... 7 Test Result ...................................................................................................................................................... 8 Copyright............................................................................................................................................................. 9
SAP COMMUNITY NETWORK © 2011 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com 2
SAP PI to HANA Connectivity v1.0
Purpose The idea to implement this scenario came up when we had a requirement to transfer information from Cloud system to SAP CRM and back.SAP CRM system would in turn connect to SAP HANA get the results and send the result back to cloud system. As the requirement was to look for very quick results, I came up with scenario where we connect SAP PI directly to HANA to speed the process.
Abstract In order to establish a connection between SAP PI and HANA system, we need SAP HANA JDBC driver. The following document describes about getting the JDBC driver, using SAP HANA Studio to see the database tables and set up a sample scenario in PI to insert records into HANA database tables. Following document describes about the steps required to establish a connection between SAP PI and HANA system. 1. 2. 3.
Using SAP HANA Studio Using the JDBC Driver PI configuration
Description Using the SAP HANA Studio
SAP HANA Studio is a tool for developers who wish to create data models and stored procedures. We will use SAP HANA to view the database table that is updated via this scenario. Install SAP HANA Studio on your workstation. To use SAP HANA Studio you need to know the name of your SAP HANA user account and its respective password. This information can be obtained from your local database administrator. Please note that access to some schemas (catalogs of data models and objects) is restricted. Adding a HANA system to Studio 1. 2. 3. 4.
Make sure you are Administrator Console Right click on the navigator view. Select Add System from the context menu In the dialog window that appears enter the following Hostname: zzz-xx-yy.wdf.sap.corp (Your HANA system host name ) Instance Number: 01 (HANA system instance number) Description: HANA demo system
SAP COMMUNITY NETWORK © 2011 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com 3
SAP PI to HANA Connectivity v1.0
5. 6.
Click on “Next”
Please enter the name of the system or personal user name you have been given by your system administrator, the respective password and then
SAP COMMUNITY NETWORK © 2011 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com 4
SAP PI to HANA Connectivity v1.0
7.
Click Finish. If the data entered is correct, a half expanded tree structure will appear in the Navigator view with the name of the system as its top node. Please double-click on the Catalog. Under that node you will find the nodes Authorization and Public Synonyms as well as a number of entries which represent database schemas.
SAP COMMUNITY NETWORK © 2011 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com 5
SAP PI to HANA Connectivity v1.0
8.
Click the Schema node, and then the table node. You will see the tables that you want insert records into
Using the JDBC Driver To access SAP HANA from PI, you have to first deploy SAP HANA JDBC Driver on PI Server.
Installing the JDBC Driver Since the SAP HANA Studio was written in Java, the JDBS driver is installed along with the SAP HANA Studio and can be obtained from this installation. It can be found in:
/plugins/com.sap.ndb.studio.jdbc_.jar on Linux or UNIX platforms and on Windows platforms in \plugins\com.sap.ndb.studio.jdbc_.jar Note: within the Jar files, you will have to navigate to the following path com.sap.db.jdbc.Driver, to extract the Jar file that should be deployed on PI server:
Loading the JDBC Driver Please use the forName method of the Class in the Java platform: Class.forName("com.sap.db.jdbc.Driver");
SAP COMMUNITY NETWORK © 2011 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com 6
SAP PI to HANA Connectivity v1.0
Connection URL In the connection URL, you define the properties of the connection to the database instance. Syntax jdbc:sap://[:][/?[&]...] Name of the database computer Port of the SAP in-memory computing engine instance. ,,... Properties of the connection Example jdbc:sap://localhost:30115/? reconnect=true Using this connection URL, you set up a connection to the database instance from PI adapter.The port number used by the SAP in-memory computing engine is 30115. The connection options select the reconnect to true.
Now you are all set to go. 1. 2.
The database tables are accessible. JDBC driver is deployed on the server.
All that is required now is to configure the JDBC adapter in SAP PI to establish the connection to the database.
Configuring JDBC adapter in SAP PI
PI can now communicate to HANA system and send information back and forth.
SAP COMMUNITY NETWORK © 2011 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com 7
SAP PI to HANA Connectivity v1.0
Test Result Following is the result of a scenario which inserts table into the HANA database table.
Input File:
Execute your scenario and Check in Runtime Workbench:
You can now check in HANA studio using SQL query to verify whether the record has been inserted:
SAP COMMUNITY NETWORK © 2011 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com 8
SAP PI to HANA Connectivity v1.0
Copyright © Copyright 2012 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, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation. Linux is the registered trademark of Linus Torvalds in the U.S. and other countries. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated 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 Oracle Corporation. JavaScript is a registered trademark of Oracle Corporation, used under license for technology invented and implemented by Netscape. SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, 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 other countries. Business Objects and the Business Objects l ogo, BusinessObjects, Crystal Reports, Crystal Decisions, W eb Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company. 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 COMMUNITY NETWORK © 2011 SAP AG
SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com 9