In today’s fast-paced digital world, businesses require different software systems to improve productivity, customer experience, and data accuracy. Two of the most widely used enterprise solutions — SAP and Salesforce — help companies drive operational efficiency and customer satisfaction. Salesforce SAP Integration can transform how businesses manage their processes by streamlining data flow, enhancing customer interactions, and optimizing decision-making.
Why Integrate SAP and Salesforce?
Integrating SAP and Salesforce allows businesses to foster a more collaborative environment. The integration aligns sales, marketing, and customer support teams with back-office functions, ensuring a unified approach to decision-making, customer service, and inventory management.
Business use cases for SAP-Salesforce Integration
Case 1: Order Lifecycle Through Salesforce — SAP Integration
- Order Creation: The order lifecycle begins when a new sales order is created in Salesforce. Salesforce sends the sales order details (like product, quantity, price, and customer info) to SAP for order fulfillment and inventory processing.
- Order Transfer to SAP for Processing: Once the order is created in Salesforce, it is integrated with SAP for further processing. SAP will create a sales order based on the data sent from Salesforce, allowing the backend systems to manage inventory, check stock levels, and review financials for order fulfillment. The SAP system validates the order and provides a prompt on whether the order can be processed or if further approvals are needed.
- Order Response updates to Salesforce: Once the order is validated, a response is sent back to Salesforce with the order status and other relevant shipping details. If the order is rejected in SAP, an order response will be sent to Salesforce with the status and rejection reason.
- Invoicing and Payment Processing: After the products are shipped, SAP generates an invoice for the order, which includes all details related to pricing, discounts, taxes, and shipping charges. The integration syncs the payment status from SAP back to Salesforce. If a payment is received, the order status in Salesforce is updated, providing sales reps and customer service teams with real-time insights into the payment status.
Case 2: Customer Master Integration Lifecycle through Salesforce-SAP
- Customer Data Creation in Salesforce: When a customer makes a purchase or establishes a formal relationship, Salesforce creates a customer record. Information such as customer name, contact details, address, and business segments is captured.
- Customer Data Transfer from Salesforce to SAP: The integration platform facilitates the transfer of customer master data from Salesforce to SAP. Customer information from Salesforce is mapped to the corresponding fields in SAP.
- Customer Data Creation in SAP: Upon receiving the customer data from Salesforce, SAP Customer Master records are created or updated in SAP. SAP checks for duplicates, ensuring that new customers are added to the system.
- Synchronization of Changes Across Both Systems: Once the customer master record is created in SAP, the integration ensures that changes in Salesforce or SAP are synchronized regularly. Any updates made to the customer data in Salesforce (e.g., address changes, contact updates, or new accounts) are reflected in SAP. Similarly, updates to customer master data in SAP (e.g., credit limits or payment terms) are synchronized with Salesforce.
How to Integrate Salesforce and SAP with SAP Cloud Integration
SAP Cloud Integration is a cloud-based middleware solution that provides advanced data transformation capabilities to develop custom integrations and a wide range of connectivity options with its pre-built connectors. Before going into the integration design, let’s understand the Salesforce API and connectivity options for Salesforce integration.
Salesforce API
Salesforce provides a variety of APIs, each tailored for specific integration scenarios. Here are the most commonly used APIs in Salesforce:
- Rest API: The REST API enables developers to interact with Salesforce data in a lightweight and efficient way using standard HTTP methods (GET, POST, PUT, DELETE).
- Bulk API: Salesforce Bulk API is based on REST principles and are optimized for working with large sets of data (More than 2000 records). It can be used to insert, update, upsert, or delete many records asynchronously.
- SOAP API: The Salesforce SOAP API is a web service that enables you to interact programmatically with Salesforce’s core functionality following the XML-based messaging protocol for exchanging structured information between systems.
- SOQL Query: Salesforce Object Query Language (SOQL) is a language to query salesforce data. It can be used in both SOAP and REST API calls using the “queryString” parameter and “q” parameter respectively. Syntax: SELECT Field1, Field2 FROM Object Name WHERE FIELD1 = ‘STRING’
- Composite and Composite Graph Request: Composite request executes a series of REST API requests in a single call. It can send up to 25 subrequests in a single call and up to 5 of them can be query operations. Composite Graph operation can send up to 20 composite requests in a single call, which makes a total of 500 requests in a single call considering each composite request send 25 subrequests.
Structure of a Composite Request:

