Code: Alles auswählen.
*Create the cached response object that we will insert our content into
CREATE OBJECT cached_response
TYPE
cl_http_response
EXPORTING
add_c_msg = 1.
****set the data and the headers
CONCATENATE 'image/' wd_comp_controller->gv_file_format INTO lv_file_format. "erstellte Bild-URL
cached_response->set_data( lv_content ). "XSTRING
cached_response->set_header_field( name = if_http_header_fields=>content_type
value = lv_file_format ).
cached_response->set_status( code = 200 reason = 'OK' ).
cached_response->server_cache_expire_rel( expires_rel = 300 ).
Code: Alles auswählen.
DATA:url TYPE string,
guid TYPE guid_32,
cached_response TYPE REF TO if_http_response.
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 =
180 ).
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_32 = guid.
cl_wd_utilities=>construct_wd_url( EXPORTING
application_name = 'YRS_TEST1' "Webdynpro application name
IMPORTING out_local_url = url ).
CONCATENATE url '/' guid sy-uzeit INTO url.
cl_http_server=>server_cache_upload(
url = url
response = cached_response ).