SAP ECC (Legacy) Connector User Guide

Publication metadata

FieldValue
Canonical URL/docs/04_connecting-systems/connectors/s/sap-ecc
Version (published date)2026-05-05
Tagsconnectors, reference, sap-ecc

Summary

The SAP ECC (Legacy) Connector allows you to integrate with SAP ECC (Enterprise Central Component), a legacy enterprise resource planning (ERP) system. It provides programmatic access to SAP ECC's IDoc, BAPI, and RFC protocols for processing business documents, executing business functions, and performing remote function calls.


Overview

Connector ID: sap-ecc-1.0.0

Key Features:

  • IDoc processing (inbound/outbound)
  • BAPI function execution
  • RFC function calls (if configured)
  • Legacy SAP system integration
  • Support for multiple integration protocols

Configuration Parameters

These parameters are stored in the integration configuration (not passed in execution data):

Required Parameters

  • base_url (url): SAP ECC system base URL.

    • Example: https://sap-ecc.example.com:8000
    • Example: http://sap-ecc-dev.example.com:8000 (for development)
    • Must include protocol (http:// or https://) and port if non-standard
    • Found in: Your SAP ECC system configuration
  • username (string): SAP username.

    • Example: RFC_USER, IDOC_USER
    • This user must exist in the SAP system and have appropriate authorizations
    • Found in: SAP user management (SU01)
  • password (password): SAP password.

    • ⚠️ Sensitive: Stored securely in the database.
    • Password for the specified username
    • Important: Store securely and rotate regularly
  • client (string): SAP client number.

    • Example: 100, 200, 800
    • This is the SAP client (mandant) number
    • Found in: SAP login screen or system configuration

Optional Parameters

  • system_number (string): SAP system number.

    • Example: 00, 01
    • This is the SAP system number (instance number)
    • Found in: SAP system configuration
  • api_type (string): API type to use.

    • Default: idoc
    • Values: idoc (recommended), bapi, or rfc
    • IDoc is recommended for document-based integration
  • timeout_seconds (integer): Request timeout in seconds.

    • Default: 60
    • Increase for operations that may take longer (e.g., complex BAPI/RFC calls, large IDoc processing).

Authentication

The connector supports Basic Authentication (username/password) and SAP-specific authentication depending on the API type used.

Setup Steps

  1. Identify SAP ECC System:

    • Determine your SAP ECC system base URL
    • Identify the client number and system number you want to connect to
  2. Create or Identify API User:

    • Create a dedicated user in SAP for API access (recommended)
    • Or use an existing user with appropriate authorizations
    • Ensure the user has the necessary authorizations for:
      • IDoc processing (if using IDoc)
      • BAPI execution (if using BAPI)
      • RFC calls (if using RFC)
  3. Configure the Connector:

    • Enter base_url, username, password, and client
    • Optionally set system_number and api_type (defaults to idoc)
    • The connector will automatically authenticate using Basic Authentication

Note: The connector automatically authenticates on first use. If authentication fails, operations will fail with an authentication error.

Supported Operations

1. Send Data (send)

Send IDoc documents or execute BAPI/RFC functions.

Usage - Send IDoc:

const result = connector.execute('send', {
    idoc_type: 'ORDERS05', // IDoc type
    idoc_data: {
        E1EDK01: {
            CURCY: 'USD',
            HWAER: 'USD',
            NETWR: '1000.00',
            WAERK: 'USD'
        },
        E1EDKA1: {
            PARVW: 'AG', // Sold-to party
            PARTN: 'CUST001'
        }
    }
});

Usage - Execute BAPI:

const result = connector.execute('send', {
    bapi_name: 'BAPI_CUSTOMER_CREATEFROMDATA',
    parameters: {
        CUSTOMERDATA: {
            CUSTOMER: 'CUST001',
            NAME: 'Acme Corporation',
            STREET: '123 Main St',
            CITY: 'New York',
            POSTL_CODE: '10001',
            COUNTRY: 'US'
        }
    }
});

Usage - Execute RFC:

const result = connector.execute('send', {
    rfc_name: 'RFC_READ_TABLE',
    parameters: {
        QUERY_TABLE: 'MARA',
        FIELDS: ['MATNR', 'MAKTX'],
        OPTIONS: [{TEXT: "MATNR LIKE 'MAT%'"}]
    }
});

Parameters:

  • idoc_type (string, optional): IDoc type (e.g., ORDERS05, INVOIC02, DELVRY03).
  • idoc_data (array, optional): IDoc data structure. Format depends on the IDoc type.
  • bapi_name (string, optional): BAPI function name (e.g., BAPI_CUSTOMER_CREATEFROMDATA).
  • rfc_name (string, optional): RFC function name (e.g., RFC_READ_TABLE).
  • parameters (array, optional): Parameters for BAPI/RFC functions.

Response Format:

{
    success: true,
    message: 'IDoc sent successfully',
    idoc_number: '0000000000123456', // IDoc number (for IDoc)
    result: [...] // BAPI/RFC response
}

2. Receive Data (receive)

Receive IDoc documents or retrieve data via BAPI/RFC.

Usage - Receive IDoc:

const result = connector.execute('receive', {
    idoc_number: '0000000000123456', // Specific IDoc number
    idoc_type: 'ORDERS05', // Optional, filter by type
    status: '03' // Optional, filter by status (03 = processed)
});

Usage - Execute BAPI Query:

const result = connector.execute('receive', {
    bapi_name: 'BAPI_CUSTOMER_GETDETAIL',
    parameters: {
        CUSTOMERNO: 'CUST001'
    }
});

Usage - Execute RFC Query:

const result = connector.execute('receive', {
    rfc_name: 'RFC_READ_TABLE',
    parameters: {
        QUERY_TABLE: 'KNA1',
        FIELDS: ['KUNNR', 'NAME1', 'ORT01'],
        OPTIONS: [{TEXT: "LAND1 = 'US'"}]
    }
});

Parameters:

  • idoc_number (string, optional): Specific IDoc number to retrieve.
  • idoc_type (string, optional): Filter IDocs by type.
  • status (string, optional): Filter IDocs by status.
  • bapi_name (string, optional): BAPI function name for query operations.
  • rfc_name (string, optional): RFC function name for query operations.
  • parameters (array, optional): Parameters for BAPI/RFC functions.

Response Format:

{
    success: true,
    message: 'IDoc retrieved successfully',
    idoc_data: [...], // IDoc data structure
    record_count: 1
}

3. Execute Method (execute)

Execute SAP ECC methods or perform advanced operations.

Usage - Execute Custom Method:

const result = connector.execute('execute', {
    method: 'Z_CUSTOM_METHOD',
    parameters: {
        param1: 'value1',
        param2: 'value2'
    }
});

Parameters:

  • method (string, required): Method name to execute.
  • parameters (array, optional): Parameters for the method.

Response Format:

{
    success: true,
    result: [...] // Response depends on the specific method
}

4. Test Connection (test)

Test the connection and authentication to SAP ECC.

Usage:

const result = connector.execute('test', []);

Response Format:

{
    success: true,
    message: 'SAP ECC connection test successful',
    details: {
        base_url: 'https://sap-ecc.example.com:8000',
        client: '100',
        api_type: 'idoc'
    }
}

Connector Features

Authentication

  • Basic Authentication: Uses username/password for authentication.
  • SAP-Specific Authentication: Supports SAP-specific authentication methods when required.
  • Encrypted Storage: Password is stored encrypted in the database.

SAP ECC Operations

  • IDoc Processing: Send and receive IDoc documents for document-based integration.
  • BAPI Execution: Execute Business Application Programming Interface (BAPI) functions.
  • RFC Calls: Perform Remote Function Calls (RFC) for data retrieval and processing.
  • Legacy System Support: Designed for legacy SAP ECC systems.

Connector Limitations

Legacy System

  • SAP ECC is Legacy: SAP ECC is a legacy system. Consider migrating to SAP S/4HANA for modern integrations.
  • Specialized Libraries: RFC execution may require specialized SAP libraries (e.g., SAP RFC SDK).
  • IDoc Format: IDoc processing requires SAP-specific XML formats and structures.

RFC Support

  • Additional Libraries: RFC execution may require additional SAP libraries (e.g., SAP RFC SDK, SAP .NET Connector).
  • HTTP Access: Not all SAP systems expose RFC via HTTP. Some may require direct SAP connection or SAP Gateway.
  • Configuration Required: RFC access may require special SAP configuration (e.g., RFC destinations, user authorizations).

Rate Limits

  • SAP ECC Rate Limits: SAP ECC systems have rate limits on API requests.
  • Exceeding Limits: Exceeding rate limits may result in errors or connection issues.
  • No Automatic Retries: The connector does not automatically implement exponential backoff or retry logic for rate limit errors. Implement this in your ProcessFlow if needed.

IDoc Complexity

  • IDoc Structure: IDoc structures are complex and vary by IDoc type.
  • IDoc Knowledge: Requires knowledge of SAP IDoc types and their segment structures.

Error Handling

All operations return a standardized error format on failure:

{
    success: false,
    error: 'Error message',
    execution_id: 'uuid',
    processing_time_ms: 123
}

Common Error Scenarios

  • Authentication Failure: Invalid username or password, or user doesn't have appropriate authorizations.

    • Solution: Verify credentials and ensure the user has appropriate SAP authorizations.
  • Invalid IDoc Type: IDoc type doesn't exist or is not configured in SAP.

    • Solution: Verify the IDoc type and ensure it's configured in your SAP system.
  • Invalid BAPI/RFC: BAPI or RFC function name doesn't exist or is not accessible.

    • Solution: Verify the BAPI/RFC function name and ensure it's available in your SAP system.
  • IDoc Format Error: IDoc data doesn't match the required structure.

    • Solution: Review SAP IDoc documentation and ensure the data structure matches the IDoc type.
  • RFC Not Available: RFC execution is not available via HTTP.

    • Solution: Consult your SAP administrator for RFC access configuration or use IDoc/BAPI instead.
  • Connection Timeout: Network issues or extremely long processing times.

    • Solution: Increase timeout_seconds or check network connectivity.

Best Practices

  1. Secure Credentials: Never expose password in code, logs, or version control. Store it securely and rotate regularly.

  2. Dedicated API User: Create a dedicated SAP user for API access with appropriate authorizations (principle of least privilege).

  3. Use IDoc for Documents: Prefer IDoc for document-based integration (orders, invoices, deliveries).

  4. Use BAPI for Business Logic: Use BAPI for business logic operations that require SAP's built-in validation and processing.

  5. RFC Considerations: If using RFC, ensure proper SAP configuration and library availability.

  6. IDoc Knowledge: Familiarize yourself with SAP IDoc types and their segment structures before integration.

  7. Error Handling: Always check the success field in responses and implement robust error handling.

  8. Connection Testing: Use the test operation to verify configuration before production deployment.

  9. Migration Planning: Consider migrating to SAP S/4HANA for modern integrations and better API support.

  10. Rate Limit Handling: Implement exponential backoff and retry logic for rate limit errors.

SDK Requirements

This connector uses direct HTTP API calls to SAP ECC's IDoc, BAPI, or RFC endpoints. For RFC execution, additional SAP libraries (e.g., SAP RFC SDK) may be required, and direct SAP connection may be necessary. Consult your SAP administrator for RFC access configuration.

API Documentation

For detailed API documentation, see: