---
# === IDENTITY ===
id: business/erp-integration/sap-ecc-vs-s4hana-integration/2026
canonical_question: "How do SAP ECC and S/4HANA integration capabilities differ - APIs, middleware, cloud readiness, ECC EOL?"
aliases:
  - "SAP ECC vs S/4HANA API comparison"
  - "SAP ECC BAPI RFC vs S/4HANA OData integration"
  - "SAP S/4HANA migration integration impact"
  - "SAP ECC end of life integration planning"
entity_type: erp_integration
domain: business > erp-integration > SAP ECC vs S/4HANA Integration
region: global
jurisdiction: global
temporal_scope: 2025-2030

# === SYSTEM PROFILE ===
systems:
  - name: "SAP ECC 6.0"
    vendor: "SAP"
    version: "EHP 0-8"
    edition: "All editions"
    deployment: "on-premise"
    api_surface: "RFC, BAPI, IDoc, SOAP"
  - name: "SAP S/4HANA"
    vendor: "SAP"
    version: "2023/2024/2025"
    edition: "Cloud, On-Premise, Private Cloud"
    deployment: "hybrid"
    api_surface: "OData, REST, SOAP, RFC (legacy), Events"

# === VERIFICATION ===
last_verified: 2026-03-02
confidence: 0.88
version: 1.0
first_published: 2026-03-02

# === TEMPORAL VALIDITY ===
temporal_validity:
  status: volatile
  last_breaking_change: "2027-12-31 ECC mainstream support ends"
  next_review: 2026-08-29
  change_sensitivity: high

# === CONSTRAINTS ===
constraints:
  - "SAP ECC mainstream support ends 2027-12-31 (EHP 6-8); EHP 0-5 ended 2025-12-31"
  - "S/4HANA Cloud only supports OData, SOAP, and REST — no IDoc, RFC, or BAPI natively"
  - "SAP recommends max 10 concurrent OData requests per client to prevent server overload"
  - "IDoc count reduced in S/4HANA; several IDoc structures changed due to simplified data model"
  - "Some ECC BAPIs are blacklisted in S/4HANA — check Simplification List before migration"
  - "Extended maintenance for ECC available until 2030 at ~2% additional cost on top of standard maintenance"
  - "PI/PO is maintenance-only; SAP Integration Suite (CPI) is the strategic middleware for S/4HANA"

# === SKIP CONDITIONS ===
skip_this_unit_if:
  - condition: "User needs Salesforce-to-SAP integration specifics"
    use_instead: "business/erp-integration/salesforce-sap-integration-playbook/2026"
  - condition: "User needs SAP S/4HANA Cloud API rate limits only"
    use_instead: "business/erp-integration/sap-s4hana-cloud-api/2026"
  - condition: "User needs SAP BTP Integration Suite setup guide"
    use_instead: "business/erp-integration/sap-btp-integration-suite/2026"

# === AGENT HINTS ===
inputs_needed:
  - key: integration_pattern
    question: "What integration pattern do you need?"
    type: choice
    options:
      - "real-time sync (individual records, <1s latency)"
      - "batch/bulk (scheduled, high volume)"
      - "event-driven (webhook, CDC, platform events)"
      - "file-based (CSV/XML import/export via IDoc)"
  - key: current_system
    question: "Which SAP system are you currently on?"
    type: choice
    options:
      - "SAP ECC 6.0 (planning migration)"
      - "SAP S/4HANA On-Premise"
      - "SAP S/4HANA Cloud"
      - "Hybrid (ECC + S/4HANA coexistence)"
  - key: direction
    question: "What's the data flow direction?"
    type: choice
    options:
      - "inbound (writing to SAP)"
      - "outbound (reading from SAP)"
      - "bidirectional sync"

# === DISTRIBUTION ===
canonical_source: "https://knowledgelib.io/business/erp-integration/sap-ecc-vs-s4hana-integration/2026"
suggested_citation: "Source: knowledgelib.io — AI Knowledge Library (verified 2026-03-02)"

# === RELATED UNITS ===
related_kos:
  depends_on: []
  related_to:
    - id: "business/erp-integration/sap-s4hana-cloud-api/2026"
      label: "SAP S/4HANA Cloud API capabilities"
    - id: "business/erp-integration/sap-btp-integration-suite/2026"
      label: "SAP BTP Integration Suite setup and configuration"
  solves:
    - id: "business/erp-integration/sap-ecc-migration-integration-playbook/2026"
      label: "ECC-to-S/4HANA migration integration playbook"
  alternative_to: []
  often_confused_with:
    - id: "business/erp-integration/sap-s4hana-cloud-vs-onpremise/2026"
      label: "S/4HANA Cloud vs On-Premise (not the same as ECC vs S/4HANA)"

