cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
Read only

Using API_CV_ATTACHMENT_SRV/AttachmentContentSet

Sanya_Govil
Discoverer
0 Likes
1,971

Hi Experts,

I want to use sap mobile start and want to deploy the attachment service on BTP launchpad.

I had tried using standard attachmentReuseComponent but it didn't work in Cloud Foundry.

For this reason i am using API_CV_ATTACHMENT_SRV/AttachmentContentSet.

I am using UploadSet to attach file.

   
<upload:UploadSet
                id="UploadSet"
                instantUpload="true"
                showIcons="true"
                uploadEnabled="true"
                afterItemAdded="onAfterItemAdded"
                terminationEnabled="true"
                fileTypes="txt,doc,png"
                maxFileNameLength="30"
                maxFileSize="200"
                mediaTypes="text/plain,application/msword,image/png"           
                uploadUrl="/sap/opu/odata/SAP/API_CV_ATTACHMENT_SRV/AttachmentContentSet"
                items="{path: '/AttachmentContentSet', templateShareable: false}"
                mode="MultiSelect"
                selectionChanged="onSelectionChange">
            <upload:toolbar>
                <OverflowToolbar id="_IDGenOverflowToolbar1">
                    <ToolbarSpacer id="_IDGenToolbarSpacer1"/>                         
 
                    <upload:UploadSetToolbarPlaceholder id="_IDGenUploadSetToolbarPlaceholder1" />
                </OverflowToolbar>
            </upload:toolbar>
            <upload:items>
           
            <upload:UploadSetItem
id="_IDGenUploadSktItem1"
url="/sap/opu/odata/sap/API_CV_ATTACHMENT_SRV/AttachmentContentSet
(DocumentInfoRecordDocType='{DocumentInfoRecordDocType}',DocumentInfoRecordDocNumber='{DocumentInfoRecordDocNumber}',
DocumentInfoRecordDocVersion='{DocumentInfoRecordDocVersion}',
DocumentInfoRecordDocPart='{DocumentInfoRecordDocPart}',
LogicalDocument='{LogicalDocument}',
ArchiveDocumentID='{ArchiveDocumentID}',
LinkedSAPObjectKey='{LinkedSAPObjectKey}',
BusinessObjectTypeName='{BusinessObjectTypeName}')/$value"
>
</upload:UploadSetItem>
            </upload:items>
        </upload:UploadSet>
getCall.jpg

When I do get call, the result is coming empty. Anyone has used the standard API_CV_ATTACHMENT_SRV before ?This has to be deployed to cloud Foundry.

 

Accepted Solutions (0)

Answers (1)

Answers (1)

anoukvandenengel
Participant
0 Likes

Hi, I have recently been struggling to get tis API to work in SAP Cloud Integration. Eventually for me the solution was to put only the content of the attachment as a binary string in the message payload and to send the other information (BusinessObjectTypeName, LinkedSAPObjectKey, Slug, Content-Type) as headers. Hope it will work for you too...

saidanturti34
Discoverer
0 Likes

hi, I'm working on exact same requirement. Have you passed the binary converted PDF within the <Content> XML tag to send the attachment successfully? 
I've tried to pass the binary format of the PDF as body with required headers but that is failing with "Request Payload Parsing Failed for one of the reason: (1) Either the OData metadata content available in the server is outdated OR (2) The request payload seems to be incorrect"

Ask a Question