Salesforce and SAP S/4HANA are two important platforms in modern enterprise IT environments.

Salesforce helps companies manage customer relationships, sales opportunities, and customer interactions. SAP S/4HANA supports core business operations such as finance, procurement, inventory, and order management.

Both platforms provide significant value independently. But when sales and operational information remain disconnected, companies often face duplicated data, manual processes, and inconsistent information.

Abstract blue network of connected points and lines representing data connections.
Photo: Conny Schneider / Unsplash

Imagine a sales representative working in Salesforce who needs to confirm a customer’s current credit status, product availability, or order history.

That information may already exist in SAP. But without integration, the employee might need to contact another department or manually retrieve the data.

SAP and Salesforce integration connects CRM and ERP processes, allowing business information to move reliably between the two platforms.

However, a successful integration requires more than connecting two APIs.

Companies must decide how data is synchronized, which system owns each piece of information, how failures are handled, and how the entire integration is monitored.

In this guide, we’ll explore the architecture, technologies, and best practices involved in building reliable SAP–Salesforce integrations.

Why integrate SAP and Salesforce?

SAP and Salesforce typically serve different business responsibilities.

Salesforce focuses on customer-facing activities, while SAP S/4HANA manages many of the operational and financial processes behind those activities.

Integrating these platforms helps connect sales activities with business operations.

A typical business scenario

Consider a manufacturing company using:

  • Salesforce Sales Cloud for customer relationships and sales opportunities.
  • SAP S/4HANA for customer master data, products, pricing, orders, inventory, and invoicing.

Without integration, employees may need to transfer information between systems manually.

A salesperson creates a customer in Salesforce. Someone else creates the corresponding business partner in SAP.

When an order is confirmed, information must be transferred again.

Later, the sales team might need to contact finance or logistics to check the order status.

With a well-designed integration, these processes can become more coordinated.

For example:

  1. Customer information is synchronized between SAP and Salesforce.
  2. Relevant product and pricing information becomes available to sales teams.
  3. Approved orders are transferred to SAP for processing.
  4. Order status changes are communicated back to Salesforce.
  5. Sales representatives can access relevant operational information without switching applications.

The exact data flows depend on the company’s business processes and system configuration.

The objective isn’t to duplicate everything between SAP and Salesforce. It’s to make the right information available where it’s needed.

What data should be synchronized?

One of the first decisions in an SAP–Salesforce integration project is determining which business objects need to be exchanged.

Typical integration scenarios include:

Scroll sideways if any columns are cut off.

Business object Typical integration purpose
Customers / Business Partners Maintain consistent customer information
Contacts Synchronize relevant contact details
Products Make product information available to sales
Pricing Provide pricing information or pricing calculations
Sales Orders Transfer approved orders for fulfillment
Order Status Inform sales teams about processing and delivery
Invoices Provide visibility into billing information
Payment Status Show relevant financial status information
Inventory Provide product availability information

Not every company needs all these integrations.

For example, one organization may maintain customer master data primarily in SAP, while another allows Salesforce to initiate customer creation.

These decisions have a major impact on the integration architecture.

Define the source of truth

Before synchronizing data, determine which system is authoritative for each business object or field.

For example:

  • SAP may own customer billing information.
  • Salesforce may own sales-related customer classifications.
  • SAP may own product master data.
  • Salesforce may own sales opportunities.
  • SAP may own financial and fulfillment status.

Ownership can also be defined at field level rather than for an entire object.

A clear ownership model prevents situations where both systems continuously overwrite each other’s information.

For bidirectional synchronization, explicit conflict-resolution rules are especially important.

SAP and Salesforce integration architecture

There are several ways to connect SAP and Salesforce.

The most appropriate architecture depends on the number of integrations, the complexity of business processes, data volumes, security requirements, and existing technology landscape.

Option 1: direct API integration

The simplest approach is to connect the systems directly through their supported APIs.

For example, an application might retrieve business partner information from SAP through an OData API and update a Salesforce Account through the Salesforce REST API.

This approach can work well when:

  • Only a small number of integrations are required.
  • Business logic is relatively straightforward.
  • The systems provide suitable APIs.
  • Operational requirements are manageable.

However, direct integrations can become difficult to maintain as the number of connections increases.