# === SOURCES ===
sources:
  - id: src1
    title: "SAP ECC vs S/4HANA Integration Capabilities: A Practical Guide for Integration Architects"
    author: SAP Community
    url: https://community.sap.com/t5/integration-blog-posts/sap-ecc-vs-s-4hana-integration-capabilities-a-practical-guide-for/ba-p/14306910
    type: technical_blog
    published: 2025-01-15
    reliability: high
  - id: src2
    title: "Bye-Bye IDoc? What Interface Technologies Will SAP S/4HANA Offer Compared to SAP ECC"
    author: SEEBURGER
    url: https://blog.seeburger.com/bye-bye-idoc-what-interface-technologies-will-sap-s-4hana-offer-compared-to-sap-ecc/
    type: technical_blog
    published: 2024-06-10
    reliability: high
  - id: src3
    title: "SAP Backend Integration Technologies Overview"
    author: Integration Excellence
    url: https://www.integration-excellence.com/sap-backend-integration-technologies-overview/
    type: technical_blog
    published: 2024-08-01
    reliability: moderate_high
  - id: src4
    title: "SAP Integration Platforms: Compare CPI, PI, BTP & More"
    author: Noel D Costa
    url: https://noeldcosta.com/sap-implementation/sap-integration-platforms/
    type: technical_blog
    published: 2025-03-01
    reliability: moderate_high
  - id: src5
    title: "SAP S/4HANA API Essentials"
    author: Rollout.com
    url: https://rollout.com/integration-guides/sap/api-essentials
    type: technical_blog
    published: 2025-06-01
    reliability: moderate_high
  - id: src6
    title: "SAP ECC to S/4HANA Migration: 2027 Deadline Guide & Steps"
    author: Kellton
    url: https://www.kellton.com/kellton-tech-blog/sap-ecc-s4hana-migration-2027-deadline
    type: industry_report
    published: 2025-09-01
    reliability: moderate_high
  - id: src7
    title: "SAP S4 HANA API Throttling and Rate Limits"
    author: SAP Community
    url: https://community.sap.com/t5/technology-q-a/sap-s4-hana-api-throttling-and-rate-limits/qaq-p/12779925
    type: community_resource
    published: 2024-03-01
    reliability: moderate
---

# SAP ECC vs S/4HANA Integration Capabilities: APIs, Middleware, Cloud Readiness & ECC EOL

## TL;DR

- **Bottom line**: S/4HANA replaces ECC's proprietary RFC/BAPI/IDoc interfaces with an API-first architecture using OData, REST, and SOAP — plan integration rewrites during migration, not after.
- **Key limit**: ECC mainstream support ends 2027-12-31 (EHP 6-8); extended maintenance available until 2030 at ~2% premium — after that, no security patches.
- **Watch out for**: S/4HANA's Simplification List blacklists hundreds of ECC BAPIs — existing integrations calling deprecated BAPIs will break silently or throw runtime errors after migration.
- **Best for**: Organizations comparing integration architectures pre-migration, architects planning interface remediation, and teams deciding on middleware strategy (PI/PO vs CPI/BTP).
- **Authentication**: S/4HANA supports OAuth 2.0, X.509 certificates, SAML, and basic auth; ECC primarily uses SNC (Secure Network Communications) for RFC and WS-Security for SOAP.

## System Profile

This card compares the integration capabilities of SAP ECC 6.0 (all Enhancement Packages) and SAP S/4HANA (On-Premise, Cloud, and Private Cloud editions). The comparison covers the full spectrum of integration interfaces — from legacy RFC/BAPI/IDoc in ECC to modern OData/REST/Events in S/4HANA — with particular focus on what changes during migration and the middleware transition from PI/PO to SAP Integration Suite.

This card does NOT cover: S/4HANA Cloud-only API specifics (see separate card), Salesforce-to-SAP integration playbooks, or detailed migration project management. For S/4HANA Cloud vs On-Premise deployment differences, see the dedicated comparison card.

| System | Role | API Surface | Deployment |
|---|---|---|---|
| SAP ECC 6.0 (EHP 0-8) | Legacy ERP — source system during migration | RFC, BAPI, IDoc, SOAP Web Services | On-Premise |
| SAP S/4HANA (2023-2025) | Target ERP — API-first architecture | OData v2/v4, REST, SOAP, RFC (legacy), Business Events | Cloud / On-Premise / Hybrid |
| SAP PI/PO | Legacy middleware for ECC | IDoc, RFC, SOAP, File adapters | On-Premise |
| SAP Integration Suite (CPI) | Strategic middleware for S/4HANA | OData, REST, SOAP, SFTP, HTTPS | Cloud |

## API Surfaces & Capabilities

### SAP ECC Integration Interfaces

| API Surface | Protocol | Best For | Real-time? | Bulk? | Status in S/4HANA |
|---|---|---|---|---|---|
| BAPI (RFC-enabled function modules) | RFC (proprietary) | Business object CRUD, master data | Yes | No | Partially deprecated — check Simplification List |
| IDoc (Intermediate Documents) | tRFC/qRFC, File, SOAP | Async document exchange, B2B, EDI | No (async) | Yes | Reduced count, modified structures |
| SOAP Web Services (ABAP Proxies) | HTTPS/XML via SOAMANAGER | Structured request-response integration | Yes | No | Still supported, not strategic |
| RFC (Remote Function Call) | Proprietary SAP protocol | Direct function calls from external systems | Yes (sRFC) | No | Supported but discouraged for new development |
| File/FTP | Flat file exchange | Batch data loads, legacy system integration | No | Yes | Replaced by OData batch or SOAP |

[src1, src3]

### SAP S/4HANA Integration Interfaces

