> ## Documentation Index
> Fetch the complete documentation index at: https://docs.runalloy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SAP ECC

> Integration details and setup guide for the SAP ECC connector in Alloy Automation.

## Pre-Built Tooling

| Category                            | Details                                    |
| ----------------------------------- | ------------------------------------------ |
| **Authentication**                  | Basic Authentication (Username & Password) |
| **Two-Way Sync**                    | No                                         |
| **Events Supported**                | No                                         |
| **Realtime**                        | No (Polling)                               |
| **Supports Rate Limiting**          | Yes                                        |
| **Authentication Scopes Supported** | N/A (Basic Auth)                           |

***

## Objects Supported

Alloy Automation supports interacting with **SAP ECC** via OData services. The connector provides access to:

* **Custom OData Services** - Access any exposed OData endpoint in your SAP ECC instance
* **Standard SAP Objects** - Customers, Materials, Sales Orders, Purchase Orders, Invoices, etc.
* **Custom Actions** - Execute custom OData operations defined in your SAP system

***

## Set Up Guide

### Trial Access

| Question                                           | Answer                                                                                                        |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| **Offers free trial?**                             | No. SAP ECC is a legacy ERP system. You must self-host. [Contact SAP](https://www.sap.com/about/contact.html) |
| **Requires paid sandbox**                          | Yes, contact SAP. Production systems may require SAP licensing.                                               |
| **Requires partnership to obtain authentication?** | No. However, access to a SAP ECC instance (trial, dev, or production) is required.                            |

***

### Authentication (Basic Auth)

SAP ECC uses Basic Authentication with a communication user for API access via the NetWeaver Gateway.

<step>
  ## Step 1: Access SAP ECC System

  1. Request access to a SAP ECC trial or development system from your organization or SAP partner
  2. Alternative: Use **SAP Cloud Appliance Library** ([https://cal.sap.com/](https://cal.sap.com/)) to deploy an ECC trial instance
  3. Note your system's hostname, port, and client number
  4. Ensure the NetWeaver Gateway is installed and configured on your ECC system
</step>

<step>
  ## Step 2: Create a Communication User

  1. Log into your SAP ECC system via SAP GUI
  2. Navigate to **Transaction SU01** (User Maintenance)
  3. Create a new user with type "System" or "Communication"
  4. Assign necessary roles and authorizations:
     * `/IWFND/RT_GATEWAY_USER` for Gateway access
     * Additional authorization objects based on the OData services you'll consume
  5. Set a secure password and note the credentials
</step>

<step>
  ## Step 3: Activate OData Services

  1. Navigate to **Transaction /IWFND/MAINT\_SERVICE** (Maintain Services)
  2. Click "Add Service" to register OData services from the backend system
  3. Activate the services you want to expose (e.g., customer master, sales order services)
  4. Test the service using **Transaction /IWFND/GW\_CLIENT**
  5. Note the service endpoint URLs (e.g., `/sap/opu/odata/sap/SERVICE_NAME`)
</step>

<step>
  ## Step 4: Configure SAP Gateway

  1. Ensure the Internet Communication Manager (ICM) is running
  2. Verify HTTPS is enabled on your SAP ECC Gateway
  3. Check that the Gateway is registered in **Transaction /IWFND/GW\_CONFIG**
  4. Configure trusted systems if calling from external networks
</step>

<step>
  ## Step 5: Connect Alloy Automation

  1. In Alloy Automation, provide your SAP ECC credentials:
     * **SAP ECC Username**: Your communication user ID
     * **SAP ECC Password**: The communication user password
     * **Hostname**: Your SAP ECC hostname (e.g., `my-ecc-server.com`)
     * **Port**: HTTPS port (typically `443`, `8000`, or `44300`)
  2. Test the connection by retrieving data from an OData service
</step>

***

## Use Cases

### 1) Customer data synchronization

Sync customer master data between SAP ECC and CRM systems, ensuring sales teams have up-to-date contact information, credit limits, and account hierarchies.

### 2) Sales order automation

Automatically create sales orders in SAP ECC when orders are placed in e-commerce platforms, including pricing, availability checks, and delivery scheduling.

### 3) Material master management

Keep material master data synchronized between SAP ECC and product information management (PIM) systems, including descriptions, specifications, and classifications.

### 4) Financial document extraction

Extract invoices, payment documents, and accounting entries from SAP ECC for integration with business intelligence tools, data warehouses, or external accounting systems.

### 5) Procurement workflow integration

Connect SAP ECC with supplier portals and procurement platforms to automate purchase requisitions, purchase orders, and goods receipt processes.

***

## API Gotchas

* **NetWeaver Gateway Required:** SAP ECC doesn't natively support RESTful APIs. You must have SAP NetWeaver Gateway installed and configured to expose OData services. Without it, REST API access is not possible.

* **Service Activation:** OData services must be explicitly registered and activated in transaction /IWFND/MAINT\_SERVICE. Many standard SAP services exist but are not activated by default.

* **Authorization Complexity:** SAP ECC uses a complex authorization model with authorization objects. Ensure your communication user has proper S\_SERVICE authorizations and object-level access (e.g., S\_RFC for function modules).

* **CSRF Token Requirement:** For write operations (POST, PUT, PATCH, DELETE), SAP ECC requires a CSRF token. First make a GET request with the header `x-csrf-token: fetch`, then include the returned token in subsequent write operations.

* **Unicode and Code Pages:** SAP ECC may use different character encodings depending on system configuration. Ensure your integration handles Unicode characters properly to avoid data corruption with international characters.

* **Session Management:** SAP ECC has session timeout limits. For long-running integrations, implement proper session management and re-authentication logic to handle expired sessions gracefully.

> For questions or troubleshooting, contact **[support@runalloy.com](mailto:support@runalloy.com)**.