Each connection may require its own authentication, data mapping, retry logic, and monitoring.

When multiple applications need the same information, these responsibilities can become duplicated.

Option 2: middleware-based integration

A middleware platform introduces an integration layer between SAP and Salesforce.

Instead of requiring each application to communicate directly, the integration layer coordinates data exchange and business logic.

For example:

SAP S/4HANA → Integration Platform → Salesforce

The integration layer can handle:

  • Communication with SAP and Salesforce.
  • Data transformation and validation.
  • Business process orchestration.
  • Authentication and security.
  • Error handling and retries.
  • Logging and monitoring.
  • API management.

Platforms such as MuleSoft Anypoint Platform and SAP Integration Suite can support this architecture.

Middleware can be especially useful when an organization has multiple enterprise applications and wants consistent integration standards.

However, introducing middleware also creates infrastructure, licensing, and operational responsibilities.

The right architecture should match the actual business requirements.

Comparing MuleSoft, SAP Integration Suite, and custom APIs

  • MuleSoft Anypoint Platform fits teams that already operate Anypoint or need reusable APIs across SAP, Salesforce, and other systems. Factor in licensing, runtime operations, and the skills needed to maintain mappings, policies, and connectors. See the MuleSoft integration platform comparison for more on where those capabilities matter.
  • SAP Integration Suite fits SAP-centered teams that already build and monitor integration flows in SAP Cloud Integration. Check whether the package or adapter covers the Salesforce objects and operations you need, and confirm plan availability. The team still owns the mappings, failure recovery, and monitoring across both platforms.
  • Custom API integration fits a few well-defined flows when both systems provide suitable interfaces and your team can run a small integration service. It gives you control over deployment and behavior, with your team responsible for authentication, API changes, queues, retries, and operational tooling. Include those responsibilities when estimating API integration costs.

Compare the options using one representative flow. Confirm which connector and API versions it needs, what it takes to recover failed records, and who will operate it after launch. See Thinkronic’s Integration, Automation & AI service for help assessing those choices.

Using MuleSoft for SAP and Salesforce integration

MuleSoft is one option for implementing enterprise integration architectures.

Its Anypoint Platform provides tools for building, managing, securing, and monitoring APIs and integrations.

For SAP–Salesforce projects, MuleSoft can act as the integration layer that coordinates communication between the two platforms.

API-led connectivity

MuleSoft promotes an architectural approach called API-led connectivity.

This separates integrations into reusable layers with different responsibilities.

System APIs

System APIs provide controlled access to underlying applications.

For example:

  • SAP System API
  • Salesforce System API

A SAP System API might expose operations for retrieving business partners, products, or orders.

A Salesforce System API might expose operations for querying or updating Accounts and other CRM objects.

The goal is to encapsulate application-specific details behind reusable interfaces.

Process APIs

Process APIs coordinate business logic across systems.

For example, a Customer Synchronization Process API might:

  1. Receive customer information from SAP.
  2. Validate the required fields.
  3. Transform the SAP data model into the Salesforce model.
  4. Determine whether a Salesforce record should be created or updated.
  5. Execute the operation.
  6. Record the synchronization result.

The Process API handles the business integration logic rather than exposing the technical details of each system.

Experience APIs

Experience APIs provide interfaces tailored to specific consumers.

For example, a customer portal or internal dashboard might need a simplified view of order information from several systems.

Not every SAP–Salesforce integration requires an Experience API.

The architecture should remain proportional to the project’s complexity.

SAP connectivity

Start by identifying the SAP product, release, deployment model, and business object. The available interfaces differ across SAP products.

  • SAP ECC: An older ERP deployment may already exchange documents through IDocs or expose business operations through RFC-enabled BAPIs. Verify the supported interface, any custom fields or enhancements, and how the integration runtime can reach ECC. For older deployments with limited interfaces, see the legacy system integration guide.
  • SAP S/4HANA: In Cloud Public Edition, check the released APIs and business events for the specific object and release. For APIs that require a communication arrangement, confirm the matching communication scenario. Private Edition and on-premises deployments may also support existing IDoc or RFC/BAPI integrations where applicable.
  • SAP Business ByDesign: Check the cloud tenant’s communication scenarios and the operations they expose. For example, a published SOAP service may cover sales order exchange. Confirm the specific service, fields, and permissions before reusing a design intended for ECC or S/4HANA.