| API Surface | Protocol | Best For | Real-time? | Bulk? | Status |
|---|---|---|---|---|---|
| OData v2/v4 | HTTPS/JSON or XML | Standard CRUD, business documents, synchronous integration | Yes | Limited ($batch) | Strategic — primary API surface |
| SAP Reliable Messaging (SAP RM) | SOAP with QoS metadata | Async/batch operations, B2B (IDoc replacement) | No (async) | Yes | Strategic — ExactlyOnce delivery |
| Business Events | MQTT/AMQP via Event Mesh | Event-driven architecture, CDC, notifications | Yes (push) | N/A | Strategic — available since 2020 |
| REST APIs | HTTPS/JSON | Custom scenarios, lightweight integrations | Yes | No | Growing catalog on SAP API Business Hub |
| SOAP Web Services | HTTPS/XML | Legacy compatibility, complex transactions | Yes | No | Supported, declining |
| RFC/BAPI (legacy) | RFC proprietary | Backward compatibility only | Yes | No | Maintenance-only in S/4HANA On-Premise; blocked in Cloud |

[src2, src3, src5]

## Rate Limits & Quotas

### Per-Request Limits

| Limit Type | SAP ECC | SAP S/4HANA | Notes |
|---|---|---|---|
| Max concurrent OData requests/client | N/A | 10 recommended | SAP recommendation to prevent server overload [src7] |
| OData $batch sub-requests | N/A | ~1,000 per batch | Varies by system configuration |
| RFC concurrent connections | Configurable (sm59) | Configurable (sm59, on-prem only) | Typically 10-100 per destination |
| IDoc packet size | Configurable (typically 50-500) | Reduced IDoc availability | Check WE20/WE21 settings |
| SOAP message size | Configurable in SOAMANAGER | Configurable | Default ~10 MB, adjustable |
| OData response page size | N/A | 1,000 records default ($top) | Use $skiptoken for pagination |

[src5, src7]

### Rolling / Daily Limits

| Limit Type | SAP ECC | SAP S/4HANA | Notes |
|---|---|---|---|
| API call quotas | No hard daily limit (on-prem) | Cloud: tenant-specific fair use; On-prem: no hard limit | S/4HANA Cloud enforces throttling |
| Work process limits | Configurable (dialog, background, update) | Same architecture (on-prem); managed (cloud) | Exhausting work processes blocks ALL users |
| Background job scheduling | Unlimited (resource-constrained) | Cloud: limited slots; On-prem: unlimited | Plan batch windows carefully in Cloud |
| Event Mesh throughput | N/A | Depends on service plan (Lite/Standard/Premium) | Lite: limited; Premium: millions/month |

[src5, src7]

### Transaction / Dialog Limits

| Limit Type | Per-Transaction Value | Notes |
|---|---|---|
| Dialog step time limit | 600s (default, configurable via rdisp/max_wprun_time) | Applies to both ECC and S/4HANA on-prem |
| Update task timeout | 600s default | Long-running updates should use background processing |
| RFC timeout | Configurable per destination (sm59) | Typically 300s for synchronous RFC |
| Memory per dialog step | Configurable (abap/heap_area_dia) | S/4HANA HANA in-memory reduces need for large buffers |

## Authentication

| Flow | SAP ECC | SAP S/4HANA | Use When |
|---|---|---|---|
| SNC (Secure Network Communications) | Primary for RFC/BAPI | Supported (on-prem) | Server-to-server RFC connections |
| Basic Authentication | SOAP Web Services | OData, REST, SOAP | Development/testing only — not for production |
| X.509 Client Certificates | SOAP via ICM | OData, REST, SOAP | Server-to-server, highest security |
| OAuth 2.0 | Not native (requires proxy) | Native support (Cloud & on-prem 2021+) | Cloud integrations, third-party apps |
| SAML 2.0 | Limited (SSO only) | Full support | User-context browser-based integrations |
| SAP API Key | N/A | SAP API Business Hub sandbox | Testing APIs in sandbox environment |

[src1, src3]

### Authentication Gotchas

- SNC requires SAP Cryptographic Library (CommonCryptoLib) on both client and server — missing library causes silent connection failures with generic error messages. [src3]
- OAuth 2.0 on S/4HANA On-Premise requires SAP NetWeaver Gateway OAuth configuration (transaction SOAUTH) — this is NOT enabled by default and requires Basis team involvement. [src1]
- Basic auth credentials for RFC destinations (sm59) are stored in clear text in the database — use SNC or X.509 in production. [src3]
- S/4HANA Cloud uses SAP BTP destination service for credential management — direct system credentials are not exposed to integration developers. [src5]

## Constraints
<!-- Agents: read this section before recommending any integration approach from this unit.
     These are hard constraints that must not be violated. -->

- SAP ECC mainstream support ends 2027-12-31 for EHP 6-8; EHP 0-5 support already ended 2025-12-31 — no security patches after these dates without extended maintenance. [src6]
- S/4HANA Cloud blocks RFC, BAPI, and IDoc natively — only OData, SOAP, and REST APIs are available. If your integration relies on RFC/BAPI, it MUST be rewritten for Cloud deployment. [src2]
- S/4HANA Simplification List deprecates hundreds of ECC BAPIs, tables, and function modules — run ABAP Test Cockpit (ATC) checks BEFORE migration to identify affected interfaces. [src1]
- SAP PI/PO is in maintenance-only mode — SAP will not add new features. New integration projects should use SAP Integration Suite (CPI). [src4]
- S/4HANA's simplified data model (e.g., Universal Journal ACDOCA replacing multiple FI/CO tables) changes field mappings for financial integrations — interfaces reading BSEG, BKPF, COEP, etc. will break. [src1]
- Extended maintenance for ECC (2028-2030) costs approximately 2% additional on top of standard maintenance annually and provides only break-fix support, not innovation. [src6]
- Event Mesh (Business Events) requires separate BTP subscription and licensing — it is not included in base S/4HANA license. [src5]

