Academy
ERP Connectors

ERP Integration: SAP S/4HANA

SAP S/4HANA is SAP’s enterprise-level ERP platform, used by large organizations for integrated management of finance, logistics, purchasing, sales, and controlling. Integration is done via OData APIs provided natively by the system.

This article guides you through preparing the SAP environment, configuring the credential, and details the reports available from this connector. For the step-by-step guide to using it in the data preparation flow — connector selection, credential, report, and parameters — see the ERP Step article.


Preparing the SAP environment — services and authorizations

The integration consumes SAP S/4HANA’s standard OData APIs, which are delivered inactive for security reasons. Three actions by the team that administers SAP (Basis/security) prepare the environment:

1. Activate the OData services

In transaction /n/IWFND/MAINT_SERVICE (Activate and Maintain Services), activate the services corresponding to the reports that will be used:

Report

OData Service

Accounting Balance (Trial Balance)

C_GLACCOUNTBALANCEQUERY_CDS / C_GLACCOUNTBALANCEQUERY

General Ledger Trial Balance (Trial Balance)

C_TRIALBALANCE_CDS / C_TRIALBALANCE

Business Partners

API_BUSINESS_PARTNER

Purchase Orders

API_PURCHASEORDER_PROCESS_SRV

Sales Orders

API_SALES_ORDER_SRV

Vendor Invoices

API_SUPPLIERINVOICE_PROCESS_SRV

Products / Materials

API_PRODUCT_SRV

Material Documents

API_MATERIAL_DOCUMENT_SRV

Material Classification

API_CLFN_PRODUCT_SRV

Cost Centers

API_COSTCENTER_SRV

Profit Centers

API_PROFITCENTER_SRV

For the trial balance, the two confirmed services are C_TRIALBALANCE_CDS / C_TRIALBALANCE and C_GLACCOUNTBALANCEQUERY_CDS / C_GLACCOUNTBALANCEQUERY — the latter is common in environments with SAP Fiori.

In addition to the report services, the SAP Gateway catalog service (/IWFND/CATALOGSERVICE;v=2) must be accessible — this is how the platform discovers the services available in the environment.

The endpoint pattern is https://{host}:{porta}/sap/opu/odata/sap/{SERVICE}. The public documentation for each API is available on SAP Business Accelerator Hub, and the activation step-by-step guide is on SAP Help Portal.

How to activate a service

In transaction /n/IWFND/MAINT_SERVICE, check whether the service is active. If it is not:

  1. Click Add Service.

  2. Under System Alias, enter LOCAL.

  3. Search for the service name (for example, C_GLACCOUNTBALANCEQUERY_CDS).

  4. Select it and confirm.

  5. Test in the browser: https://{host}:{porta}/sap/opu/odata/sap/{SERVICE}/$metadata.

The link should open and display the metadata XML. Use a user with permission to access the service and, if necessary, assign the authorizations.

