cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying image on welcome view

former_member186491
Contributor
0 Kudos

Hi Gurus!

I need to display image document stored on server on welcome view.

For that, I have added MIME object after Importing that image. Then, created image in RootUIElementContainer of 'Welcome View' and does the mapping in context tab. After this, in the Method Tab added the following code in WDDOINIT --



DATA: MR      TYPE REF TO IF_MR_API,
          CONTENT TYPE        XSTRING.
MR = CL_MIME_REPOSITORY_API=>GET_API( ).
    MR->GET(
    EXPORTING  I_URL     = 'sap/bc/webdynpro/sap/zpicture/J1.jpg'
             IMPORTING  E_CONTENT = CONTENT ).

Finally, I did context mapping in windows.

Now, saved and activated. But, when I test-run it data does not come up.

Hence, will anyone will give me lead as to where I'm wrong or better any link for that purpose.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Why are you reading the content of the image into the context at all? If the image is in the MIME repository then you just need to give the Image UI element the path to the image. Is ZPICTURE the name of your web dynpro component? If you upload the images directly to the MIME folder of the WD Component, you don't even have to supply the path to the Image UI element - just the file name.

former_member186491
Contributor
0 Kudos

Thank you all!

My issue has been resolved.

Thomas, special credit to you because your answer is more specific to my case. I had added the MIME folder and picture in that. But, I was trying to call it in WDDOINIT. Thanks for underlying the mistake.

Anyways, thanks again to you all.

Answers (3)

Answers (3)

Former Member
0 Kudos

thn Go to the source property of IMAGE element and select F4 option , u will find a window is opening with some tabs

Select tab COMPONENT IMAGES and component name select your component .

u will find the image which you have imported into this section just select the image and save it.

reagrds,

amit

Former Member
0 Kudos

hi ,

the context attribute to which ur Image needs to be bound must be of the type XSTRING or RAWSTRING .

regards,

amit

Former Member
0 Kudos

What is the type fo teh context attribute...to which teh Image is bound..

Have you checked in debugging wther this MIME object has image in it o rnot..

One more thing, Try giving the value for MIME url in CAPS..