Sunteți pe pagina 1din 10

SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.

com
2011 SAP AG 1
Real-time on Premise and on
Demand Integration with SAP
NetWeaver Process Integration
Applies to:
SAP NetWeaver Process Integration / SAP NetWeaver Exchange Infrastructure All releases. For more
information, visit the SOA Management homepage.
Summary
The following document shows based on customer experience how real time integration between SAP
backend systems (ERP, BW, ) and on demand solutions (e.g. salesforce.com) with SAP NetWeaver
Process Integration can be achieved. It gives an outline of the required steps and explains challenges and
how you could deal with them.
In general the approach is release independent it requires a double stack PI installation. For 7.30 and
higher there is also a Java only installation option for SAP NetWeaver PI if you choose this the approach
is still possible but has to be modified to use BPM instead of ccBPM.

Authors: Hardank Markus, Bui Duy-Tan
Company: SAP Deutschland AG & Co KG
Created on: 18 November 2011
Author Bio
Markus Hardank, SAP Deutschland AG & Co KG. He is technical consultant with more than 5 years
experience in the SAP environment, focussing on development and integration consulting. In lots of
customer workshops and projects he could show his expertise and know how in the area of SAP
NetWeaver Process Integration on customer side. Next to his PI skills he could also gain experience in the
area of SAP master data management and SAP Business ByDesign.
Duy-Tan Bui, SAP Deutschland AG & Co KG. He is technology consultant in the consulting area of
SAP NetWeaver with focus on Process Integration. He works since 13 years in the software industry,
and therefrom 9 years as integration consultant with SAP- and Non-SAP platform. During this time
he has gained profound experience in software development (JAVA and ABAP), in conception and design of
interfaces, BPM (Business Process Management), in analysing system landscapes, business processes as
well as requirements analysis, business process modeling and design of integration processes. In his long
professional experience he stands out again and again due to a quick and profound practice new technology
and methology.


Real-time on Premise and on Demand Integration with SAP NetWeaver Process Integration
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 2
Table of Contents
Introduction and Overview .................................................................................................................................. 3
Solution and Challenges ..................................................................................................................................... 4
Technical Deep Dive ........................................................................................................................................... 6
Using Salesforce Standard Enterprise WSDL in SAP NetWeaver PI ............................................................. 7
Salesforce Login ............................................................................................................................................. 7
SOAP Request Salesforce .............................................................................................................................. 8
Summary............................................................................................................................................................. 8
Related Content .................................................................................................................................................. 9
Copyright........................................................................................................................................................... 10

Real-time on Premise and on Demand Integration with SAP NetWeaver Process Integration
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 3
Introduction and Overview
In todays business there is the demand to access data from everywhere. This is the reason why more and
more customers think about enhancing their existing IT environment with cloud solutions. One of these
solutions is salesforce.com which offers CRM functionality in the cloud.
In customer projects more often the requirement comes up to integrate these on demand solution via SAP
NetWeaver Process Integration with existing SAP and non SAP systems.
So master data is created in SAP and synchronized via PI with the cloud system. The same happens for
transactional and reporting data. And of course cloud objects are transferred back to SAP systems, e.g. for
reporting and analytical purposes.
In the following guide we will not focus on every single object and how to develop the integration in SAP
NetWeaver PI, but give a high level overview how such an integration could look like and which challenges
you come across and how they can be solved.
The following picture illustrates the starting point on a high level. The SAP applications most likely tend to
use asynchronous techniques (IDOC) and on demand solutions (e.g. salesforce.com, ) might require
synchronous (Web service) calls. So there will be functionality required not only to map different message
structures but also to transfer between different protocols and to some extend other philosophies (as you will
see in the challenges section). So this looks like a typical use case for SAP NetWeaver Process Integration.


