To read the file content of one or multiple Documents within an Attachment Folder
Business Context and Use
The web service interface Read Documents File Content enables you to read the content of multiple attachment with one request.
To create attachments you need to use web service interfaces of the business object where you want to store the attachments.
Use web service interfaces of the business object where the attachments are stored (host object) to determine the key (UUID) and other information (e.g. type and name) of the attachments.
This service is used to read the actual document content.
In order to use the service you need to first create a communication scenario to specify for which host object you want to read the attachments. If you need to read attachments of different host object you will need to create several communication scenarios.
To get a technical user with the authorization to call this web service you need to create a communication arrangement for the above communication scenario.
The request message type contain two sub structures described below.
Contains one or multiple entries "DocumentUUID" which contains the UUID of the attachments which should be read.
The field QueryFileSizeMaximumNumberValue contains the limit for the sum of file sizes retrieved with one request. The unit is kB (1024 Bytes).
The response message type contains two sub structures described below.
This table contains the fields DocumentUUID and BinaryObject. The BinaryObject is the base64 encoded file content.
This structure contains the field MoreHitsAvailableIndicator which is true in case the size limit (as specified in the request) was exceeded and not all documents could be returned due to this.
This xml snippet reads the content of two attachments. The response will be restricted in a way that the total size of the returned files does not exceed 1MB (1024kB).
The size of the second document would have exceeded the specified limit. Therefore, it is not returned and MoreHitsAvailableIndicator is returned as true.
<n0:AttachmentFolderDocumentsFileContentByIDResponse_sync xmlns:prx="urn:sap.com:proxy:QCH:/1SAI/TAS443E8909F47F876ABE5F:804" xmlns:n0="http://sap.com/xi/SAPGlobal20/Global">
In case the returned BinaryObject is empty, there are 2 probable reasons: either the requested DocumentUUID is invalid, or the user with which the service was called does not have the required authorization to retrieve the document. This can also be the case when the document is attached to a host object that differs from the host object specified in the communication scenario.