## Integration Pattern Decision Tree

```
START — Migrating SAP ECC to S/4HANA integration
├── What deployment target?
│   ├── S/4HANA Cloud
│   │   ├── Current integration uses RFC/BAPI?
│   │   │   ├── YES → MUST rewrite to OData or SOAP (RFC blocked in Cloud)
│   │   │   └── NO → Evaluate OData equivalent on SAP API Business Hub
│   │   ├── Current integration uses IDoc?
│   │   │   ├── YES → Replace with SAP Reliable Messaging (SAP RM) or OData
│   │   │   └── NO → Use OData for sync, Business Events for async
│   │   └── Middleware?
│   │       └── SAP Integration Suite (CPI) — only option for Cloud
│   ├── S/4HANA On-Premise
│   │   ├── Current integration uses RFC/BAPI?
│   │   │   ├── BAPI in Simplification List? → Rewrite to OData
│   │   │   └── BAPI still supported? → Works, but plan OData migration
│   │   ├── Current integration uses IDoc?
│   │   │   ├── IDoc structure changed? → Update mappings per Simplification List
│   │   │   └── IDoc unchanged? → Works, but OData is strategic direction
│   │   └── Middleware?
│   │       ├── PI/PO exists? → Continue short-term, plan CPI migration
│   │       └── No middleware? → Implement CPI for new integrations
│   └── Hybrid (ECC + S/4HANA coexistence)
│       └── Use CPI to bridge ECC (RFC/IDoc) ↔ S/4HANA (OData/Events)
├── Integration pattern needed?
│   ├── Real-time sync → OData v2/v4 (S/4HANA) or BAPI/RFC (ECC, legacy)
│   ├── Batch/bulk → SAP Reliable Messaging (S/4HANA) or IDoc packets (ECC)
│   ├── Event-driven → Business Events + Event Mesh (S/4HANA only)
│   └── File-based → SFTP via CPI (both systems)
└── Error tolerance?
    ├── ExactlyOnce required → SAP Reliable Messaging (replaces tRFC/qRFC)
    └── Best-effort → OData with retry logic
```

## Quick Reference

### Cross-System Capability Comparison

| Capability | SAP ECC 6.0 | SAP S/4HANA On-Premise | SAP S/4HANA Cloud | Winner |
|---|---|---|---|---|
| Primary API protocol | RFC (proprietary) | OData v2/v4 (REST) | OData v2/v4 (REST) | S/4HANA |
| API catalog | No central catalog | SAP API Business Hub | SAP API Business Hub | S/4HANA |
| Async messaging | IDoc + ALE | SAP RM + Business Events | SAP RM + Business Events | S/4HANA |
| Event-driven architecture | Not native | Business Events (add-on) | Business Events (native) | S/4HANA Cloud |
| Bulk data operations | IDoc packets, BDC, LSMW | OData $batch, SAP RM | OData $batch, SAP RM | Comparable |
| Middleware (strategic) | PI/PO (on-prem) | CPI / Integration Suite | CPI / Integration Suite (required) | S/4HANA |
| Authentication | SNC, basic, WS-Security | OAuth 2.0, X.509, SAML, basic | OAuth 2.0, X.509, SAML | S/4HANA |
| Cloud-native readiness | Poor — proprietary protocols | Good — standards-based APIs | Excellent — cloud-native | S/4HANA Cloud |
| Third-party integration ease | Difficult — SAP expertise required | Moderate — REST/OData standard | Good — standard APIs | S/4HANA Cloud |
| Legacy compatibility | Full (native) | High (most ECC interfaces work) | Low (RFC/IDoc blocked) | ECC |
| Real-time analytics integration | Limited | CDS views + OData exposure | CDS views + OData exposure | S/4HANA |
| API versioning | N/A (BAPI versioned by release) | Release-based (2023, 2024, 2025) | Continuous updates | S/4HANA Cloud |

[src1, src2, src3]

## Step-by-Step Integration Guide

### 1. Audit existing ECC integrations

Run the ABAP Test Cockpit (ATC) to scan all custom interfaces for deprecated objects before migration. [src1]

```abap
* In ECC transaction SE38 or ATC:
* Run SAP S/4HANA readiness check (transaction /SDF/RC_START_CHECK)
* This identifies:
* - Deprecated BAPIs and function modules
* - Modified IDoc structures
* - Tables removed or merged in S/4HANA (e.g., BSEG → ACDOCA)
* Export results to spreadsheet for interface remediation planning
```

**Verify**: Transaction `/SDF/RC_START_CHECK` → Report shows list of affected custom objects with severity ratings.

### 2. Map ECC interfaces to S/4HANA equivalents

For each deprecated BAPI/RFC, find the OData replacement on SAP API Business Hub. [src2]

```bash
# Search SAP API Business Hub for replacement APIs
# URL: https://api.sap.com/
# Filter by: Product = SAP S/4HANA, API Type = OData V2 or V4
# Example: BAPI_SALESORDER_CREATEFROMDAT2 → Sales Order (A2X) OData V4 API
# Example: BAPI_MATERIAL_GETLIST → Product Master OData API

# For each ECC interface, document:
# 1. Current BAPI/RFC name
# 2. S/4HANA OData equivalent (from API Business Hub)
# 3. Field mapping changes (esp. financial: BSEG→ACDOCA)
# 4. Authentication change (RFC/SNC → OAuth/X.509)
```

**Verify**: Each ECC interface has a documented S/4HANA equivalent or explicit "rewrite required" flag.

