on 07-13-2010 6:35 PM
Hi,
I am developing an application in Web Dynpro ABAP. In this application, a product catalog is displayed in a table.
When you click on a product, the user gets a detailed view of this article. In this detailed view to the user will also get a picture of the product.
However, the images are located in the document root (Tcode CV03N) of the material and not in the MIME folder of the application. I managed it to get the Picture as a binary file type XSTING into a context-attribute and display the result with the UIElement "File download" in a new browser window.
But i would like to display this image inplace the existing View.
So is there a possibility to display an binary xstring inplace a WebDynpro view?
Regards.
You can create a temporary URL for the content by placing the XSTRING content into the ICM Cache:
****Create the cached response object that we will insert our content into
data: cached_response type ref to if_http_response.
create object cached_response
type
cl_http_response
exporting
add_c_msg = 1.
* cached_response->set_compression( options = cached_response->IF_HTTP_ENTITY~CO_COMPRESS_IN_ALL_CASES ).
try. " ignore, if compression can not be switched on
call method cached_response->set_compression
exporting
options = cached_response->co_compress_based_on_mime_type
exceptions
others = 1.
catch cx_root.
endtry.
****set the data and the headers
data: l_app_type type string.
cached_response->set_data( lv_image ).
l_app_type = 'image/jpg'.
cached_response->set_header_field( name = if_http_header_fields=>content_type
value = l_app_type ).
cached_response->set_status( code = 200 reason = 'OK' ).
cached_response->server_cache_expire_rel( expires_rel = 60 ).
data: guid type guid_32.
call function 'GUID_CREATE'
importing
ev_guid_32 = guid.
concatenate '/sap/public' '/' guid '.' 'jpg' into lv_image_url.
****Cache the URL
cl_http_server=>server_cache_upload( url = lv_image_url
response = cached_response ).
wd_context->get_element( )->set_attribute(
name = `image_URL`
value = lv_image_url ).
Another option would be to create your ICF Handler class. That's a bit more complicated to explain in a forum posting, but if that path interest you I can point you to a tutorial.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
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.