cancel
Showing results for 
Search instead for 
Did you mean: 

How to display dynamic image in a container using webdynpro

Former Member
0 Kudos

http://prabhuabap.blogspot.com/2012/01/webdynpro_6625.html

In a first link,

In the Material Box we have to enter the material no and click on Change radio button and press ok means. It should go to Change View..

http://prabhuabap.blogspot.com/2012/01/blog-post.html

In a second link,

We have to upload 2 image in the file path given.And then we click the upload button.The image should be display in the container given below..

Please tell in step by step and give the sample code.

Because i did not create container till yet tell in basic onwards

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

For your first quesiton, you need to fire an outbound plug to the Change view of the Material. Do you want to go to a standard iView or a custom one?

For the second question. It depends on what format your image is available in. If it is available in xstring format, then you need to generate a URL for it and attach it to image path. Use the code below to generate the URL:

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( w_file ).

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 = 'ZTEST1' "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 ).

In case, the image is not available in xstring, then you first need to convert it from binary (bitmap) to xstring.

Former Member
0 Kudos

http://prabhuabap.blogspot.com/2012/01/webdynpro.html

this is my design page..

In the Material Box we have to enter the material no and click on Create radio button and press ok means. It should go to Create View..

In the create view we have to upload 2 image in the file path and press Upload button means.

It create DMS Docu no for the particular material. And then,

While the user want to change the image means.he will click the change radio button and press ok button means.It will go to change view In the change view the 2 image should be display in the container,

then if the user want to change the image means he will upload new image in the file path given in the change view.then he press upload button means.for the particular doc no the image want to change....

http://prabhuabap.blogspot.com/2012/01/blog-post.html