PlantScanner - SAP Service Layer icon

PlantScanner - SAP Service Layer

Interact with SAP Service Layer API

Actions26

Overview

This node interacts with the SAP Service Layer API to retrieve, create, update, and manage various SAP resources. Specifically, for the Inventory Gen Entry resource with the Get All operation, it fetches multiple inventory generation entry records from SAP, supporting filtering, pagination (skip), field selection, and expansion of related entities.

Typical use cases include:

  • Retrieving all inventory generation entries that match certain criteria, such as entries from a specific warehouse or within a date range.
  • Integrating SAP inventory data into workflows for reporting, auditing, or synchronization with other systems.
  • Automating inventory management processes by fetching relevant inventory entry data dynamically.

Example: Fetch all inventory generation entries created after March 20, 2024, skipping the first 10 records, selecting only the EntryNo, WarehouseCode, and CreationDate fields, and expanding related document lines.

Properties

Name Meaning
Filters OData filter string to narrow down results, e.g., WarehouseCode eq 'WH001' or CreationDate ge '2024-03-20'. Optional.
Skip Number of records to skip in the result set (pagination). Optional; defaults to 0.
Select Comma-separated list of fields to include in the response. Leave empty to get all fields. Example: EntryNo, WarehouseCode, CreationDate. Optional.
Expand Comma-separated list of related entities to expand in the response. Example: DocumentLines, Attachments2. Optional.

Output

The output is an array of JSON objects representing inventory generation entry records retrieved from SAP. Each object contains fields corresponding to the selected properties or all fields if none were specified.

Example structure of one item in the output json array:

{
  "EntryNo": 12345,
  "WarehouseCode": "WH001",
  "CreationDate": "2024-04-01T12:00:00",
  "DocumentLines": [ ... ],          // If expanded
  "Attachments2": [ ... ]            // If expanded
  // Other fields depending on selection
}

The node does not output binary data for this operation.

Dependencies

  • Requires connection credentials to the SAP Service Layer API, including URL, company database name, username, password, and optionally language.
  • Uses HTTPS requests with disabled SSL certificate verification (rejectUnauthorized: false).
  • The node logs in to SAP Service Layer at runtime to obtain a session cookie used for subsequent API calls.
  • No additional external dependencies beyond standard HTTP client libraries bundled with n8n.

Troubleshooting

  • Failed to get session cookie: Indicates login to SAP Service Layer failed. Check credentials (URL, company DB, username, password) and network connectivity.
  • Operation not supported: Occurs if an unsupported operation or resource is requested. Verify that the resource is inventoryGenEntry and operation is getAll.
  • OData filter syntax errors: Invalid filter strings may cause API errors. Ensure filters follow correct OData syntax.
  • Empty or incomplete results: May be due to incorrect filters, skip values, or select/expand parameters. Adjust these inputs accordingly.
  • SSL issues: The node disables SSL verification; if your environment requires strict SSL, this might cause connection problems.
  • API rate limits or timeouts: Large data requests may time out or hit SAP API limits. Use filters and skip parameters to paginate results.

Links and References


This summary covers the static analysis of the node's execute method for the Inventory Gen Entry resource with the Get All operation, based solely on the provided source code and property definitions.

Discussion