### 3. Configure OData service in S/4HANA

Activate and test OData services via SAP Gateway. [src3]

```abap
* Transaction /IWFND/MAINT_SERVICE — activate OData service
* 1. Search for the API service name (e.g., API_SALES_ORDER_SRV)
* 2. Click "Add Service" and assign to system alias
* 3. Test via /IWFND/GW_CLIENT:
*    GET /sap/opu/odata/sap/API_SALES_ORDER_SRV/$metadata
*    → Should return EDMX schema definition
* 4. Test data retrieval:
*    GET /sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder?$top=10&$format=json
```

**Verify**: `GET /sap/opu/odata/sap/{SERVICE_NAME}/$metadata` → returns 200 with EDMX XML schema.

### 4. Set up SAP Integration Suite (CPI) connection

Configure connectivity from CPI to S/4HANA for middleware-based integrations. [src4]

```
# In SAP BTP Cockpit:
# 1. Subscribe to Integration Suite
# 2. Create HTTP Destination pointing to S/4HANA:
#    - URL: https://{s4hana-host}:{port}/sap/opu/odata/sap/{SERVICE}
#    - Authentication: OAuth2SAMLBearerAssertion (recommended)
#    - or: ClientCertificateAuthentication (X.509)
# 3. In CPI Design workspace, create iFlow:
#    - Sender: HTTP adapter (from external system)
#    - Receiver: OData V2 adapter (to S/4HANA)
#    - Map fields using Message Mapping or XSLT
# 4. Deploy and monitor via Operations view
```

**Verify**: CPI iFlow deployment succeeds → test message returns 200 from S/4HANA OData endpoint.

## Code Examples

### Python: Query S/4HANA OData API with OAuth 2.0

```python
# Input:  S/4HANA OData endpoint URL, OAuth client credentials
# Output: JSON response with business documents

import requests  # requests==2.31.0

# Step 1: Get OAuth token
token_url = "https://{s4hana-host}/sap/bc/sec/oauth2/token"
token_resp = requests.post(token_url, data={
    "grant_type": "client_credentials",
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET"
})
access_token = token_resp.json()["access_token"]

# Step 2: Query OData API
odata_url = "https://{s4hana-host}/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder"
headers = {
    "Authorization": f"Bearer {access_token}",
    "Accept": "application/json"
}
params = {"$top": 100, "$format": "json"}
resp = requests.get(odata_url, headers=headers, params=params)
resp.raise_for_status()
orders = resp.json()["d"]["results"]
```

### JavaScript/Node.js: Call ECC BAPI via RFC (legacy)

```javascript
// Input:  SAP ECC RFC destination config, material number
// Output: Material details from BAPI_MATERIAL_GET_DETAIL
// Requires: node-rfc@3.3.1

const noderfc = require("node-rfc"); // node-rfc@3.3.1
const client = new noderfc.Client({
  ashost: "ecc-server.example.com",
  sysnr: "00",
  client: "100",
  user: "RFC_USER",
  passwd: "password",  // Use SNC in production!
  lang: "EN"
});

async function getMaterial(materialNumber) {
  await client.open();
  const result = await client.call("BAPI_MATERIAL_GET_DETAIL", {
    MATERIAL: materialNumber,
    PLANT: "1000"
  });
  await client.close();
  return result.MATERIAL_GENERAL_DATA;
}
// Note: This BAPI still works in S/4HANA On-Premise but
// check Simplification List — some material BAPIs are deprecated
```

### cURL: Test S/4HANA OData service connectivity

```bash
# Input:  S/4HANA host, user credentials (basic auth for testing)
# Output: OData metadata document

# Test service metadata
curl -X GET \
  "https://{s4hana-host}/sap/opu/odata/sap/API_SALES_ORDER_SRV/\$metadata" \
  -H "Authorization: Basic $(echo -n 'USER:PASS' | base64)" \
  -H "Accept: application/xml"

# Query first 5 sales orders
curl -X GET \
  "https://{s4hana-host}/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder?\$top=5&\$format=json" \
  -H "Authorization: Basic $(echo -n 'USER:PASS' | base64)" \
  -H "Accept: application/json"

# Create sales order via OData (POST)
curl -X POST \
  "https://{s4hana-host}/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder" \
  -H "Authorization: Basic $(echo -n 'USER:PASS' | base64)" \
  -H "Content-Type: application/json" \
  -H "X-CSRF-Token: {token}" \
  -d '{"SalesOrderType":"OR","SalesOrganization":"1000","DistributionChannel":"10"}'
```

## Data Mapping

### Key Field Mapping Changes (ECC to S/4HANA)

| ECC Table/Field | S/4HANA Equivalent | Type | Transform | Gotcha |
|---|---|---|---|---|
| BSEG (FI line items) | ACDOCA (Universal Journal) | Merged table | Join BKPF+BSEG → single ACDOCA | BSEG is compatibility view in S/4HANA — DO NOT write to it directly |
| BKPF (FI doc header) | ACDOCA | Merged table | Header fields merged into line items | Document number format may differ |
| COEP (CO line items) | ACDOCA | Merged table | CO/FI unified in Universal Journal | Separate CO queries no longer needed |
| KONV (pricing conditions) | PRCD_ELEMENTS | Renamed/restructured | Field names changed | Custom pricing condition interfaces break |
| VBAK/VBAP (sales docs) | Still exists (simplified) | Minor changes | Some fields removed | Check Simplification List for field-level changes |
| KNA1 (customer master) | BUT000 (Business Partner) | Replaced | Customer→BP migration via CVI | Customer number ≠ BP number by default |
| LFA1 (vendor master) | BUT000 (Business Partner) | Replaced | Vendor→BP migration via CVI | Vendor and customer can share one BP |
| MARA/MARC (material master) | Still exists (simplified) | Minor changes | Some fields removed/relocated | Material number extended to 40 chars |

