on 03-21-2013 1:05 PM
Hi All,
Can you please let me know how to GUID for MIME Image.
lo_mime = cl_mime_repository_api=>get_api( ) .
lo_mime->get( EXPORTING i_url = '/sap/bc/webdynpro/sap/zdemo/logo.png'
IMPORTING e_content = xstring.
from this I get the xstring value of the MIME Image
image->src = upload_resource( iv_data = xstring
iv_content_type = 'image/png'
iv_guid = lv_guid) .
lv_guid = GUID of MIME image.
lv_guid will have the GUID of the MIME image.
Can you please let know how to find its GUID.
Thanks,
Bharat
Hi Bharat,
You will need to create the GUID using FM GUID_CREATE.
Hope this code helps you which converts xstring to image for use in WD:
DATA: guid TYPE guid_32,
cached_response TYPE REF TO if_http_response,
lv_xstring TYPE xstring.
I called a custom FM and got the xstring of image in 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How did you upload your MIME image?
If the image is a GRAPHICS one (BMAP, i.e.) uploaded/submitted to the system via SE78 transaction, then its reference could be found in table STXBITMAPS:
SELECT SINGLE *
INTO lwa_stxbitmaps
FROM stxbitmaps
WHERE tdobject = 'GRAPHICS'
AND tdname = your_own_image_name
AND tdid = 'BMAP'.
DOCID field returns a reference which is a concatenation of a prefix and GUID.
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.