Of course also other connectivity options, like Skyva (http://www.skyvva.com/) - might be possible. The
basic question is where you want to put integration logic, find people for implementing your requirements and
build up know-how within your organization.
But let`s look at SAP NetWeaver Process Integration. The probably first question to answer is, if any
additional functionality like adapters or adapter modules are required to implement such a scenario. The
good thing is there is nothing additional required. But the second and related question is if ccBPM should be
used for this integration project or not, as basically asynchronous (IDOC) and synchronous communication is
required. However, for simple Web service calls this requirement could be technically solved without ccBPM.
To be able to handle changing requirements, which could lead to more complex logic (like conditions and
based on the result different service calls) and to have standard monitoring functionality in place the decision
will most likely go for ccBPM. And last but not least there are some technical challenges, where ccBPM is a
useful tool. But if you just have simple objects or want to avoid ccBPM usage, the SOAP adapter with the
AXIS framework might be an option. For SAP NetWeaver 7.30 and higher SAP NetWeaver BPM is worth
considering.


Real-time on Premise and on Demand Integration with SAP NetWeaver Process Integration
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 4
Solution and Challenges
Before looking how a solution might look like lets first take a look at the challenges that came up in this
integration, so that it becomes clearer what this integration makes a little bit more sophisticated. Basically the
challenges can divided into the following three categories:
Connector / Session Handling (1) this basically deals with technical topics of integration of two
different concepts so integration of on premise with on demand and the resulting requirement for
authentication and keeping the authentication valid for a certain amount of time (session handling).
WSDL Consumption / API Limitations (2) as lot`s of users and even companies share resources in
the cloud environment it might not be possible to change all environment settings and therefore
default settings have to be kept and form an API limitation.
Service Cut (3) about how to design a service interface and consider different approaches, like an
IDOC based structure versus a object oriented design approach with e.g. parent-child relationships
that might cause additional effort in your mapping programs. Also requirements like identification of
the required operation (create, update, delete) and calling the executing the correct operation with all
required parameters fit into this category.

Categories of Challenges

The high level challenge categories can look like the following table, this is based on customer experience
with a salesforce.com integration, so it can be slightly different depending on your on demand solution but it
should give you a rough idea with a possible solution.

Challenge Category Solution
Using Salesforce Standard Enterprise
WSDL
2 This could be used but for each SFDC object one
wsdl file has to be created / imported into PI.
Login / Session / Limits Handling:
- 10000 login call each hour
- Login rate: 3600 each hour
- Session expiration
1 Create a central login ccBPM process and persist
SessionID e.g. in PI ABAP Stack or in a database
Alternate the user used in login call, get new session,
invalidate old session
At least 2 api users have to be used
Real-time on Premise and on Demand Integration with SAP NetWeaver Process Integration
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 5
SessionId is used in JavaMapping for each
subsequent call (upsert, query, delete)
Handling Upsert / Delete Limits (200
records per request)
2 Multi-Mapping in ccBPM
Handling Query Limits
The default is 500; the minimum is
200, and the maximum is 2,000.
2 Multi-Mapping in ccBPM
Handling Concurrent API Request
Limits
Production organizations: 25
Sandbox: 25
2 Reduce assigned queues for ccBPM in PI (bad
performance)
Avoid parallel running jobs in sending system e.g.
SAP ERP
Integration logic for building parent-
child relationship
3 Use ccBPM for defining the send sequence and the
upsert service with the field externalIDFieldName
Integration logic for continuous delta
synchronisation
3 There are two approaches to achieve this, the
question is whether delta synchronization logic
should be in PI or Salesforce:
1. ccBPM integration process with a pattern
using the Salesforce Operations Query +
Delete + Upsert
2. ccBPM integration process: PI triggers
Salesforce to check delta synchronization
logic, which is confirmed and afterwards PI
executes the Salesforce Upsert operation.
Handling type for sObject,e.g.
xsi:type="Account"
2 Setting in JavaMapping depending on interface
name
Mapping 1 Graphical Mappings, in some cases Java Mappings
(e.g. parent child relationships)
Error Handling 1 Inside ccBPM separate error handling branches
Monitoring 1 Standard PI Tools like RWB
Sync-Async-Communication with
SFDC as sender
1 Supported via ccBPM
Async-Sync Communication with
SFDC as receiver
1 Supported via ccBPM

Real-time on Premise and on Demand Integration with SAP NetWeaver Process Integration
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 6
Technical Deep Dive
As you saw we could solve all issues with standard SAP NetWeaver PI functionality however some
additional coding (Java Mappings, ccBPM Login process) has to be developed to solve the described
technical challenges.
We would now like to give you an overview how the final solution looks like from a technical perspective.
Basically there are 2 types of ccBPM processes:
Technical ccBPM process for handling the Login. This process runs on a regular interval and stores
essential information for sending data to Salesforce (like SessionID).

Outline login procedure

Business ccBPM processes for every object for handling the transfer of the business data from
SAP to SFDC or the other way around. Depending on the object there might be one or more web
service API calls on Salesforce side. The technical login information is retrieved from the persisted
(cached) login table via RFC call. Of course for these scenarios also other technologies instead of
IDoc are possible, like proxy or even File or JDBC if you have legacy applications to integrate.


Outline IDOC based scenario
Note: Please note that the business object of course can have a high impact on the number of service calls and
therefore the complexity of the integration process. But for simplicity reasons we will not cover this here.
We do not want to go into the details about ccBPM and mapping implementation but rather share knowledge
on some general aspects from the challenges section.

Real-time on Premise and on Demand Integration with SAP NetWeaver Process Integration
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 7
Using Salesforce Standard Enterprise WSDL in SAP NetWeaver PI
You can use the standard Salesforce Enterprise WSDL file, but have to import the file for every Salesforce
object into SAP NetWeaver PI. As we found problems in resolving the generic type="ens:sObject" used by
Salesforce, we replaced the sObject in the type statement with the concrete object we used (e.g.
Z_Material__c in the example below).

<!-- Upsert Message Types -->
<element name="upsert">
<complexType>
<sequence>
<element name="externalIDFieldName" type="xsd:string"/>
<element name="sObjects" type="ens:sObject" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
Original Part of Enterprise WSDL

<!-- Upsert Message Types -->
<element name="upsert">
<complexType>
<sequence>
<element name="externalIDFieldName" type="xsd:string"/>
<element name="sObjects" type="ens:Z_Material__c" minOccurs="0" maxOccurs="unbounded"/>
</sequence>
</complexType>
Part of Enterprise WSDL after modification to Z_Material__c

Salesforce Login
The login to Salesforce itself is pretty easy. You send a request message containing your credentials and will
receive a response message with a huge number of information. In this message basically the sessionID and
the serverURL are the most relevant for the further message processing. The sessionID as the name
already indicates contains the session information. The serverURL contains the information of the server
system to which this request has to be sent. This is important as on the SAP backend side you will have a
multiple system landscape (sandbox, development, quality, production) whereas on salesforce the different
landscape is basically identified on the user information and the login server (test versus productive).

<soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/
xmlns:urn="urn:enterprise.soap.sforce.com">
<soapenv:Header></soapenv:Header>
<soapenv:Body>
<urn:login>
<urn:username>YourUsername</urn:username>
<urn:password>YourPassword</urn:password>
</urn:login>
</soapenv:Body>
</soapenv:Envelope>
Salesforce.com Login Request Message

Real-time on Premise and on Demand Integration with SAP NetWeaver Process Integration
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 8
SOAP Request Salesforce
The Salesforce SOAP request consist of a SOAP header which contains the sessionID, as there where
limitations about how often a user can logon in a certain time period and how long a session is opened we
tried to place this logic into a separate process and just retrieve the session ID in a separate java mapping.
Unfortunately this has to be a Java or XSLT mapping as we have to modify the Header of the message.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:enterprise.soap.sforce.com">
<soapenv:Header>
<urn:SessionHeader>
<urn:sessionId>The_Session_ID</urn:sessionId>
</urn:SessionHeader>
</soapenv:Header>
<soapenv:Body>
....
</soapenv:Body>
</soapenv:Envelope>
Request Message with SessionId

Summary
This paper shows how to integrate SAP NetWeaver Process Integration based on standard functionality
shipped with this product. The following graphic summarizes the ingredients of the outlined approach.


Ingredients of integration solution


Real-time on Premise and on Demand Integration with SAP NetWeaver Process Integration
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 9
Related Content
SFDC Integration using PI 7.1 - How to add SOAP Envelope in Java Mapping
SFDC Integration Using SAP PI: A Case Study
SAP PI HTTP Client
Note 806546 - XI 3.0/7.0/7.01: XI Troubleshooting Guide
PI Best Practices: Sizing and Performance Tuning
SAP Mapping Factory
For more information, visit the SOA Management homepage.

Real-time on Premise and on Demand Integration with SAP NetWeaver Process Integration
SAP COMMUNITY NETWORK SDN - sdn.sap.com | BPX - bpx.sap.com | BA - boc.sap.com | UAC - uac.sap.com
2011 SAP AG 10
Copyright
Copyright 2011 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 logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web 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.

S-ar putea să vă placă și