MuleSoft’s SAP connector supports certain RFC/BAPI and IDoc scenarios for compatible SAP systems. HTTP-based SAP APIs use HTTP connectivity. Verify the interface and connector requirements together before estimating the work.

Salesforce connectivity

Salesforce provides several APIs for integration.

Common options include:

  • REST API for standard record operations.
  • SOAP API for supported SOAP-based operations.
  • Bulk API 2.0 for large data operations.
  • Pub/Sub API for supported event subscriptions and publishing.
  • Change Data Capture for receiving notifications about Salesforce record changes.

MuleSoft’s Salesforce connector supports several Salesforce API families and provides operations for interacting with Salesforce data.

Choosing the correct API depends on the workload.

For example, a large initial customer import may benefit from Bulk API 2.0, while smaller incremental updates may use regular record operations.

Illustrative SAP S/4HANA and Salesforce architecture

Consider a hypothetical manufacturer that uses SAP S/4HANA as the source for billing details and pricing, and Salesforce for opportunities and sales activity. MuleSoft handles the integration between them. This example assumes the required SAP APIs are available in the manufacturer’s edition and release.

  1. Initial bulk synchronization. MuleSoft extracts business partners from SAP, validates required fields, and maps identifiers, addresses, and country codes to Salesforce Accounts. It loads the records using Salesforce Bulk API 2.0, checks row-level results, and reconciles the totals. Capture a cutover checkpoint and process changes made during the load before switching to steady-state synchronization.
  2. Incremental updates. A supported SAP business event or scheduled change query feeds a durable queue. MuleSoft processes changes independently of Salesforce users and upserts Accounts using a unique SAP external ID. Reprocessing an update keeps the same Account, and a source version check prevents a delayed update from overwriting newer data.
  3. Synchronous pricing. When a sales rep requests a quote price, Salesforce sends customer, product, quantity, and currency to a MuleSoft endpoint. MuleSoft maps the request to a supported SAP pricing or sales order simulation operation and returns the calculated price. If SAP exceeds the timeout, Salesforce shows that pricing is temporarily unavailable and the rep can retry.

For queued updates, retry transient failures with backoff and a limit on attempts. Send validation failures and exhausted retries to a review queue for correction and safe replay. Use correlation IDs to trace requests, and alert operators on queue age, repeated failures, and missed reconciliations. Track pricing latency separately because sales reps are waiting for that response.

Initial data load vs. incremental synchronization

A particularly important architectural decision is how to handle the initial synchronization and subsequent updates.

These are related but different operations.

Initial data load

Imagine a company has 250,000 customer records in SAP.

Salesforce is being introduced, and the company wants to make relevant customer information available in the CRM.

The initial data load transfers the existing records from SAP to Salesforce.

A typical process might involve:

  1. Extracting the required customer records from SAP.
  2. Validating the source data.
  3. Transforming fields into the Salesforce data model.
  4. Matching existing records where necessary.
  5. Loading records into Salesforce.
  6. Recording successful and failed operations.
  7. Reconciling the results.

For large datasets, Salesforce Bulk API 2.0 may be appropriate.

The initial load should also account for API limits, record relationships, validation rules, and existing Salesforce automation.

An initial load should be designed as a controlled, repeatable process rather than a one-time script with no recovery mechanism.

Incremental synchronization

Once the initial load is complete, the integration needs to process new and modified records.

Reimporting every customer each time would often be inefficient.

Instead, incremental synchronization processes only the relevant changes since a previous synchronization point.

For example:

  • Monday: 250,000 customers are initially synchronized.
  • Tuesday: 120 customers are created and 300 are updated.
  • The integration processes those 420 changed records rather than retrieving all 250,000 again.

There are different ways to identify changes.

Timestamp-based synchronization

One approach is to query SAP for records modified after a particular timestamp.

For example:

LastChangedAt > lastSuccessfulSynchronization

The integration retrieves changed records and updates Salesforce.

In practice, a reliable implementation should account for timestamp precision, overlapping query windows, pagination, and records changing while extraction is running.

