on 03-18-2015 1:58 PM
Hi experts,
I'm working at a client who has images located on a network drive for their materials. A part of my job is to show the images that correspond to the material in a custom sap fiori application.
A material can have multiple images and the images are named by their material number ( ex.1000001). When a material has more photos they are named 1000001_01, 1000001_02 , ...
The directory is exposed via a file directory in AL11. So what i'm planning on doing is to try to read the images via OPEN DATASET ( check if there is an image and if so try to read a next one or not at all) based on a material number and return them somehow via an odata service to my application.
I saw some tutorials on how to expose an image but this was always done via a function module that got the image from SAP not from a network drive. In these tutorials they always returned 1 image because they used the getEntity method.
My question for you experts is how you would do this? And if it is possible to return multiple images( for one single material) via an odata service. Other solutions?
Kind regards,
Ian Desmet
That is right. At a time an OData URL can return only one image. If you need multiple images at a time, you can combine multiple requests in a $batch request.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you krishna !
In the GET_STREAM method it should be something like this right?
ls_stream-value = ls_photo-content. <<<<<< Here i need to put the xstring response
ls_stream-mime_type = ls_photo-mimetype.
lv_filename = ls_photo-filename.
lv_filename = escape( val = lv_filename
format = cl_abap_format=>e_url ).
ls_lheader-name = 'Content-Disposition'.
ls_lheader-value = |inline; filename="{ lv_filename }"|.
set_header( is_header = ls_lheader ).
copy_data_to_ref( EXPORTING is_data = ls_stream
CHANGING cr_data = er_stream ).
Ripped from Peter Marcely from http://scn.sap.com/docs/DOC-56891.
Kind regards,
Ian Desmet
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.