|Home • Trainings • Quiz • Tips • Tutorials • Functional • Cert Q's • Interview Q's • Jobs • Testimonials • Advertise • Contact Us|
Displaying an image or logo in Web Dynpro application without using MIME object
Also create an application 'ZTEST1' for a Web Dynpro component.
2. Get the Binary
contents of image/logo from BDS (Business document store).
Go to the WDDOINIT method of
view and call the below Function module for getting the binary contents of
a image. I am calling this FM for a specific image. To make it a dynamic
call, select query on table STXBITMAPS is required. Thus it can help in deciding
the image at run time.
For black & White images
pass 'BMON' in parameter I_BTYPE (graphic type) and for color images pass 'BCOL'
in parameter I_BTYPE.
Data: i_name TYPE STXBITMAPS-TDNAME value 'ZLOGOTEST',
3. Convert the
binary contents into BITMAP format.
BITMAP format is file format
for digital images. So a conversion from BDS to BMP is required. Call the below
FM after the code in step 2.
Data: l_length TYPE i,
4. Convert BITMAP to
Byte stream (XSTRING).
Now table L_CONTENT contains
the required data of image. But to link it with the Image element, we need to
convert the Bitmap data into XSTRING format. Below source code can be used for
This custom logic is picked
up from FM SCMS_BINARY_TO_XSTRING and is modified according to needs.
Data: w_file TYPE xstring,
5. Generate a URL
which will be linked with Image UI element.
After step 4, we have image
data (xstring) in W_FILE parameter. Now a URL needs to be generated which
image UI element will point to.
DATA:url TYPE string,
6. Set the above
generated URL in Image UI element's source property.
In step1, we have created a
Context attribute named IMAGE_URL which is linked to Image element's Source
property. In this step, we will set the value (url created in above step) in
DATA lo_el_context TYPE REF TO if_wd_context_element.
Now activate the Web Dynpro
component and test the application to see output.
Please send us your feedback/suggestions at webmaster@SAPTechnical.COM
©2006-2007 SAPTechnical.COM. All rights reserved.
product names are trademarks of their respective companies. SAPTechnical.COM
is in no way affiliated with SAP AG.
Graphic Design by Round the Bend Wizards