A synchronization checkpoint should advance only after the relevant data has been processed durably.

Event-driven synchronization

Another approach is to react to events generated when business data changes.

For example, an SAP business event may indicate that a business partner has changed.

An integration can receive the event and retrieve the latest relevant data through a supported API.

This can reduce the delay between a business change and its availability in Salesforce.

However, event availability and payload details depend on the SAP product, edition, and configuration.

Which approach is better?

Scroll sideways if any columns are cut off.

Criteria Scheduled incremental sync Event-driven sync
Data freshness Depends on schedule Potentially near real time
Implementation Often simpler Requires event infrastructure
Change detection Queries or change tracking Published events
Recovery Reprocess time windows Replay, recovery, or reconciliation
Best suited for Periodic updates Time-sensitive business changes

A hybrid approach is often appropriate.

For example, events may trigger timely updates, while a scheduled reconciliation process checks for missed or inconsistent records.

This helps reduce the risk of permanently missing data because of an event-processing failure.

Preventing duplicate records with upsert

When synchronizing customer data, the integration must distinguish between creating a new record and updating an existing one.

One useful technique is upsert, which combines insert and update behavior.

Suppose SAP identifies a customer using the business partner number 100045.

Salesforce stores that SAP identifier in a dedicated External ID field.

When the integration receives the customer:

  • If a matching Salesforce record exists, it updates the record.
  • If no matching record exists, it creates one.

This avoids relying solely on customer names or email addresses to identify records.

For example:

Scroll sideways if any columns are cut off.

SAP field Salesforce field
BusinessPartner SAP_BusinessPartner_ID__c
OrganizationName Name
StreetName BillingStreet
CityName BillingCity
PostalCode BillingPostalCode
Country BillingCountry

Illustrative mapping only. Actual fields and mappings depend on the SAP API, Salesforce data model, and business requirements.

External identifiers also help make repeated processing safer.

However, upsert alone does not solve every duplication problem. Unique identifier configuration, record ownership, concurrency, and data-quality rules still matter.

Handling errors and retries

Enterprise integrations must be designed for failure.

Even when both systems are correctly configured, temporary problems can occur.

For example:

  • An API becomes temporarily unavailable.
  • A request exceeds a timeout.
  • A rate limit is reached.
  • A network connection fails.
  • A record violates a business validation rule.

Not every failure should be handled in the same way.

Transient errors

Transient errors are temporary failures that may disappear without changing the underlying business data.

Examples include temporary network interruptions, service unavailability, and certain rate-limit responses.

For these failures, automated retries may be appropriate.

A retry strategy should define:

  • Which errors are retryable.
  • Maximum retry attempts.
  • Delay between attempts.
  • Exponential backoff where appropriate.
  • How to avoid duplicate processing.
  • What happens after all attempts fail.

For asynchronous integrations, a message queue can help decouple the source system from the destination.

For example:

SAP → Integration Layer → Message Queue → Salesforce

If Salesforce is temporarily unavailable, messages can remain queued until processing resumes, subject to the configured delivery and retention guarantees.

Business validation errors

Other failures require data correction.

For example:

  • A required field is missing.
  • A country code is invalid.
  • A referenced parent record doesn’t exist.
  • A business rule rejects the update.

Retrying these errors repeatedly without changing the data usually won’t help.

Instead, the integration should record the failure and make it available for investigation.

After the underlying issue is corrected, the record can be reprocessed.

Idempotency

Retries introduce another important requirement: idempotency.

An operation is idempotent when repeating it has the same intended effect as processing it once.

For example, a retry should not create duplicate customers or duplicate orders.

External identifiers, deduplication keys, and appropriate transaction design can help.

For operations that create business transactions, idempotency often requires more than simply checking whether a record exists.

Monitoring and operational visibility

A technically successful API request doesn’t necessarily mean the complete business process succeeded.

For example, an integration may successfully retrieve customer information from SAP but fail when updating Salesforce.

Without appropriate monitoring, the business may not know that the systems are inconsistent.

A reliable integration should provide visibility into synchronization status.

What should be monitored?

Useful information includes:

  • Number of records processed.
  • Successful and failed synchronizations.
  • Last successful synchronization time.
  • Processing delays.
  • Retry attempts.
  • Error categories.
  • Affected business object identifiers.
  • Source and destination systems.

