Admins / Architects / Developers

Best Practices for Integrating Salesforce With SAP

By Alexander Ilg

To manage their most important business processes, most organizations follow a best-of-breed approach. Rather than going with one large and trusted vendor, like SAP, business leaders select the best technological solutions from multiple platforms and vendors. This demand for best-of-breed solutions makes integration more important than ever. After all, even the best platforms can only achieve their full potential once all solutions work together seamlessly.

Two of the most common enterprise solutions found in large organizations are Salesforce for Customer Relationship Management (CRM) and SAP for Enterprise Resource Planning (ERP). In this article, we will discuss how to integrate Salesforce and SAP ECC 6.0 or SAP S/4HANA, explore potential integration options, and then illustrate a real-life example of a successful solution.

Benefits of Integrating Salesforce With ERP Systems Like SAP

Many processes and solutions in Salesforce, such as Sales Cloud or Service Cloud, are often incomplete, with no additional information from other systems. Without a view into this data, users are forced to switch between systems to get a complete picture – a user-unfriendly approach that can sap employee productivity and lead to costly errors.

In contrast, integrating Salesforce with SAP leads to the following advantages:

  1. Improved Data Quality: Integrating the two systems allows for seamless data sharing between them, which can help improve data accuracy and eliminate data duplication.
  2. Increased Efficiency: Integration helps streamline business processes, automate data entry, and reduce manual errors, leading to increased operational efficiency.
  3. Enhanced Visibility: Once business users have a better view of their customers, including data on sales, marketing, customer service, and billing, they are able to make better decisions and improve the overall customer experience.
  4. Improved Collaboration: Integration enables stronger collaboration among your sales, marketing, and customer service teams, providing them with real-time access to the same important customer information.
  5. Reduced Costs: In an integrated environment, users save time and money by automating data entry and reducing manual errors. In addition, a more efficient sales process allows sales reps to spend more time selling and less time on administrative tasks.
  6. Increased Revenue: By enhancing customer visibility in ways that improve the customer experience, a solid integration can ultimately increase revenue and drive business growth.

Within Salesforce, Customer 360 offers a good example of enhanced visibility into the customer experience. Within account details, a Salesforce user can access contacts, opportunities, activities, and much more. However, critical information, like credit status, payment history, invoices, deliveries, and attachments, is only available in SAP. That’s where a well-designed Salesforce integration can play a crucial role.

Preparing the Integration Project

Integration Options

There are different ways how an integration can be implemented. They can be grouped into three basic categories.

Custom Development (Level 1 Integration)

A custom development project could be completed without the help of an integration platform. On the Salesforce side, it would leverage the following APIs:

  • REST API
  • SOAP API
  • Streaming API
  • Web Service callouts
  • Salesforce Connect

Creating a direct integration from scratch means that you will not need to pay for additional licenses or subscriptions beyond your core Salesforce and SAP licenses. However, custom development requires the highest implementation effort and carries the biggest project risk. Also, Salesforce cannot integrate directly with SAP standards, like RFC (Remote Function Call), which limits your integration options.

If you want to learn more about the custom development option, don’t forget to read the Ultimate Introduction to Salesforce Integration.

IPaaS Solutions (Level 2 Integration)

Integration via an IPaaS (Integration Platform as a Service), the next integration category, offers some advantages to custom development. Specifically, IPaaS solutions often come with adapters for SAP that you would not need to build from scratch. The IPaaS takes care of important considerations like connection handling, authentication, and security.

The following list includes some of the more commonly used iPaaS solutions for integrating SAP into Salesforce:

  • MuleSoft is the iPaaS by Salesforce. It has its strength on the Salesforce side and offers templates for SAP integration.
  • SAP CPI (Cloud Platform Integration) is SAP’s offering. It supports all SAP protocols and comes with templates for Salesforce integrations.
  • Jitterbit, Dell Boomi, IBM App Connect, and many other platforms can also be used for your integration but are less common.

SaaS With Ready-to-Use Integrations (Level 3 Integration)

