+ Start a Discussion
srikanth challasrikanth challa 

SAP Integration using Web Services

Hi All,

What process exactly I should use to send few fields from Salesforce to SAP when a case is 'Saved'. Please explain in detail as I did not work on Webservices anytime before 
pconpcon
You have a couple of different options that could do:

Polling
You can have a system that calls a Salesforce SOAP or REST endpoint [1] [2] and pulls the data for any cases that have been updated since X date.

Pros
  • Any hiccup in the communication you can easily re-poll and pull the data.
  • Do not have to open ports to internal systems
Cons
  • Not real time
  • Requires additional infrastructure
  • Limits around large data sets 
  • Times only accurate down to the second so if you have too many cases updated within a second then you'll have trouble indexing them

Outbound WebService Call
As part of an after trigger you can make an @future call and make an outbound WebService call [3] to your SAP instance.

Pros
  • Close to real time
  • Direct access to SAP with feedback about failures
Cons
  • Requires opening ports to your SAP instance
  • @future calls have limits on the number of per day
  • @future calls can get backed up and be not real time

Outbound Messaging
Using a workflow rule you can send an Outbound Message [4] to a system that handles messages and then converts them over to your SAP instance.

Pros
  • Real-time
  • Fault tolerant
  • Requires no additional code in Salesforce
Cons
  • Requires additional infrastructure
  • Requires knowledge of ESB / messaging systems

Lightning Connect
Comming soon (safeharbor), Lightning Connect [5] should be able to talk with SAP over oData and do read/write.  This would allow you to add SAP as a connect endpoint and use Salesforce triggers to write the data to your SAP endpoint

Pros
  • Real-time
  • All Salesforce native
Cons
  • Requires opening ports to your SAP instance
  • Expensive
  • Not GA'd yet
  • Requires your SAP instance to have oData support

3rd Party Options
There are some third party options that you can use to connect Salesforce to SAP.  I don't know any off the top of my head and have not used any, so I won't link them here

Pros
  • Someone else is maintaining the infrastructure
  • Faster to implement
Cons
  • Can be expensive
  • Have to trust a 3rd party with your data

[1] http://blog.deadlypenguin.com/blog/2015/03/09/web-services-development-salesforce/
[2] https://developer.salesforce.com/page/Creating_REST_APIs_using_Apex_REST
[3] https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_callouts_http.htm
[4] https://www.salesforce.com/developer/docs/api/Content/sforce_api_om_outboundmessaging_setting_up.htm
[5] http://www.salesforce.com/platform/services/how-you-integrate/