2. Authorize the integration user

  • Create a dedicated system/communication user for the integration (not a person’s dialog user).

  • Grant the SAP Gateway runtime authorizations (objects /IWFND/* and /IWBEP/*) and execution authorization for the activated services (object S_SERVICE).

  • Grant the business authorizations for the data in each report (for example, the FI objects for the trial balances), following the principle of least privilege — only the reports that will be consumed.

3. Expose the endpoint securely

The platform accesses SAP through outbound HTTPS calls, read-only. If S/4HANA is not internet-accessible, the connection is made through firewall opening or a site-to-site VPN/VPC — contact Dattos support to configure it together.

Use of middleware

The integration can use middleware between the platform and SAP Gateway, as long as it operates in pass-through mode (bypass), without altering the request or the response.

The following must be preserved:

  • the HTTP method;

  • the URL, route, and parameters;

  • the headers;

  • the request and response bodies;

  • the status codes;

  • the data format;

  • SAP Gateway error messages.

The middleware can be used for security and infrastructure functions such as authentication, authorization, access control, network policies, logs, monitoring, certificates, rate limiting, and IP restriction. Authentication must use one of the modes supported by the integration, validated by the middleware or forwarded to SAP Gateway.

If the middleware requires an authentication type that is not yet supported by the integration, contact Dattos support.


Credential Configuration

SAP S/4HANA supports two authentication methods. Choose the one enabled in your environment:

Option 1 — SAP Basic Login (username and password)

Field

Description

Required

Host

SAP server base URL (e.g.: https://meu-sap.empresa.com)

Yes

System Number

SAP system number (e.g.: 00)

Yes

Client

SAP client code (e.g.: 100)

Yes

User

SAP integration user

Yes

Password

User password

Yes

Option 2 — SAP OAuth 2.0

Field

Description

Required

Host

SAP server base URL

Yes

Client ID

OAuth client ID registered in SAP

Yes

Client Secret

OAuth client secret

Yes

Token URL

OAuth token generation endpoint URL

Yes

Grant Type

Grant type (usually client_credentials)

No

Tip: The SAP integration user must be authorized in the authorization objects of the OData APIs that will be used (e.g.: /IWFND/ and /IWBEP/).


Available Reports

Module: Materials


Products / Materials

Returns the product and material master data registered in SAP.

Filter parameters:

Parameter

Description

Required

ProductType

Product type (e.g.: FERT, ROH)

No

Plant

Plant code to filter associated products

No

Returned fields:

Field

Description

Product

Product code

ProductType

Product type

ProductGroup

Product group

BaseUnit

Base unit of measure

GrossWeight

Gross weight

NetWeight

Net weight

WeightUnit

Weight unit

Division

Division


Material Documents

Returns material movement documents (receipts, issues, physical transfers).

Filter parameters:

Parameter

Description

Required

MaterialDocumentYear

Material document year (4 digits)

No

Plant

Plant code

No

Returned fields:

Field

Description

MaterialDocument

Material document number

MaterialDocumentItem

Document item

PostingDate

Posting date

Material

Material code

Plant

Plant

Quantity

Moved quantity

UnitOfEntry

Entry unit

StorageLocation

Storage location

MaterialDocumentYear

Document year


Material Classification

Returns material classification by class type.

Filter parameters:

Parameter

Description

Required

KeyDate

Reference date for classification (format YYYY-MM-DD). Filled automatically with the reference date

Yes

ClassType

Class type (max. 3 characters)

No

Returned fields:

Field

Description

Material

Material code

ClassType

Class type

Class

Class

KeyDate

Classification key date

ClassificationStatus

Classification status


Module: Business Partners


Business Partners

Returns customers, vendors, and partners registered in SAP.

Filter parameters:

Parameter

Description

Required

Options

BusinessPartnerCategory

Partner category

No

1 = Person, 2 = Organization, 3 = Group

Returned fields:

Field

Description

BusinessPartner

Partner code

BusinessPartnerCategory

Category (person/organization/group)

BusinessPartnerFullName

Full name

SearchTerm1

Search term

BusinessPartnerGrouping

Grouping

CreationDate

Creation date


Module: Purchasing


Purchase Orders

Returns purchase orders issued in SAP.

Filter parameters:

Parameter

Description

Required

CompanyCode

Company code (4 characters)

No

CreationDate

Creation date (format YYYY-MM-DD). Filled automatically with the reference date

No

Returned fields:

Field

Description

PurchaseOrder

Purchase order number

CompanyCode

Company code

CreationDate

Creation date

Supplier

Supplier code

PurchasingOrganization

Purchasing organization

PurchaseOrderType

PO type

TotalNetOrderAmount

Total net amount

DocumentCurrency

Document currency


Module: Sales


Sales Orders

Returns the sales orders registered in SAP.

Filter parameters:

Parameter

Description

Required

CreationDate

Order creation date (format YYYY-MM-DD). Filled automatically with the reference date

No

SalesOrganization

Sales organization code (4 characters)

No

Returned fields:

Field

Description

SalesOrder

Sales order number

SalesOrderType

Order type

CreationDate

Creation date

SalesOrganization

Sales organization

SoldToParty

Customer (sold-to)

TotalNetAmount

Total net amount

TransactionCurrency

Transaction currency


Module: Accounts Payable


Vendor Invoices

Returns vendor invoices (incoming invoices) posted in SAP.

Filter parameters:

Parameter

Description

Required

CompanyCode

Company code (4 characters)

No

FiscalYear

Fiscal year (4 digits)

No

Returned fields:

Field

Description

SupplierInvoice

Invoice number

FiscalYear

Fiscal year

CompanyCode

Company code

DocumentDate

Document date

PostingDate

Posting date

InvoicingParty

Invoicing party

InvoiceGrossAmount

Invoice gross amount

DocumentCurrency

Currency


Module: Accounting


Accounting Balance (Trial Balance)

Returns the accounting trial balance by account and fiscal period.

Filter parameters:

Parameter

Description

Required

P_Ledger

Accounting ledger (default: 0L — leading ledger)

Yes

P_CompanyCode

Company code(s). Accepts multiple values

Yes

P_FiscalYear

Fiscal year. Filled automatically with the year of the reference date

Yes

P_FiscalPeriod

Fiscal period (month). Filled automatically with the month of the reference date

Yes

P_FromPostingDate

Start posting date. Filled automatically (1st of the reference month)

Yes

P_ToPostingDate

End posting date. Filled automatically (last day of the reference month)

Yes

Returned fields:

Field

Description

CompanyCode

Company code

GLAccount

General ledger account

GLAcctLineDescription

Account description

FiscalYear

Fiscal year

FiscalPeriod

Fiscal period

DisplayCurrency

Display currency

StartingBalAmtInDspCrcy

Opening balance

DebitAmountInDisplayCrcy

Debit amount

CreditAmountInDisplayCrcy

Credit amount

EndingBalAmtInDspCrcy

Closing balance


General Ledger Trial Balance (Trial Balance)

Returns the general ledger trial balance with balances by account and period.

Filter parameters:

Parameter

Description

Required

Ledger

Accounting ledger (default: 0L)

Yes

CompanyCode

Company code(s). Accepts multiple values

Yes

P_FromPostingDate

Start date. Filled automatically (1st of the reference month)

Yes

P_ToPostingDate

End date. Filled automatically (last day of the reference month)

Yes

Returned fields:

Field

Description

CompanyCode

Company code

GLAccount

General ledger account

StartingBalanceAmtInCoCodeCrcy_F

Opening balance (company currency)

DebitAmountInCoCodeCrcy_F

Debits for the period

CreditAmountInCoCodeCrcy_F

Credits for the period

EndingBalanceAmtInCoCodeCrcy_F

Closing balance

DebitCreditCodeName

Nature indicator (D/C)

FiscalYear

Fiscal year

FiscalPeriod

Fiscal period


Module: Controlling


Cost Centers

Returns the master data for cost centers configured in SAP.

Filter parameters:

Parameter

Description

Required

CompanyCode

Company code

No

Returned fields:

Field

Description

CostCenter

Cost center code

CompanyCode

Company code

CostCenterName

Cost center name

CostCenterCategory

Category

ValidityStartDate

Validity start

ValidityEndDate

Validity end

ResponsibleUser

Responsible user


Profit Centers

Returns the master data for profit centers.

Filter parameters:

Parameter

Description

Required

CompanyCode

Company code

No

Returned fields:

Field

Description

ProfitCenter

Profit center code

ProfitCenterName

Profit center name

CompanyCode

Company code

ValidityStartDate

Validity start

ValidityEndDate

Validity end

ProfitCenterStandardHierarchy

Standard hierarchy


Fixed Parameters (managed automatically)

These parameters are filled in automatically by the system and do not appear to the user:

Parameter

Default value

Reason

$top

5000

Controls the maximum number of records per request. High value to ensure complete data extraction

$select

(preconfigured field list)

Determines which fields are returned by the API. Predefined to bring only the data relevant to the report

P_CurrencyRole

10

Currency role for the trial balance (company currency)

P_DisplayAltvAcct

X

Displays alternate account in the trial balance

P_DspTimeDependentDesc

X

Displays time-dependent description in the trial balance


  • ERP Step

  • Introduction to integrations

  • Custom integrations via REST API and SQL connectors

Was this helpful?