on 12-11-2018 5:30 AM
Hi
I am using the api to upload file to s4hana cloud, API_CV_ATTACHMENT_SRV to a supplier invoice document
in the entity /AttachmentContentset I'm trying to load
I find an error that tells me that in the name of the file can not be empty, knowing that in the structure I am reporting the name of the file
how can I load the pdf file and convert it to base64?
and where should I report the address of the file?
----------------------------Error response from api-------------
"error": {
"code": "SY/530",
"message": {
"lang": "en",
"value": "Attachment name cannot be empty"
},
--------------------------------------------------
the structure that I am using :
{ "DocumentInfoRecordDocType": "GOS",
"DocumentInfoRecordDocNumber": "EXT43",
"DocumentInfoRecordDocVersion": "",
"DocumentInfoRecordDocPart": "",
"LogicalDocument": "FA163E597C0",
"ArchiveDocumentID": "FA16B72DEB7C0",
"LinkedSAPObjectKey": "51056001902018",
"BusinessObjectTypeName": "BUS2081",
"SemanticObject": "",
"WorkstationApplication": "PDF",
"FileSize": "17408",
"FileName": "File.pdf",
"DocumentURL": "",
"MimeType": "application/pdf",
"Content": "", --------------------------------------------->>>>>>>>>>??????????????????????
"BusinessObjectType": "BUS2081",
"StorageCategory": "",
"ArchiveLinkRepository": ""
}
Thanks a lot. We appreciate your help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mario ,
I been in contact with the Development Team responsible for the API API_CV_ATTACHMENT_SRV and they have suggested an incident needs to be created with an example of the error you receive so they can debug it to see why its raised.
Please can you create an incident / support ticket on the component area CA-CMS so they can check the issue .
Thank you for your cooperation.
Enda.
Hello,
I am currently facing the same issue a year later.
Is there any update available on this issue?
Kind regards,
Matthias
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Mario
Could you please check the online documentation for the API API_CV_ATTACHMENT_SRV if you havent already ?
The parameters such as DocumentInfoRecordDocPart and DocumentInfoRecordDocNumber are mandatory but empty above
Thank you
Enda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi.
yes. I see the documentation of the api
but I found that it was necessary to add some parameters in the call of the api to be able to do the load
at the end the structure stayed like this:
/ sap / opu / odata / SAP / API_CV_ATTACHMENT_SRVAttachmentContentSet
-----------------------Body:--------------------------
{
"MimeType": "string",
"Content": ""
}
-------------------Header parameters ---------------
Slug = filename
Content-Type = tipe of file
BusinessObjectTypeName = 1234567892018 / num of doc supplier and year
LinkedSAPObjectKey = BUS2081 // for suplier invoice
But right now I'm faced with another problem loading the Png-type image file in base64 format
in body of the call
{
"MimeType": "image / png",
"Content": "iVBORw0KGg ................................... etc" // base64
}
in document of supplier invoice when i download the previously loaded image and when trying to open it I get format error
With what format should I convert the image?
Thaks and regards
Hi Mario ,
Im currently checking what format is needed when using the API .when i have more information il update you
Enda
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.