[src1, src2]

### Data Type Gotchas

- Customer and vendor master data merge into Business Partner (BUT000) in S/4HANA — interfaces reading KNA1/LFA1 get compatibility views, but write operations MUST use BP APIs. [src1]
- Financial document interfaces reading BSEG directly will get compatibility view data, but it performs poorly — rewrite to read ACDOCA with CDS views for production use. [src1]
- Material number field length increases from 18 to 40 characters in S/4HANA — check all fixed-length string handling in integration code. [src2]
- Currency amount fields in OData use Edm.Decimal with scale/precision — ECC RFC returns packed numbers (BCD) — conversion logic needed. [src3]

## Error Handling & Failure Points

### Common Error Codes

| Code | Meaning | ECC Context | S/4HANA Context | Resolution |
|---|---|---|---|---|
| RFC_COMMUNICATION_FAILURE | RFC connection lost | Network/firewall issue | Same (on-prem only) | Check sm59 connection test, verify ports 33XX open |
| RFC_SYSTEM_FAILURE | ABAP runtime error in called function | BAPI internal error | Same | Check ST22 for short dump, review BAPI return messages |
| HTTP 401 | Unauthorized | Basic auth failed | OAuth token expired/invalid | Refresh OAuth token; check SOAUTH config in S/4HANA |
| HTTP 403 | Forbidden | ICM authorization | Missing OData service authorization | Assign authorization object S_SERVICE to integration user |
| HTTP 405 | Method Not Allowed | N/A | OData service doesn't support operation | Check $metadata for allowed operations on entity set |
| HTTP 429 | Too Many Requests | N/A (no native throttling) | Cloud throttling active | Implement exponential backoff; reduce concurrency below 10 |
| IDOC_STATUS_03 | IDoc passed to application | IDoc delivered successfully | Same (reduced IDoc availability) | No action — success status |
| IDOC_STATUS_51 | Application error in IDoc processing | Business rule violation | Same + potential structure changes | Check BD87 for error details; verify IDoc structure version |

[src1, src3]

### Failure Points in Production

- **Deprecated BAPI calls after S/4HANA migration**: Integrations calling blacklisted BAPIs throw CX_SY_DYN_CALL_ILLEGAL_FUNC runtime errors or return empty results with no error message. Fix: `Run ATC S/4HANA readiness check pre-migration; maintain BAPI→OData mapping spreadsheet`. [src1]
- **IDoc structure mismatch**: S/4HANA modifies several IDoc segment structures (especially FI and MM). Existing IDoc mappings in middleware produce data loss or mapping errors. Fix: `Re-import IDoc metadata into PI/PO or CPI after S/4HANA migration; compare segment definitions with WE60`. [src2]
- **Universal Journal field mapping failures**: Interfaces reading BSEG/BKPF/COEP compatibility views in S/4HANA suffer 10-100x performance degradation compared to native ACDOCA access. Fix: `Rewrite financial interfaces to use CDS views (I_JournalEntry, I_OperationalAcctgDocItem) exposed as OData`. [src1]
- **OAuth token expiration in unattended integrations**: OAuth access tokens in S/4HANA have configurable but finite lifetimes. Batch jobs running longer than token lifetime fail mid-execution. Fix: `Implement token refresh logic before each API call batch; use client_credentials flow with automatic renewal`. [src5]
- **Business Partner number mismatch**: After CVI (Customer-Vendor Integration) migration, BP numbers may not match old customer/vendor numbers. Integrations using hardcoded customer numbers fail. Fix: `Use CVI mapping tables (CVIMAP) or configure same-number assignment during BP migration`. [src1]
- **PI/PO channel timeouts during S/4HANA upgrade**: When ECC is upgraded to S/4HANA, PI/PO communication channels referencing ECC RFC destinations need reconfiguration. Fix: `Update all RFC destinations in sm59; re-register PI/PO adapters; test all channels in SXI_MONITOR`. [src4]

## Anti-Patterns

### Wrong: Direct table reads via RFC_READ_TABLE on S/4HANA

```abap
* BAD — Reading BSEG directly via RFC_READ_TABLE
* Works in ECC, but in S/4HANA BSEG is a compatibility view
* that performs full table scans on ACDOCA (millions of rows)
CALL FUNCTION 'RFC_READ_TABLE'
  EXPORTING
    QUERY_TABLE = 'BSEG'
    DELIMITER   = '|'
  TABLES
    OPTIONS = lt_options
    DATA    = lt_data.
* Result: Timeout or extreme memory consumption
```

### Correct: Use CDS views exposed as OData in S/4HANA

```abap
* GOOD — Use CDS view I_JournalEntry via OData
* Optimized for HANA, proper indexing, much faster
* Access via: /sap/opu/odata/sap/API_JOURNALENTRYITEMBASIC_SRV
* External call:
* GET /API_JOURNALENTRYITEMBASIC_SRV/A_JournalEntryItemBasic
*     ?$filter=CompanyCode eq '1000'
*     &$top=1000&$format=json
```

### Wrong: Keeping PI/PO for all new S/4HANA integrations

