Order Data from SD
Optional scope: the order behind the receivable — and the purchase order number the customer is searching for.
The bridge sits on the line item itself: SalesDocument, SalesDocumentItem and BillingDocument are properties of the open item. A detour through the document flow is unnecessary, which means the order scope adds two extra reads and not a second project.
What's delivered
| Bilendo | SAP | Why |
|---|---|---|
| Custom Field "Order" | SalesDocument (on the item) | The number used for internal searches. |
| Custom Field "Purchase Order Number" | A_SalesOrder.PurchaseOrderByCustomer | The number the CUSTOMER's accounting department searches for — the most common reason an invoice is "not recognized." |
| Custom Field "Order Date" | A_SalesOrder.SalesOrderDate / CustomerPurchaseOrderDate | The time reference for a complaint. |
external_sales_unit | A_SalesOrder.SalesOrganization | Sales organization. |
| Custom Field "Item Text" | A_SalesOrderItem.SalesOrderItemText / Material | What was delivered. |
| Custom Field per partner role | A_SalesOrderHeaderPartner | Sold-to party, ship-to party, bill-to party, and payer can be four different addresses. |
| Custom Field "Invoice Type" | A_BillingDocument.BillingDocumentType | Invoice, credit memo, cancellation. |
How it's read
Subordinate, and only for known numbers: first the items, then in groups the orders and invoices they reference. An order that no open item references is never fetched.
Not every receivable has an order: manual FI postings, credit memos, and interest charges carry no SD number. The scope is empty for this part — that's not an error.
The invoice PDF is a separate decision: the billing document service can deliver it, but that turns an attribute into a file transfer, with volume, storage location, and retention period.