Correlation IDs

A correlation ID is a unique identifier used to trace a transaction across multiple services.

For example, a customer synchronization might pass through:

  1. SAP System API.
  2. Customer Process API.
  3. Salesforce System API.

The same correlation ID can help operators follow the complete transaction.

This makes troubleshooting much easier than examining unrelated application logs.

Business monitoring dashboard

For business-critical integrations, a monitoring dashboard can provide useful operational visibility.

For example:

Scroll sideways if any columns are cut off.

Metric Example value
Customers processed today 1,240
Successful synchronizations 1,232
Failed synchronizations 8
Pending retries 5
Records requiring manual review 3

Illustrative dashboard data.

Business users could inspect failed records, identify the reason for a failure, and request reprocessing when authorized.

This doesn’t necessarily mean storing integration monitoring data inside Salesforce.

Depending on the architecture, monitoring information may live in the integration platform, an operational database, a logging system, or a dedicated monitoring application.

The right choice depends on accessibility, data protection, retention, and operational requirements.

Security considerations

SAP–Salesforce integrations often process sensitive customer, commercial, and financial information.

Security must be considered from the beginning.

Authentication and authorization

Use supported authentication mechanisms and dedicated technical identities where appropriate.

Access should follow the principle of least privilege.

An integration that only needs to read product information should not receive unrestricted access to financial records.

Encryption

Data should be protected in transit using appropriate secure communication protocols.

Sensitive credentials should be stored in a secrets-management solution rather than embedded in application code.

Data protection

When processing personal data, organizations must consider applicable privacy requirements, including the GDPR where relevant.

Integration logs should not unnecessarily expose personal information or credentials.

Auditing

For important business operations, organizations may need to track when data was synchronized, which systems were involved, and whether an operation succeeded.

Audit requirements should be defined according to business and regulatory needs.

Common SAP–Salesforce integration mistakes

Several recurring architectural mistakes can make enterprise integrations difficult to operate.

1. Synchronizing everything

Not every SAP field needs to exist in Salesforce.

Copying unnecessary data increases complexity and may create additional security and maintenance requirements.

Start with the information required by the business process.

2. Ignoring data ownership

If both systems can update the same fields without clear rules, synchronization conflicts can occur.

Define authoritative systems and field-level ownership before implementation.

3. Using only synchronous communication

Synchronous APIs are useful when an immediate response is necessary.

However, using synchronous calls for every operation can create unnecessary dependencies between systems.

Asynchronous processing may be more suitable for high-volume or noninteractive workloads.

4. Treating retries as a complete error strategy

Retries are useful for temporary failures.

They don’t solve invalid data, missing dependencies, or incorrect business mappings.

Integrations need structured error classification and recovery procedures.

5. Ignoring initial load complexity

An initial load can involve large data volumes, existing records, relationships, and validation constraints.

It should be planned, tested, and reconciled carefully.

6. Building without monitoring

A system that silently loses updates is difficult to trust.

Monitoring and operational recovery should be part of the architecture from the beginning.

7. Overengineering the architecture

Not every integration requires multiple API layers, message brokers, and complex orchestration.

The architecture should match the actual business requirements.

A practical SAP–Salesforce integration roadmap

A successful integration project benefits from a structured approach.

Step 1: understand the business processes

Identify which business activities require data exchange.

For example:

  • Customer creation.
  • Product synchronization.
  • Order submission.
  • Invoice status visibility.

Define the business outcome for each integration.

Step 2: analyze the existing systems

Review the SAP deployment, available APIs, Salesforce configuration, existing integrations, security constraints, and operational requirements.

SAP S/4HANA Public Cloud, Private Cloud, and on-premises environments can have different integration capabilities and constraints.

Step 3: define data ownership and mapping

Document the source of truth for each field.

Define external identifiers, transformation rules, required fields, and conflict-resolution behavior.

Step 4: design the integration architecture

Choose between direct APIs, middleware, event-driven communication, scheduled synchronization, or a combination.

Consider scalability, reliability, maintenance, and licensing costs.

Step 5: plan the initial load

Determine how existing records will be extracted, validated, loaded, and reconciled.

