cancel
Showing results for 
Search instead for 
Did you mean: 

Which parameters to use when using API_CV_ATTACHMENT_SRV to upload attachments in S/4?

pratyusha1306
Member

We're trying to upload a pdf to a vendor master as an attachment in our S/4 system.The example provided in SAP API business hub uses only Content and MimeType (no LinkedSAPObjectKey or BusinessObjectTypeName) in the body for the "Attachment Content Set" function and when testing the API on postman we get the error 'Attachment Name cannot be empty'. Is there any detailed documentation or working example for this API?

eldhosemathew
Explorer
0 Kudos

Were you able to resolve this ? Even I am facing similar issue with Supplier Invoice attachment. Not sure what to pass to the API.

Accepted Solutions (1)

Accepted Solutions (1)

jeff_2022
Explorer

I know this is likely too late for your question, but in case someone comes across this error "Attachment Name cannot be empty". I got through it by adding the Slug Header parameter = "test.pdf" or whatever, then in your call to AttachmentContentSet make sure you list Slug as one of the Request Headers:

Jaman
Participant
0 Kudos

Hello Experts,

Passing the file name in Slag Header Parameter works fine with POSTMAN.How do we pass the same using ABAP code.

I have created service consumption model in ABAP cloud and calling remote proxy method.

" Navigate to the resource and create a request for the create operation

lo_request = lo_client_proxy->create_resource_for_entity_set( 'ATTACHMENTCONTENTSET' )->create_request_for_create( ).

" Set the business data for the created entity

lo_request->set_business_data( ls_business_data ).

" Execute the request

lo_response = lo_request->execute( ).

After executing the request, I am getting the error

Thanks,

Ahamed

Answers (1)

Answers (1)

gregorw
Active Contributor
0 Kudos

Hi pratyusha1306 and eldhosemathew,

the documentation Create Attachment Content describes what header parameters must be set. Maybe you give that a try.

Best regards
Gregor

mario_fliegner
Explorer
0 Kudos

Hi,
I'm facing the same issue but in addition, if I try to follow the link, I can logon with my Universal Id, that's fine... however, then it gives me a 403. So, what's the solution? 🙂

gregorw
Active Contributor
0 Kudos

Hi maf1981,

I've updated the link.

CU
Gregor