```
# BAD — Building new integration flows on PI/PO
# PI/PO is maintenance-only — no new features, no cloud support
# Creates technical debt that must be migrated later
PI/PO iFlow: External System → RFC Adapter → S/4HANA BAPI
```

### Correct: Use SAP Integration Suite (CPI) for new integrations

```
# GOOD — New integrations on CPI
# Cloud-native, continuously updated, pre-built S/4HANA adapters
# CPI iFlow: External System → HTTPS → CPI → OData Adapter → S/4HANA
# Benefits: Pre-built error handling, monitoring, credential management
```

### Wrong: Assuming all ECC BAPIs work unchanged in S/4HANA

```python
# BAD — No pre-migration validation of BAPI compatibility
def create_sales_order(conn):
    # This BAPI works in ECC but may have changed behavior in S/4HANA
    result = conn.call("BAPI_SALESORDER_CREATEFROMDAT2", {...})
    # No check for deprecated fields or changed return structures
    return result["SALESDOCUMENT"]
```

### Correct: Validate against Simplification List and test in S/4HANA sandbox

```python
# GOOD — Pre-validated BAPI or OData replacement
def create_sales_order(conn, use_odata=True):
    if use_odata:
        # S/4HANA: Use OData API (strategic, documented, versioned)
        resp = requests.post(
            f"{S4_HOST}/sap/opu/odata/sap/API_SALES_ORDER_SRV/A_SalesOrder",
            json={"SalesOrderType": "OR", ...},
            headers={"Authorization": f"Bearer {token}"}
        )
        return resp.json()["d"]["SalesOrder"]
    else:
        # ECC fallback: BAPI still works but verify field mappings
        result = conn.call("BAPI_SALESORDER_CREATEFROMDAT2", {...})
        # Always check RETURN table for warnings about deprecated fields
        check_bapi_return(result["RETURN"])
        return result["SALESDOCUMENT"]
```

## Common Pitfalls

- **"Lift and shift" integration mentality**: Assuming ECC integrations work unchanged in S/4HANA leads to post-migration failures. Fix: `Audit every interface against Simplification List; budget 30-40% of migration effort for interface remediation`. [src1]
- **Ignoring S/4HANA data model simplification**: The Universal Journal (ACDOCA) merges 5+ FI/CO tables. Interfaces reading individual tables hit compatibility views with terrible performance. Fix: `Map all financial interfaces to CDS view-based OData services before go-live`. [src1]
- **Delaying middleware migration**: Running PI/PO alongside S/4HANA works short-term but creates dual maintenance burden and blocks cloud-native features. Fix: `Plan PI/PO-to-CPI migration as part of S/4HANA project, not a separate initiative`. [src4]
- **Underestimating Business Partner migration impact**: Customer/vendor merge into BP affects every interface that reads or writes master data. Fix: `Run CVI migration early; validate all master data interfaces against BP model; update number ranges if needed`. [src1]
- **Not testing IDoc structures post-migration**: Changed IDoc segments cause silent data loss in middleware mappings. Fix: `Re-export IDoc metadata from S/4HANA (WE60); diff against ECC definitions; update all middleware mappings`. [src2]
- **Skipping S/4HANA API Business Hub review**: Many custom ECC interfaces replicate functionality already available as standard S/4HANA APIs. Fix: `Search api.sap.com for every custom interface; prefer standard APIs over custom OData services`. [src5]

## Diagnostic Commands

```bash
# ===== SAP ECC Diagnostics =====

# Check RFC destinations and connectivity
# Transaction: SM59 → test connection for each RFC destination

# Monitor IDoc processing status
# Transaction: BD87 (reprocessing), WE02/WE05 (IDoc list), WE19 (test tool)

# Check SOAP web service configuration
# Transaction: SOAMANAGER → Service Administration → search by service name

# List all custom BAPIs/RFCs
# Transaction: SE37 → search Z* function modules with RFC-enabled flag

# ===== SAP S/4HANA Diagnostics =====

# Test OData service endpoint
curl -v "https://{host}/sap/opu/odata/sap/API_SALES_ORDER_SRV/\$metadata" \
  -H "Authorization: Basic $(echo -n 'USER:PASS' | base64)"

# Check OData service activation
# Transaction: /IWFND/MAINT_SERVICE → verify service is active
# Transaction: /IWFND/ERROR_LOG → check for OData-specific errors

# Monitor OData request traces
# Transaction: /IWFND/TRACES → enable/view request/response logs

# Run S/4HANA readiness check from ECC
# Transaction: /SDF/RC_START_CHECK → generates compatibility report

# Check Business Partner migration status
# Transaction: CVI_COCKPIT → monitor customer/vendor → BP migration progress

# Verify SAP Integration Suite (CPI) connectivity
# SAP BTP Cockpit → Integration Suite → Monitor → All Integration Flows
```

## Version History & Compatibility

| S/4HANA Release | Release Date | Key Integration Changes | ECC Compatibility Impact |
|---|---|---|---|
| S/4HANA 2025 | 2025-10 | Enhanced OData V4 coverage, expanded Business Events catalog | More BAPIs deprecated per Simplification List |
| S/4HANA 2024 | 2024-10 | RAP-based APIs expanded, improved Event Mesh integration | Additional table simplifications |
| S/4HANA 2023 | 2023-10 | Key User Extensibility for OData, CDS view enhancements | Simplification List v26 |
| S/4HANA 2021 | 2021-10 | Native OAuth 2.0 support on-premise, Business Events GA | PI/PO migration tools available |
| S/4HANA 2020 | 2020-10 | Business Events add-on available, SAP Graph preview | First event-driven integration option |
| S/4HANA 1909 | 2019-09 | OData V4 support, improved API Business Hub coverage | Major BAPI deprecation wave |

