Skip to Content
0
Nov 17, 2022 at 08:32 AM

SAP MDK get image from backend via OData with Media Binding / Direct Rendering

740 Views Last edit Nov 17, 2022 at 03:26 PM 4 rev

Hello,

I want to retrieve an image from the backend via OData V2. I tried it with a new media entity (hasStream=“true“), but it wasn’t possible to read anything from that entity in the MDK. When setting it as the target of an Object Table, it didn’t show any entry even though there are 2 when reading the Set in the browser. Downloading the image in the browser with EntitySet(‚ID‘)/$value works too.

So I instead changed an entity I know worked to be a media entity. But this one still can’t show images in MDK. I created a new project with the CRUD template, which includes actions to retrieve media. And even there, it does not display any image.

The media entity was created in the style of this tutorial (https://blogs.sap.com/2018/06/22/media-handling-in-odata-in-sap-ui5/) and the actions are like in the ProductsImproved folders of the ImageHandlingApp from the cloud-mdk-samples (https://github.com/SAP-samples/cloud-mdk-samples). My images are of type PNG, which I set as Mimetype in the OpenDocument Action. My backend connection is with Cloud Connector.