cancel
Showing results for 
Search instead for 
Did you mean: 

SAPUI5 Load src in sap.m.image from Stream/$value

former_member188973
Participant
0 Kudos

Hello Colleagues,

I would need some help with SAPUI5 sap.m.image and loading the image from a stream. My oData backend system is a ECC 6 EHP 8 with a service giving images from document management service by stream. I can get the data when pasting the complete URL in browser or Gateway Client. My big question is how to do this in WebIDE?
My oData looks like this:

{"d": {"results": [{"__metadata": {"id": "http://my.server.com:8018/sap/opu/odata/web/LL_NOTIF_SRV/LLAttachmentSelectionSet(DocumentNumber='0000000000000010000001429',NotificationId='630000000085')","uri": "http://my.server.com:8018/sap/opu/odata/web/LL_NOTIF_SRV/LLAttachmentSelectionSet(DocumentNumber='0000000000000010000001429',NotificationId='630000000085')","type": "WEB.LL_NOTIF_SRV_01.LLAttachmentSelection"},"DocumentNumber": "0000000000000010000001429","NotificationId": "630000000085","TaskNum": "0000","DocOrigin": "LL Test Document Type JPEG","DocType": "ZLL","DocPart": "000","DocVersion": "00","DocApplication": "JPG","DocData": "","CreatedAt": "20190401144744","CreatedBy": "XBECKERR","CreatorName": "Roman Becker","DocumentFileSize": "000000031128","Notification": "","DocumentExtension": "","DocumentCategory": "","LLStream": {"__deferred": {"uri": "http://my.server.com:8018/sap/opu/odata/web/LL_NOTIF_SRV/LLAttachmentSelectionSet(DocumentNumber='0000000000000010000001429',NotificationId='630000000085')/LLStream"}}},{"__metadata": {"id": "http://my.server.com:8018/sap/opu/odata/web/LL_NOTIF_SRV/LLAttachmentSelectionSet(DocumentNumber='0000000000000010000001430',NotificationId='630000000085')","uri": "http://my.server.com:8018/sap/opu/odata/web/LL_NOTIF_SRV/LLAttachmentSelectionSet(DocumentNumber='0000000000000010000001430',NotificationId='630000000085')","type": "WEB.LL_NOTIF_SRV_01.LLAttachmentSelection"},"DocumentNumber": "0000000000000010000001430","NotificationId": "630000000085","TaskNum": "0000","DocOrigin": "LL Test Document Type GIF","DocType": "ZLL","DocPart": "000","DocVersion": "00","DocApplication": "GIF","DocData": "","CreatedAt": "20190401145758","CreatedBy": "XBECKERR","CreatorName": "Roman Becker","DocumentFileSize": "000000001261","Notification": "","DocumentExtension": "","DocumentCategory": "","LLStream": {"__deferred": {"uri": "http://my.server.com:8018/sap/opu/odata/web/LL_NOTIF_SRV/LLAttachmentSelectionSet(DocumentNumber='0000000000000010000001430',NotificationId='630000000085')/LLStream"}}}]}}

From my understanding this must be the SRC value: http://my.server.com:8018/sap/opu/odata/web/LL_NOTIF_SRV/LLAttachmentSelectionSet(DocumentNumber='0000000000000010000001430',NotificationId='630000000085')/LLStream/$value With my basic understanding I have tried things like this to get the image shown:

<Carousel showBusyIndicator="false" id="__carousel1" pages="{LLAttachmentSelectionSet}">
<pages>
<Image width="140px" height="140px" id="__image3" src="{LLStream/$value}"/>
</pages>
</Carousel>

I appreciate any help. A working example using Stream/$value would be fantastic.

Many thanks for support.

Best regards

Roman

View Entire Topic
arthursilva
Active Participant
0 Kudos

Hello Roman, hope you're well.

The addition of $valueis exclusive for odata properties. A feasible approach is a creation of a property on entity LLStream containing the src. Just like the example below:

Paste the url on browser to get property Picture of entity Categories

https://services.odata.org/V2/Northwind/Northwind.svc/Categories(1)/Picture
Use this url to render the image on app:
<Image src="//services.odata.org/V2/Northwind/Northwind.svc/Categories(1)/Picture/$value"/>