SAP
Description
Section titled “Description”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)/).
Configuration
Section titled “Configuration”| Parameter | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | Configured SAP credential |
| operation | text | Yes | Operation: getBusinessPartners, getBusinessPartner, createBusinessPartner, updateBusinessPartner, getSalesOrders, getSalesOrder, createSalesOrder, getMaterials, getMaterial, getStock, getPurchaseOrders, createPurchaseOrder, getInvoices, executeRfc, odataQuery, odataCreate, odataUpdate, odataDelete |
| filter | text | No | OData filter (e.g.: BusinessPartnerCategory eq ‘1’) |
| select | text | No | Fields to return separated by comma |
| expand | text | No | Navigations to expand (e.g.: to_Item) |
| top | number | No | Maximum number of records (default: 100) |
| skip | number | No | Records to skip (pagination) |
| business_partner_id | text | Conditional | Business partner ID |
| sales_order | text | Conditional | Sales order number |
| material | text | Conditional | Material number |
| plant | text | No | Plant code |
| service_path | text | Conditional | OData service path (for generic queries) |
| entity_set | text | Conditional | OData entity set |
| function_name | text | Conditional | RFC/BAPI function name |
| parameters | json | No | RFC function parameters |
Credentials
Section titled “Credentials”Service type: sap. Stored in the servicecredentials table.
Configuration fields:
- server_url: SAP server base URL (e.g.: https://sap-server.empresa.com:443)
- username: SAP user
- password: SAP password
- Optionally: client, language
Output
Section titled “Output”{ "nextModule": null, "data": [ { "BusinessPartner": "10000001", "BusinessPartnerFullName": "Empresa ABC S.L.", "BusinessPartnerCategory": "2", "Industry": "MANU" } ], "_meta_": { "operation": "getBusinessPartners", "recordCount": 1, "executionTime": "250ms" }}Usage Example
Section titled “Usage Example”Basic case - Query business partners
Section titled “Basic case - Query business partners”{ "credentials_id": 1, "operation": "getBusinessPartners", "filter": "BusinessPartnerCategory eq '1'", "top": 50, "select": "BusinessPartner,BusinessPartnerFullName"}API Used
Section titled “API Used”- 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
Related Nodes
Section titled “Related Nodes”- 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