[src1, src2, src6]

### ECC End-of-Life Timeline

| Milestone | Date | Impact |
|---|---|---|
| ECC EHP 0-5 mainstream support end | 2025-12-31 | No more patches for older enhancement packages |
| ECC EHP 6-8 mainstream support end | 2027-12-31 | No security patches, compliance updates, or fixes |
| ECC extended maintenance available | 2028-01-01 to 2030-12-31 | Break-fix only, ~2% additional cost annually |
| ECC all support ends | 2030-12-31 | No SAP support of any kind |

[src6]

### Deprecation Policy

SAP publishes a Simplification List with each S/4HANA release documenting deprecated BAPIs, tables, and transaction codes. Objects marked as "not available" are blocked; objects marked as "changed" have modified behavior. Always review the Simplification List for your target S/4HANA release before migration. The list is available on SAP Help Portal and is updated with each release. [src1, src2]

## When to Use / When Not to Use

| Use When | Don't Use When | Use Instead |
|---|---|---|
| Planning ECC-to-S/4HANA migration and need to understand integration impact | Need S/4HANA Cloud-specific API rate limits and quotas | SAP S/4HANA Cloud API reference card |
| Comparing middleware options (PI/PO vs CPI) for S/4HANA project | Need step-by-step Salesforce-to-SAP integration guide | Salesforce-SAP integration playbook |
| Assessing which ECC integrations need remediation | Need detailed SAP BTP Integration Suite setup | SAP BTP Integration Suite card |
| Evaluating S/4HANA deployment model (Cloud vs On-Premise) for integration | Need SAP SuccessFactors or Ariba integration specifics | Product-specific integration cards |
| Building business case for integration remediation budget | Need general ERP selection guidance (not SAP-specific) | ERP vendor selection cards |

## Cross-System Comparison

| Capability | SAP ECC 6.0 | S/4HANA On-Premise | S/4HANA Cloud | Notes |
|---|---|---|---|---|
| API style | RFC/BAPI (proprietary) | OData + RFC (hybrid) | OData/REST only | Cloud forces full API modernization |
| API catalog | None (custom discovery) | SAP API Business Hub | SAP API Business Hub | Searchable, versioned, sandbox testing |
| Async messaging | IDoc + ALE (mature) | IDoc (reduced) + SAP RM + Events | SAP RM + Events (no IDoc) | IDoc effectively deprecated for Cloud |
| Event-driven | Not available | Business Events (add-on) | Business Events (native) | Requires BTP Event Mesh subscription |
| Middleware (strategic) | PI/PO | CPI / Integration Suite | CPI / Integration Suite (required) | PI/PO = maintenance-only since ~2020 |
| Authentication | SNC, basic, WS-Security | OAuth 2.0, X.509, SAML, basic | OAuth 2.0, X.509, SAML | Cloud mandates modern auth |
| Database | Multi-vendor (Oracle, DB2, MSSQL) | SAP HANA only | SAP HANA (managed) | HANA required for S/4HANA |
| Data model | Traditional (100+ FI/CO tables) | Simplified (ACDOCA + compatibility views) | Simplified (ACDOCA, no compat views for writes) | Biggest integration impact area |
| Extensibility | Custom ABAP, user exits, BAdIs | Key User Extensibility + custom ABAP | Key User Extensibility only (no custom ABAP) | Cloud limits custom code significantly |
| Support status | EOL 2027 (mainstream) | Current (annual releases) | Current (continuous updates) | ECC = ticking clock |

[src1, src2, src4, src6]

## Important Caveats

- ECC extended maintenance (2028-2030) provides break-fix support only — no new features, no regulatory updates, and no compatibility patches for new OS/database versions. Plan for full migration, not indefinite extended support. [src6]
- S/4HANA On-Premise still supports many ECC interfaces (RFC, BAPI, IDoc) for backward compatibility, but SAP explicitly discourages their use for new development and may remove them in future releases. [src2]
- The Simplification List grows with each S/4HANA release — BAPIs that work on S/4HANA 2023 may be deprecated in S/4HANA 2025. Pin your target release early and validate against that specific list. [src1]
- Migration effort estimates (18-36 months) often undercount integration remediation — budget 30-40% of total migration effort for interface work, especially for organizations with 100+ custom interfaces. [src6]
- S/4HANA Cloud restricts custom ABAP code execution — if your integrations rely on custom ABAP programs called via RFC, they CANNOT run in S/4HANA Cloud. [src1]
- SAP licensing model changed with S/4HANA — Digital Access licensing may apply to integrations that create documents in SAP without named user login (e.g., automated order creation from e-commerce systems). [src4]

## Related Units

- [SAP S/4HANA Cloud API Capabilities](/business/erp-integration/sap-s4hana-cloud-api/2026)
- [SAP BTP Integration Suite Setup Guide](/business/erp-integration/sap-btp-integration-suite/2026)
- [SAP ECC Migration Integration Playbook](/business/erp-integration/sap-ecc-migration-integration-playbook/2026)
- [S/4HANA Cloud vs On-Premise Deployment](/business/erp-integration/sap-s4hana-cloud-vs-onpremise/2026)
