> ## Documentation Index
> Fetch the complete documentation index at: https://help.owlery.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Writing Back to SAP S/4HANA

> How Owlery returns selected carrier, quote-number, and freight results to approved SAP services.

SAP S/4HANA write-back is optional and deployment-specific. Owlery studies the available partner, text, and pricing services, recommends the supported actions, and enables only the approved workflow.

<Info>
  Your team confirms the intended SAP outcome. Owlery configures the strategies, validates source documents and item identities, and monitors the writes.
</Info>

## Available tender-result actions

| Owlery result                             | SAP action                                                 |
| ----------------------------------------- | ---------------------------------------------------------- |
| Carrier selected for a sales order        | Validate SCAC and update the item-level ship-via partner   |
| Carrier selected for purchase or transfer | Validate SCAC and create or update the approved PO partner |
| Quote selected for a sales order          | Write the Owlery quote number to sales-order item text     |
| Quote selected for purchase or transfer   | Create or update approved purchase-order item text         |
| Freight selected for a sales order        | Create or replace the approved item pricing condition      |
| Freight selected for purchase or transfer | Create or update the approved PO item pricing condition    |

## Exact freight allocation

One tender can cover multiple SAP-derived shipments. Owlery first allocates the quote across Owlery orders, then across SAP items using available weights. Residual-aware rounding ensures the values written across every item equal the selected tender amount exactly.

## Validation before writing

Owlery validates:

* Document-number formats
* Supported order types
* Source item identities
* Quote availability
* Item weights when allocation requires them
* Carrier codes when a SCAC is recorded
* Availability and permissions of the approved SAP service

## Safe writes by design

* Each carrier, quote-number, and quote-amount action is independently enabled.
* Source records and item identities are loaded before updates.
* Multi-order and multi-item allocations must reconcile exactly.
* Validation errors stop the affected action instead of being blindly retried.
* The exact partner, text, and pricing services are documented for the deployment.
