> ## Documentation Index
> Fetch the complete documentation index at: https://agents.nanonets.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# SAP Read Invoiced Items

> Reads the quantity and amount already invoiced against a SAP purchase order, per PO item.

Reads every posted supplier-invoice line that references a purchase order, grouped by PO item, from `A_SuplrInvcItemPurOrdRef`. Display name **"SAP Read Invoiced Items"**. Off by default.

## Authentication and enablement

Requires a workspace SAP integration. `base_url` and `authorization` are injected. Enable the tool and bind the integration.

## Inputs

| Field | Required | Notes |
| - | - | - |
| `purchase_order_number` | yes | The purchase order to read, e.g. `4500000001`. |
| `purchase_order_item` | — | Narrow to one PO item, e.g. `190`. Omit for every item on the order. |

## Outputs

`items[]`, one per PO item, each with `unit`, `currency`, `line_count` and the `lines[]` booked against it. Each line carries `supplier_invoice`, `fiscal_year`, `supplier_invoice_item`, `quantity`, `amount`, the goods receipt it was invoiced against (`reference_document`, `reference_document_item`), and what its own document is: `status` / `status_label`, `is_credit_memo`, `reverse_document`.

<Warning>
  There is no `invoiced_quantity` or `invoiced_amount`, by design. What a line contributes is a judgement — a credit memo subtracts, a **parked** document has not posted, a reversal pair cancels out, a subsequent debit carries value but no quantity — and one figure hid which way each went. Read the flags and decide.

  **Parked lines are included.** A duplicate check needs to see them; a received-minus-invoiced calculation must not count them. An older version of this page said only posted lines were returned, which would have had an agent count a parked invoice twice.
</Warning>

Pair it with `read_sap_grn` or `read_sap_material_documents` to get the **open quantity** — received minus the lines you decide are settled. That decides which PO item a new invoice line belongs to when the same material repeats across several items, and it is what stops a receipt being invoiced twice.

## Subsequent debit and credit lines

A line flagged `is_subsequent_debit_credit` adjusts the value of goods invoiced earlier. It carries value but no quantity against the PO item, so counting its quantity would make the item look more invoiced than it is and leave a real open quantity unbilled. The flag is reported; what to do with the line is yours.

## Limits and errors

* Reads to the end rather than taking a page: the answer is a sum, and a partial list is not a shorter answer but a wrong one. A runaway is bounded at 50 pages, and hitting that bound returns an **error-severity** message saying the totals are incomplete and too low — do not use them to decide what is open.
* A purchase order with nothing invoiced returns an empty `items` list, not an error.
* Parked invoices appear alongside posted ones, each line carrying its own status. A parked line has not reached the ledger, so count it when checking for a duplicate and leave it out when working out what is still open.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.