on ‎2024 Aug 14 9:26 PM
Assistance with retrieving and downloading attachment folder data from an attachment folder using the web service ManageAttachmentFolderIn or the BusinessObject AttachmentFolder.
Could you please provide guidance on how to achieve this scenario?
Request clarification before answering.
Dear,
Hope all is well.
To retrieve the data using the ManageAttachmentFolderIn service interface, the document UUID of the attachment document is required. In order to gather this UUID, an initial query to the service interface of the business object needs to be performed, which will query all attachments of that specific object and their respective UUID. Then this can be used to query the attachment as a binary object using the attachment folder interface.
For example:
To retrieve the attachment data of the Material ABC, you can perform a query for the material using the service interface "QueryMaterialIn" with the example payload below:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global">
<soapenv:Header/>
<soapenv:Body>
<glob:MaterialByElementsQuery_sync>
<RequestedElements>
<Material>ABC</Material>
</RequestedElements>
</glob:MaterialByElementsQuery_sync>
</soapenv:Body>
</soapenv:Envelope>
*Where ABC refers to the Material ID*
In the response payload, you can search for the UUID under the Attachment Folder field in the payload.
Once the UUID of the document is located, you can use the UUID of the document to retrieve the Attachment data.
For retrieving the data, you can perform a query using the ManageAttachmentFolderIn with the operation ReadDocumentsFileContent, using the example below.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global">
<soapenv:Header/>
<soapenv:Body>
<glob:AttachmentFolderDocumentsFileContentByIDQuery_sync>
<AttachmentFolderDocumentFileContentByIDQuery>
<!--Zero or more repetitions:-->
<DocumentUUID>CDF</DocumentUUID>
</AttachmentFolderDocumentFileContentByIDQuery>
</glob:AttachmentFolderDocumentsFileContentByIDQuery_sync>
</soapenv:Body>
</soapenv:Envelope>
*Where CDF refers to the Document UUID retrieved in the previous query.*
*The examples above where taken from our internal systems, therefore the headers must be adjusted for your respective WSDL .*
In the response payload, you will receive the Binary Object of the attachment.
In this case, a Base64 decoder will be required to convert the data into the Original file.
Please refer to the below blog and Web Service documentation, which provide more insights on the matter.
Inbound Service Manage Attachment Folders
Read and Write ByDesign Attachments using Web Services
Regards,
Vinicius
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.