on 01-31-2011 7:59 AM
Hi,
I am trying to diplay image on my screen. Image I have uploaded in MIME but when displayed on screen , it's displayed as CROSS ( X )
I am writing below code to dispaly the image.
DATA: lc_MIME TYPE REF TO if_mr_api,
lv_image TYPE xstring,
lv_url TYPE string VALUE 'SAP/PUBLIC/BC/icons/ogo.bmp'.
lc_MIME = cl_mime_repository_api=>get_api( ).
lc_MIME->get( EXPORTING i_url = lv_url
IMPORTING e_content = lv_image ).
lo_el_context->set_attribute(
name = `LOGO`
value = lv_image).
Can any one help what can be the reason?
I am seeing it now that you set the content .. it is not at all needed.
You can just select the source property of Image (at the rightmost) you can select a small icon which leads you to the selection screen to standard icon screen.
Or as you already did.
lo_el_context->set_attribute(
name = `LOGO`
value = lv_url ).
You do not need to get the content,it is needed for Office files.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
bmp is not a good image format for web applications. Go with .gif .jpg or .png.
Start URL with /
There are similar folders in mime-repository. The correct URL might as well be this one:
/sap/public/bsp/sap/public/bc/icons/logo.bmp
Just try by calling it directly in web browser to see whether it is correct.
http://<server>:<port>/sap/public/bsp/sap/public/bc/icons/logo.bmp
It's easy to get lost in mime repository ;-).
For web dynpro I would like to recommend another way of dealing with images or mimes in general.
Create a Web Dynpro component, e.g. ZIMAGES and add the mimes to this component.
The images can be accessed by setting the property imageSource of ui element image to value:
{ZIMAGES}/logo.gif
Have fun, Silke
PS:
http://help.sap.com/saphelp_nw70ehp1/helpdata/de/ec/bb08428dab5f24e10000000a1550b0/frameset.htm
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
also
'SAP/PUBLIC/BC/icons/ogo.bmp'.
path should be '/SAP/PUBLIC/BC/icons/ogo.bmp'.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
>
> lv_url TYPE string VALUE 'SAP/PUBLIC/BC/icons/ogo.bmp'.
>
is this name correct ogo.bmp ?.
Have you tried any other .gif files of jpg files ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In the source property of the IMAGE UI element just give the name of the image that you have uploaded in the MIME repository.
like in this case just give ogo.bmp in the image source.
if you have bound the property to the context attribute logo.
then just pass the ogo.bmp to it
lo_el_context->set_attribute(
name = `LOGO`
value = 'ogo.bmp').
thanks
sarbjeet singh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.