cancel
Showing results for 
Search instead for 
Did you mean: 

Showing Image in Web Dynpro using ABAP

RKSK
Participant
0 Kudos

Hi All,

I am new to Web Dynpro ABAP , basically my requirement is to show a image , could any one please tell me the steps to do that , i have already uploaded the image in application server using T-code smw0 , and in the layout i have taken the element IMAGE.

I have also made the context node as Image and under that i have made three attributes named as :-

IMAGE (Context Node)

source (Attibute type string)

tooltip (Attribute type string)

visible (Attribute type WDUI_VISIBILITY)

In the WDDOINIT method i have written the following code.

DATA:

context_node TYPE REF TO if_wd_context_node,

context_elem TYPE REF TO if_wd_context_element,

stru_image TYPE if_image_view=>element_image.

  • fill structure with values

stru_image-source = 'abc.gif'.

stru_image-tooltip = 'Image Tooltip!!'.

stru_image-visible = '02'. "=visible

  • navigate to <IMAGE> via lead selection

context_node = wd_context->get_child_node( name = `IMAGE` ).

  • get element via lead selection

context_elem = context_node->get_element( ).

  • bind structure to context element image

CALL METHOD context_elem->set_static_attributes

EXPORTING

static_attributes = stru_image.

But I am getting the error if_image_view does not exist.

Please help me and guide me if I am proceeding in a wrong way.

Thanks and Regards,

Rachit Khanna

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Upload Image in the MIME-Repository.

SE80

Context Menu on your WD Component

--> Create

---> MIME-Object

---> Import

Kind regards,

Silke

PS: the transaction you mentioned was used for ITS, I believe to rememeber.

RKSK
Participant
0 Kudos

Hi Silke,

Thanks for your help.

I have done everything you have told me , but still not getting hoe to show the image in WD , i have created MIME and imported the image also. what to do next please guide me.

Thanks and Regards,

Rachit Khanna

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi ,

Its very simple ....

Dont use any transaction to upload image.

right click on component and select

create->mime_object->import

suppose ur image is on desktop...

So select the path of desktop select the image and click ok.

U will see an MIMEs named folder in ur component and under which u will have ur image.

now add image element into UI and there u will have source name property ...just write the name of ur image file and test ur application.

U can see the image in output..

(Also there are different properties of image element to set the position and other things)

any queries ..feel free to ask

regards

panky