SaaS (Software as a Service) solutions offer more than just a platform for building integrations – they also provide predefined application content that is ready to use. This offers the distinct advantage of saving the time and cost of managing a long, risky integration project. Instead, you can install the integrations and go live typically in a matter of weeks. A license fee or subscription provides access not just to the solution but also to ongoing support and product updates.

The two such SaaS solutions are Enosix and Vigience Overcast. They offer pre-defined integrations into SAP, including the user interface layer on the Salesforce side.

Overcast has over 150 integrations into SAP and other ERP systems, like Microsoft Dynamics and Oracle NetSuite. On top of its out-of-the-box functionality, Overcast allows you to create your own integrations.

In choosing your type of integration, there is one other factor to consider – the ongoing maintenance of your solution, which (after go-live) is highest for level 1 (custom development) and lowest in level 3 (SaaS like Enosix or Overcast). Integrations constantly need to be tested and adjusted to new Salesforce and SAP releases.

The following spider graph shows how the three options compare (the lower value is better):

Specifications

As with every successful software project, good specifications should be your starting point. For an integration project, a few key things should be documented upfront to make your project a success.

What Needs to Be Integrated?

SAP offers an almost endless number of business processes, objects, and data. It is important to select the right information. To find out what your users need, you can either interview them or, even better – shadow their processes and activities. Users often forget to mention things that they think are obvious, but you will see everything they do if you sit with them and observe how they truly operate.

Make sure to document how your users interact with Salesforce and SAP – and which information they enter into which system. Where do they copy and paste information between systems today? Where would they benefit from real-time insights?

Data Replications or Real-Time?

In general, there are two types of integrations:

  1. Data Replication: Data is copied from SAP into Salesforce, either into a standard or a custom object. Typical use cases for this are:
    • SAP Business Partner to Salesforce Account
    • SAP Material to Salesforce Product
    • SAP List Prices to Salesforce Price Books
  2. Real-Time Access: Data is not stored within Salesforce but requested from SAP at the time it is required. Often this is the only reliable way to integrate, as (1) the data is time-critical and changes frequently, (2) the data volume is too high to copy it all, or (3) the business logic in SAP that is used to make sense of the data is too complex to recreate in Salesforce. Use cases for real-time integrations include price calculations in SAP and availability checks for materials.

Sometimes it can also make sense to create a hybrid scenario where parts of the data are replicated, and others are loaded in real-time. For example, we might need to replicate the equipment from SAP customer service into the asset in Salesforce but load the characteristics and measurement readings in real-time.

Be certain to document which types of integration scenarios you will use and why. As a best practice, try to build as much real-time access as possible, as it will make things easier in the long run.

Mapping the Data Models Between Salesforce and SAP

In documenting your integration, an important consideration is your field mapping.

  • For data replication, you will need to know which field from SAP should be stored on which field in Salesforce. You will need to ask questions like:
    • Are the field types and lengths identical, or do I need to convert the data?
    • In which direction do I want to replicate?
    • Is my replication only one way (SAP to Salesforce or Salesforce to SAP), or bi-directional?
  • For real-time access, you will need to define which information needs to be read from SAP and how it should be displayed to the user.

Remember, this must be documented – and we often use an Excel spreadsheet for this purpose. Here is what your map might look like:

Example of a field mapping in MS Excel

Filter

Not all data from SAP needs to be replicated or displayed in Salesforce. In fact, it is often quite the opposite – the less that is replicated and displayed, the more likely you’ll achieve higher performance and a more user-friendly UI.

Make sure to document how the data should be filtered. For example, do you only need accounts in Salesforce that are active in SAP, or also the inactive ones? Which SAP field holds this key information?

The SAP Side – Available APIs

For a successful project, you will need SAP know-how on your project team to determine the best way to integrate. SAP offers different types of APIs:

  • RFCs/BAPIs: BAPIs (Business Application Programming Interfaces) are called via RFCs (Remote Function Calls). RFC is a proprietary protocol implemented by SAP. Both SAP ECC and SAP S/4HANA offer tens of thousands of BAPIs for all relevant business processes to read and write data. To connect to a BAPI, one of the SAP connectors needs to be used – SAP JCo (Java Connector) or NCo (.Net Connector). It is also possible to read data from any SAP database table via RFC.
  • SOAP WebServices: SAP offers several web services built on the SOAP standard, but they cover only a small part of total SAP functionality.
  • OData: Based on the OData protocol, SAP built a new setup of web services that are more lightweight than BAPIs and SOAP. The OData support so far is not as complete as the one offered by the BAPIs, but this is SAP’s way forward in the future.

