on 03-21-2013 6:12 AM
Hi,
I have stored the images of type rawstring in table zrao_img.
Now i want to display them in my webdynpro application.
Kindly provide me guidelines to follow.
Best regards,
Narasimha.
Hi Narasimha,
You can use the below code for the same, I have used custom FM to get xstring of the image data from HR infotype.
________________________________________________________________________
DATA: guid TYPE guid_32,
cached_response TYPE REF TO if_http_response,
lv_xstring TYPE xstring.
CALL FUNCTION 'Z_ESS_FM035'
EXPORTING
im_pernr = im_pernr
IMPORTING
ex_xstring = lv_xstring.
* Create URL from XSTRING of photo
CREATE OBJECT cached_response
TYPE
cl_http_response
EXPORTING
add_c_msg = 1.
* set image to mime
cached_response->set_data( lv_xstring ).
cached_response->set_header_field(
name = if_http_header_fields=>content_type
value = 'image/pjpeg' ).
cached_response->set_status( code = 200 reason = 'OK' ).
cached_response->server_cache_expire_rel( expires_rel = 600 ).
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_32 = guid.
CALL METHOD cl_wd_utilities=>construct_wd_url
EXPORTING
application_name = <WD-application name>
IMPORTING
out_local_url = ex_url.
CONCATENATE ex_url '/' guid sy-uzeit INTO ex_url.
CALL METHOD cl_http_server=>server_cache_upload
EXPORTING
url = ex_url
response = cached_response.
_______________________________________________________________
-Manish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.