Skip to content

SAP

This module allows interacting with SAP systems through OData and RFC/BAPI. It supports operations with Business Partners (customers/suppliers), sales orders, purchase orders, materials, stock, invoices, generic OData queries and RFC/BAPI function execution via SOAP.

The module builds OData URLs with filter ($filter), select ($select), expand ($expand), sort ($orderby) and pagination ($top/$skip) parameters. For write operations, it automatically obtains the necessary CSRF token via a preliminary HEAD request. Dates are automatically formatted to SAP format (YYYYMMDD) and parsed from SAP format (/Date(timestamp)/).

ParameterTypeRequiredDescription
credentials_idcredentialsYesConfigured SAP credential
operationtextYesOperation: getBusinessPartners, getBusinessPartner, createBusinessPartner, updateBusinessPartner, getSalesOrders, getSalesOrder, createSalesOrder, getMaterials, getMaterial, getStock, getPurchaseOrders, createPurchaseOrder, getInvoices, executeRfc, odataQuery, odataCreate, odataUpdate, odataDelete
filtertextNoOData filter (e.g.: BusinessPartnerCategory eq ‘1’)
selecttextNoFields to return separated by comma
expandtextNoNavigations to expand (e.g.: to_Item)
topnumberNoMaximum number of records (default: 100)
skipnumberNoRecords to skip (pagination)
business_partner_idtextConditionalBusiness partner ID
sales_ordertextConditionalSales order number
materialtextConditionalMaterial number
planttextNoPlant code
service_pathtextConditionalOData service path (for generic queries)
entity_settextConditionalOData entity set
function_nametextConditionalRFC/BAPI function name
parametersjsonNoRFC function parameters

Service type: sap. Stored in the servicecredentials table.

Configuration fields:

{
"nextModule": null,
"data": [
{
"BusinessPartner": "10000001",
"BusinessPartnerFullName": "Empresa ABC S.L.",
"BusinessPartnerCategory": "2",
"Industry": "MANU"
}
],
"_meta_": {
"operation": "getBusinessPartners",
"recordCount": 1,
"executionTime": "250ms"
}
}
{
"credentials_id": 1,
"operation": "getBusinessPartners",
"filter": "BusinessPartnerCategory eq '1'",
"top": 50,
"select": "BusinessPartner,BusinessPartnerFullName"
}
  • SAP OData Services: Business Partner API, Sales Order API, Purchase Order API, Product API, Stock API, Invoice API
  • SAP RFC/BAPI via SOAP
  • Standard service paths: /sap/opu/odata/sap/API_BUSINESS_PARTNER/, /sap/opu/odata/sap/API_SALES_ORDER_SRV/, etc.
  • Write operations (POST/PATCH/DELETE) require a CSRF token that is obtained automatically
  • SAP dates in /Date(timestamp)/ format are automatically parsed to ISO 8601
  • Sales orders use type “OR” by default; purchase orders use type “NB”
  • Order items are automatically numbered in increments of 10 (10, 20, 30…)
  • Generic OData operations (odataQuery/odataCreate/odataUpdate/odataDelete) allow querying any SAP OData service
  • RFC execution builds a SOAP envelope and parses the XML response
  • Request timeout is 30 seconds (60 seconds for RFC)
  • SAP response data is extracted from the d.results or d structure depending on the format
  • Get Business Partners, Get Business Partner, Create Partner, Update Partner
  • Get Sales Orders, Get Sales Order, Create Sales Order
  • Get Materials, Get Material, Check Stock
  • Get Purchase Orders, Create Purchase Order, Get Invoices
  • Execute RFC/BAPI, OData Query, OData Create, OData Update, OData Delete