As a best practice, it is always desirable to integrate via a standard SAP API without writing code in the SAP system. The standard APIs have the advantage of taking the SAP configuration and customization into consideration. Writing your own APIs in SAP would also lead to a project on the SAP side – a potentially complex and time-consuming task. APIs need to fit into the release and update cycle of SAP, which could further delay your project.

Even without an implementation on the SAP side, deep SAP know-how is required in any integration project, including knowledge of business processes and available APIs.

Implementation of an Integration Using the Example of Vigience Overcast

Let’s use the following example to illustrate what an integration can look like – displaying the invoices of an account on the account’s detail page related lists. Because these invoices are stored in SAP, we will need to implement an integration.

Within SAP, we have millions of existing invoices and countless new ones created every day. Replicating them all would take a great deal of storage on the Salesforce side and a high load on the SAP system. Therefore, we would like to see invoices in real-time and only display them when required.

Vigience Overcast provides the ideal solution for this integration. In fact, Overcast already offers an out-of-the-box component for displaying invoices that we could easily install from the component library. But for this tutorial, let’s look at how we would create the same component from scratch.

Overcast Component that displays invoices of an account in real-time. 

Overcast is installed in your Salesforce org via the AppExchange as a managed package. The installation and configuration will not be covered in this article, but you can learn how by consulting Overcast Help.

Creating an Integration Scenario

As a first thing, let’s create an integration scenario that will point to one specific API of our backend system. In order to do so, follow these steps:

1. Open the app launcher and select “Overcast”.

2. Go to the Integration Scenarios tab and select “New.”

3. In the popup, select the type of scenario – “Data Synchronization” or “Real-Time”. In this case, we will go with a “Real-Time Integration”.

4. Next, you will need to select the connection that should be used to connect to SAP and provide the scenario with a unique name.

5. In the last step, we can define which BAPI or table in SAP we would like to access – in our case, it is table WB2_V_VBRK_VBRP2. As you can see, BAPI and table names are often cryptic in SAP, so an SAP expert is often required to support the team.
Field names can be similarly challenging, but Overcast allows you to specify exactly which fields from SAP should be used by the integration. You can select them from the same dialog.

6. Now, select the “Save & Activate” button. This will save the integration scenario and create all required APEX classes and structures in the background.

Finally, we have integrated our Salesforce org with SAP to get a list of invoices without writing one line of code or leaving Salesforce.

The Overcast Component Builder

The Overcast Component Builder enables an administrator to create the integration’s user interface in the form of a Lightning Component. The Component Builder offers different patterns to start with, such as widgets, list views, detail pages, and many more. It is a low-code tool that is fully meta-data driven, and that provides a preview of the user interface as we build it.

The following screenshot shows the Component Builder with the list of invoices:

Within the Component Builder, we can associate the integration’s input parameters with attributes of a related object. In our example, we associate the SAP field KUNRG (Payer) with the account custom field “Business Partner Number” on the Salesforce Account object, which ensures that only invoices of this account will be displayed.

Just like regular Lightning Components, Overcast Components can be embedded into page layouts with the Salesforce AppBuilder.

The final component looks like this:

Summary

Integrating Salesforce with other systems of record, like SAP, is becoming more and more important – especially for large enterprises looking to enable Salesforce users to realize the full potential of their customer-related information. Well-designed integrations mean users no longer need to switch between systems or enter data twice.

For integrations to succeed, it is essential to start by selecting the right tool and writing detailed specifications up front. SAP knowledge on your team can be crucial, especially for selecting the right APIs and analyzing all potential impacts of integration on your particular SAP system.

What are your experiences with integrating Salesforce with SAP? Let us know in the comments below!

The Author

Alexander Ilg

Alex is product manager at Vigience and principle consultant with more than 20 years experience in enterprise software, mainly Salesforce and SAP.

Leave a Reply