on 08-29-2018 10:17 PM
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?
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:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.