We've encountered situations where the sales department enters orders in SAP while the website lives its own life — stock levels don't match, prices are outdated, and customers complain about delays. Integrating a website with SAP is not just a technical task; it's the key to synchronizing business processes. In this article, we'll dive into the architecture, methods, and pitfalls that engineers face in such projects. We have accumulated experience from over 20 integrations and share best practices.
What problems do we solve?
Data desynchronization is the main pain point. Manual entry leads to errors: SAP holds accurate stock, prices, and order statuses, but the website uses an outdated copy. Performance suffers when every request to SAP via RFC or IDoc loads the productive system — the average SAP response delay is 200–500 ms, which is critical for user experience. Security is at risk if SAP networks are exposed to the internet without middleware — a protected layer with authorization and encryption is needed. A typical scenario: during order synchronization every minute via RFC, table locks occur in SAP, slowing down dispatchers by 30%.
Why not connect the site directly to SAP?
SAP systems are designed for operational tasks, not web traffic. Direct calls from PHP or Node.js via RFC (Remote Function Call) is an anti-pattern. First, SAP JCo (Java Connector) has no native support for PHP — an intermediate service in Java or Python is required. Second, each request from thousands of visitors can cause table locks in SAP. The recommended architecture is an asynchronous bus with queues.
Site (PHP/Node.js) ↕ Middleware (SAP BTP Integration / MuleSoft / custom service) ↕ SAP (via SAP PI/PO, OData, SOAP) How does SAP BTP simplify integration?
SAP Business Technology Platform (BTP) Integration Suite is a cloud ESB offering monitoring, retry logic, and data transformation. Instead of writing middleware from scratch, we use ready-made connectors for OData, SOAP, and IDoc. This reduces development time by 30–40% and lowers the number of errors in data transfer. For many projects, using BTP pays off in 6–12 months due to lower support costs.
Connection methods to SAP
| Method | Protocol | Performance | Complexity | Web Support |
|---|---|---|---|---|
| SAP OData | REST | High | Medium | Native (curl/fetch) |
| RFC | SAP RFC | Medium | High | Requires JCo/pyrfc |
| SOAP | HTTP | Low | High | Via SOAP clients |
| IDoc | XML/ALE | Asynchronous | Medium | Via middleware |
SAP OData is a modern standard. It is published via SAP Gateway, supports CRUD and filtering. In our experience, OData reduces integration development time by 25% compared to RFC. Example request:
GET https://sap-server/sap/opu/odata/sap/ZSD_ORDER_SRV/OrderSet? $filter=CustomerID eq '1234567' &$expand=OrderItems Authorization: Basic {credentials} SAP recommends using OData as the primary protocol for integration (documentation on SAP Help Portal).
RFC is still used for high-load operations but requires a separate adapter service. IDocs are indispensable for massive asynchronous exchanges (e.g., nightly material upload).
Example of retrieving materials via OData (Python)
import requests response = requests.get( 'https://sap-gw/sap/opu/odata/sap/ZMM_MATERIAL_SRV/MaterialSet', params={ '$filter': "Plant eq '1000' and MaterialType eq 'FERT'", '$select': 'MaterialNumber,Description,BaseUnit,StandardPrice', '$format': 'json' }, auth=(SAP_USER, SAP_PASSWORD), verify=True ) materials = response.json()['d']['results'] B2B portal with SAP integration
For corporate clients, a B2B portal based on SAP provides:
- Individual prices from SAP SD (pricing conditions for a specific buyer)
- Credit limit and current debt (SAP FI)
- Order history with repeat order capability
- Shipment status and documents (invoices, credit notes)
- Personal managers from SAP CRM
What is included in the work
- Audit of the current SAP system and identification of required modules (SD, MM, FI, CRM)
- Architecture design of middleware (SAP BTP, MuleSoft, or a custom Node.js service)
- Setup of OData services on the SAP side (SAP Gateway)
- Development of the integration layer on the website (REST clients, queues, caching)
- Testing of scenarios: synchronization of orders, stock, prices
- Documentation and administrator training
Typical mistakes in SAP integration
Common issues and how to avoid them
- **N+1 query to SAP**: each order fetches stock separately. Solution — batch loading via $batch in OData. - **Race condition during synchronization**: multiple users update the same order simultaneously. Solution — optimistic locking with ETag. - **Lack of caching**: every page render triggers SAP. Solution — local Redis cache with TTL of 30 seconds.Timelines and economic impact
Development time for a serious B2B integration with multiple modules is 3 to 6 months. Cost is calculated individually after an audit. Customers report a 30–50% reduction in manual synchronization costs and a 40% decrease in order processing time. Return on investment typically occurs in 6–12 months.
Why choose us
5+ years of experience integrating SAP with web applications. Over 20 successful projects for large enterprises. Certified specialists in SAP and web development. Get a consultation on integrating SAP with your website — contact us. Order an audit of your current system and find out how to save up to 50% on synchronization time.