- allOrNone: It is a Boolean value used for transactional handling while sending a request. If set to true, the entire request is rolled out when an error occurs.
- collateSubrequests: A Boolean value, if set to true, the subrequests are collated results in an increase in processing speed, but the order of execution is random. If it is disabled, the subrequests are executed in order in which they are received.
- Method: HTTP request method is specified here, it can be GET, POST, PUT, PATCH, and DELETE.
- URL: Path to request the resource. example : /services/data/{API Version}/{Object Name}/{Object Id}.
- httpHeaders: Request headers and values to include in subrequests.
- referenceId: A unique ID to identify a subrequest response, can be referred in subsequent subrequests.
- body: The fields sent in the subrequest.
6. sObject Collections: sObject Collections can execute actions on 200 records in a single call. It can contain objects of different types.
Structure of sObjectCollection:

- allOrNone: Similar to the composite request, it is a Boolean value used for transactional handling.
- type attribute: Object name on which action has to be executed.
Salesforce Adapter for SAP Cloud Integration
Two Salesforce adapters are available for SAP Cloud Integration: Advantco and Rojo. Both of these adapters offer distinct features and capabilities. Let’s explore the key differences between the Advantco and Rojo adapters, along with a technical overview of each, to better understand their functionality and the advantages they provide within SAP Cloud Integration.
1. API Support
- Advantco: SOAP, REST, REST API Composite, BULK API, Streaming API, REST API Reports and Dashboard, APEX REST Web Service, OBM (Neo), APEX SOAP Web Service (Neo).
- Rojo: REST, REST API Composite, BULK API, Streaming API, APEX REST Web Service
2. Update Trigger:
The Update Trigger is a mechanism used to update the flag value in Salesforce after successfully polling data. This feature can be customized to meet specific integration requirements.
How it works:
- Data Polling: During each integration cycle, records are fetched from Salesforce based on a set condition, often selecting records where a specific field (flag) is set to ‘false’ or remains in an unprocessed state.
- Flag Update: Once the records are successfully processed, the designated flag field is updated to ‘true’, indicating that the record has been successfully handled.
- Preventing Duplicates: In subsequent runs, the integration fetches only those records where the flag value is still ‘false’. This ensures that only unprocessed records are selected, effectively preventing the re-fetching of already processed data.
Advantco salesforce adapter provides a configuration option in the adapter to enable update trigger and update the particular flag field to a specific value, while in Rojo Salesforce adapter, this process has to be handled manually.
Conditional update to Salesforce:
In Advantco Salesforce adapter, conditional update can be handled automatically by using Update Multiple Objects Operation Schema as explained below.

- Operation: It defines the request method, example: update or upsert.
- ObjectType: It defines the object name to be updated.
- ExternalID: It defines the field name to be used as an External Id in Salesforce system.
- Condition: It defines a set of criteria based on which a record is updated in Salesforce. It is similar to an SOQL “GET” request, if the request is successful, the records are updated at Salesforce.
- TransactionLevel: It is used to define the transactional handling. If set to “REQUIRED”, the entire transaction will fail if a single record is failed.
- SObjects: Contains the fields and value to be updated at Salesforce.
In Rojo Salesforce adapter, conditional update has to be handled manually. It can be done using a composite request with a limitation of five conditions per call as per the API limitation.
SAP has officially ended support for the Advantco Salesforce adapter and transitioned to the Rojo OEM Salesforce adapter, see SAP notes 3032149.
In the second part of this blog, we will talk about the integration design for both outbound and inbound scenarios, covering key aspects such as manual update triggers and conditional updates. Stay tuned for a detailed guide on successfully implementing these processes in your migration to the Rojo OEM Salesforce adapter.