cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAP - How to set HasStream="true" in a Entity or Service with OData CDS?

emorales
Explorer
0 Kudos
189
  • SAP Managed Tags:

I need to set this property in my entity because my SAP MDK application consumes the metadata generated by SAP CAP service and I need to create a media action, but I must have this property and I don't know how to set it.

View Entire Topic
mvaibhav
Contributor
0 Kudos

Adding the property @Core.MediaType in the entity will set hasStream=true in Entity

mvaibhav_3-1726677379277.png

 

mvaibhav_1-1726677126566.png

 

mvaibhav_2-1726677223097.png

Thanks,

Vaibhav Maheshwari

 

 

emorales
Explorer
0 Kudos

Hi @mvaibhav, I tried what you told me but it didn't work. The only change I saw is that it went from LargeBinary to Edm.Stream

 

emorales_0-1726679934559.png

This is the entity:

emorales_1-1726679957709.png

emorales_2-1726679969610.png

I use OData v4

 

 

 

mvaibhav
Contributor
0 Kudos

Hi @emorales

For Odata V4 , you will get it as Annotation at the end and not in entity.
The screen shot which I attached is for Odata V2. I am using CAP CDS version 7.0

mvaibhav_0-1726682607843.png

Thanks,

Vaibhav

 

emorales
Explorer
0 Kudos
Thank you very much! I have another question, when I upload a photo from my cell phone using the SAP MDK application, how can I use the "Media" action correctly? I can't upload a photo to my Hana database with the "Attachment" control.
mvaibhav
Contributor
0 Kudos

Hi @emorales

You will need to provide more details for the error you are getting on uploading.
Also, what is the approach that you are using for uploading the media.

I would suggest creating a separate Question for the issue providing the details.

 

Thanks,

Vaibhav Maheshwari