Skip to Content
0
Former Member
Feb 08, 2011 at 10:31 AM

How to display image in IMAGE UI from mime repository ?

311 Views

Hi

I am building web dynpro for the first time.

I try to display image in IMAGE UI but can't see image.

※image is displayed like

What is wrong with this source ?

Please help.

-

-


  • get image from mime repository

data:mime_repository type ref to if_mr_api,

content type xstring,

url type string value 'SAP/BC/WebDynpro/SAP/Z_HT_MIME/image.jpg'.

mime_repository = cl_mime_repository_api=>get_api( ).

call method mime_repository->get EXPORTING i_url = url

IMPORTING e_content = content.

  • set context

data:lo_element TYPE REF TO if_wd_context_element,

ls_context type REF TO wd_this->element_context.

lo_element = wd_context->get_element( ).

lo_element->set_attribute( name = 'URL' value = content ).

-

-


※If source is set image directly, Image is displayed.

  Type of Context 'URL' is String.

Thanks

Tom