Symptom
Error 'File is either corrupted or file format not supported for upload' is encountered while calling API_CV_ATTACHMENT_SRV/AttachmentContentSet in CPI iFlow to upload attachment to supplier invoice.
Environment
- SAP S/4HANA Cloud Public Edition
- SAP CLOUD PLATFORM INTG SUITE
Reproducing the Issue
Use the iFlow in CPI to call API_CV_ATTACHMENT_SRV/AttachmentContentSet in order to upload attachment to supplier invoice.
Cause
CPI OData Adapter cannot be used for API_CV_ATTACHMENT_SRV to post attachment. More details can be found in below Community Blog:
SAP Cloud Integration: HTTP vs. OData Receiver Adapter
"However, in some specific cases, a non-XML message body is inevitable. This is for example the case if you want to post an attachment using the "AttachmentContentSet" entity of the "API_CV_ATTACHMENT_SRV" service, which requires the payload to be a binary string. Attempting to send an XML body will lead to the following error: "com.sap.gateway.core.ip.component.odata.exception.OsciException: Bad Request : 400 : HTTP/1.1". In this case, the HTTP adapter provides the necessary flexibility regarding content-types."
Resolution
To handle binary payload within CPI while calling API_CV_ATTACHMENT_SRV, refer to Community Blog - API_CV_ATTACHMENT_SRV - Attach PDF document to Supplier Invoice.
See Also
Help documentation - API_CV_ATTACHMENT_SRV/AttachmentContentSet
Community Blog - API_CV_ATTACHMENT_SRV - Attach PDF document to Supplier Invoice
Community Blog - API_CV_ATTACHMENT_SRV/AttachmentContentSet - pdf content is not passed
Keywords
API_CV_ATTACHMENT_SRV, SAP Integration Suite, Supplier Invoice, File format not supported, OData Adapter. , KBA , CA-DMS , Document management , LOD-HCI-PI-CON-HTP , HTTP Adapter , Problem
SAP Knowledge Base Article - Public