SAP Service Layer (Purchases) icon

SAP Service Layer (Purchases)

Todas las entidades de Purchases de SAP Service Layer

Overview

This node integrates with the SAP Service Layer to manage purchase-related documents in SAP Business One. Specifically, for the Purchase Invoice resource and the Create Cancellation operation, it allows users to create a cancellation document for an existing purchase invoice identified by its DocEntry.

This is useful in scenarios where a purchase invoice needs to be reversed or canceled due to errors, returns, or other business reasons. Automating this process via n8n helps streamline financial workflows and maintain accurate accounting records.

Example use case:
A company receives a purchase invoice but later discovers discrepancies in the billed amount. Using this node, they can programmatically create a cancellation document for that invoice in SAP, ensuring the invoice is properly voided without manual intervention.


Properties

Name Meaning
DocEntry The unique identifier (number) of the purchase invoice to cancel. This is required.

Output

The node outputs the JSON response returned by the SAP Service Layer API after attempting to create the cancellation document. This typically includes details about the newly created cancellation document or error information if the operation failed.

  • The output is structured as a JSON object under the json field.
  • If the operation succeeds, the JSON contains confirmation and metadata about the cancellation.
  • If an error occurs, the JSON contains an error field with the error message.

The node does not output binary data.


Dependencies

  • Requires connection credentials to the SAP Service Layer API, including:

    • Base URL of the SAP Service Layer endpoint
    • Username and password for authentication
    • Company database name
  • The node performs a login request to obtain session cookies used for subsequent API calls.

  • No additional external dependencies beyond access to the SAP Service Layer API.


Troubleshooting

Common Issues

  • Authentication failure: Incorrect username, password, or company database will cause login to fail.
  • Invalid DocEntry: Specifying a non-existent or incorrect DocEntry will result in an error from the SAP API.
  • Permission issues: The user account may lack permissions to create cancellation documents.
  • Network or SSL errors: Connection problems or invalid SSL certificates may cause request failures.

Error Messages and Resolutions

  • "Unauthorized" or login errors: Verify credentials and company database are correct.
  • "Not Found" or similar on the purchase invoice: Check that the DocEntry corresponds to an existing purchase invoice.
  • API error messages in the JSON output: Review the error message for specific SAP Service Layer issues; consult SAP documentation if needed.
  • SSL certificate errors: Ensure the SAP Service Layer endpoint uses a valid certificate or configure n8n to allow self-signed certificates if appropriate.

Links and References

Discussion