Skip to Content
0
Aug 01, 2008 at 01:45 PM

Showing Image in Web Dynpro using ABAP

123 Views

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