> ## 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 List Attachments

> Lists the files attached to a SAP business object, with the keys needed to fetch them.

Lists the files attached to any SAP business object, through `API_CV_ATTACHMENT_SRV`. Display name **"SAP List Attachments"**. Off by default.

## Authentication and enablement

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

## Naming the object

Two forms, and exactly one of them per call:

| Field | Notes |
| - | - |
| `business_object_type` + `object_key` | `object_key` is SAP's linked-object key, sent exactly as given. |

There is no shorthand. The tool composes no keys and defaults no object type — one that guessed either would list the attachments of the wrong document. Build the key from fixed-width parts with no separators, each zero-padded to its SAP width:

| Object | Key |
| - | - |
| `BUS2081` — supplier invoice | invoice number (10) + fiscal year (4) = 14 characters |
| `BKPF` — accounting document | company code (4) + document number (10) + fiscal year (4) = 18 characters |

Count the characters before sending. SAP answers a key that matches no document with an **empty list**, not an error, so a key short by one digit reads as "this document has no attachments".

## Outputs

`attachments` — each with `FileName`, `MimeType`, `FileSize`, `CreatedByUser`, `CreationDateTime`, and the key fields `sap_get_attachment` needs (`DocumentInfoRecordDocType`, `DocumentInfoRecordDocNumber`, `DocumentInfoRecordDocVersion`, `DocumentInfoRecordDocPart`, `LogicalDocument`, `ArchiveDocumentID`, `LinkedSAPObjectKey`, `BusinessObjectTypeName`) — plus `total`, `business_object_type` and `object_key`.

## Limits and errors

* An object with no attachments returns an empty list, not an error.
* A wrong or unpadded `object_key` also returns an empty list. That is SAP's behaviour, not a bug here — check the key before concluding there are no attachments.
* A deleted document refuses the call: SAP disables attachment handling once the document is gone.


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