Establish how changes occurring during the initial load will be captured so they aren’t lost.

Step 6: implement incremental synchronization

Introduce the appropriate change-detection mechanism.

This might involve scheduled queries, supported business events, or a hybrid approach.

Step 7: implement error handling and monitoring

Define retry policies, failed-record handling, logging, alerts, and operational recovery procedures.

Step 8: test with realistic scenarios

Test more than successful data transfers.

Include:

  • Missing required fields.
  • Duplicate records.
  • Unavailable destination systems.
  • API timeouts.
  • Large data volumes.
  • Conflicting updates.
  • Repeated events.
  • Partial processing failures.

Step 9: deploy and monitor

Deploy through a controlled release process.

Monitor synchronization results and reconcile critical data during the initial operating period.

Step 10: improve continuously

As business requirements change, review the integration architecture, mappings, monitoring, and operational processes.

Enterprise integration is an ongoing capability, not merely a one-time connection between applications.

Implementation checklist

Before launch, confirm that your team can point to:

  • Ownership and mapping: A field-level system-of-record matrix, external IDs, transformation rules, and a policy for conflicts and deletions.
  • API contracts and security: Documented versions, fields, errors, limits, and timeouts, plus approved service identities, least-privilege permissions, and credential rotation.
  • Synchronization: A tested initial load, a checkpoint for changes during cutover, and a reconciliation process for ongoing updates.
  • Failure recovery: Named owners for alerts and failed records, a retry policy, and a replay procedure tested against duplicates and out-of-order updates.
  • Testing: Evidence from sandbox tests for mappings, authentication, representative volumes, timeouts, partial failures, and recovery after an outage.

Frequently asked questions

Can SAP S/4HANA integrate directly with Salesforce?

Yes. Direct integration is possible when suitable interfaces and connectivity are available.

However, middleware may be beneficial for complex transformations, multiple integrations, monitoring, or centralized governance.

Is MuleSoft required to integrate SAP and Salesforce?

No.

MuleSoft is one possible integration platform. Alternatives include SAP Integration Suite, custom integration services, and other middleware solutions.

The best choice depends on existing infrastructure, requirements, technical expertise, and budget.

Can SAP and Salesforce synchronize data in real time?

Near-real-time synchronization is possible using suitable APIs and event-driven mechanisms.

However, event availability, processing delays, system constraints, and consistency requirements must be considered.

Not every integration requires immediate synchronization.

What is the difference between initial load and incremental synchronization?

An initial load transfers an existing dataset, often during the introduction of a new system.

Incremental synchronization processes subsequent changes, avoiding the need to reload the entire dataset repeatedly.

How can duplicate customer records be prevented?

A common approach is to use stable external identifiers and upsert operations.

However, duplicate prevention also requires appropriate data-quality rules, uniqueness constraints, and consistent record matching.

What happens when Salesforce is unavailable?

A well-designed integration can detect the failure, classify it, and retry suitable operations.

For asynchronous workloads, durable messaging may allow processing to resume later.

Failures requiring manual correction should be visible through monitoring and recovery procedures.

How long does an SAP–Salesforce integration project take?

The duration depends on the number of business objects, complexity of data mappings, available interfaces, existing data quality, testing requirements, and operational constraints.

A simple integration may require relatively limited effort, while a multi-object enterprise integration can become a substantial project.

A technical discovery phase is usually necessary before providing a reliable estimate.

Conclusion: reliable integration requires more than connectivity

Connecting SAP and Salesforce can improve how sales, finance, logistics, and operations work together.

But successful integration isn’t simply about transferring records between two applications.

It requires clear data ownership, appropriate architecture, reliable synchronization, structured error handling, and operational visibility.

Whether a company chooses direct APIs, MuleSoft, SAP Integration Suite, or another approach, the same fundamental principles apply.

The goal is to create reliable business processes supported by connected systems—not merely to make two applications exchange data.

Organizations that invest in a well-designed integration foundation are better positioned to improve existing workflows, introduce new applications, and support future automation initiatives.

Planning an SAP–Salesforce integration?

Let’s discuss your requirements and identify an architecture that fits your business.

Let’s talk

Technical references

The following official resources provide additional information about the technologies and integration approaches discussed: