‎2008 Aug 04 8:31 AM
Hi Experts,
I have an image stored in application server for eg d:\test.gif.
My requirement is to display the image from this path into a container in screen programming.
How can i achieve it. Kindly help.
I tried using load_picture_from_url method of class cl_gui_picture, its not working.
If i try to display an image from presentation server using this class and method its working fine. But my requirement is to display it form application server.
Help me on this.
Thanks and Regards
Naveen
‎2008 Aug 04 8:37 AM
Hi,
Use the Tcode
SMW0.
See the links:
U can do that in ALV report.
In the transaction OAOR, you should be able to insert your company Logo.
GOTO - OAOR (Business Document Navigator)
Give Class Name - PICTURES Class Type - OT..... then Execute
It will show you the list, then select ENJOYSAP_LOGO.
On that list, you will find one control with a "create" tab.
Click std. doc types.
Select SCREEN and double-click.
It will push FILE selection screen.
Select your company logo (.gif) and press OK.
It will ask for a description- for instance: "company logo".
It will let you know your doc has been stored successfully.
You can find your logo under ENJOYSAP_LOGO->Screen->company logo.
Just run your ALV program, you should find your company logo in place of the EnjoySAP logo.
FORM TOP-OF-PAGE.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = HEADING[]
I_LOGO = 'ENJOYSAP_LOGO'
I_END_OF_LIST_GRID ='GT_LIST_TOP_OF_PAGE'.
.
ENDFORM. "TOP-OF-PAGE
Here 'ENJOYSAP_LOGO' will replace by ur created logo.
n pls reply me.
Refer this link
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_enhanced.htm
http://www.sap-img.com/abap/alv-logo.htm
http://www.sap-img.com/fu002.htm
regards,
Harish
‎2008 Aug 04 8:42 AM
Hi Harish,
I need it to be done programatically.
I have an image stored in application server, this part is not a prob.
The problem is where i need to display image from this path in application server into a Container in screen programming.
Thanks and Regards
Naveen
‎2008 Aug 04 9:38 AM
Hi naveen,
Try by using below code, to display logo in Custom container
in module pool programs.
data: logo_container type ref to cl_gui_custom_container,
logo type ref to cl_gui_picture.
data: url(255) type c.
Flow Logic
process before output.
module init_picture_control. " create module to display logo
end of Flow Logic
module init_picture_control output.
perform init_picture_control.
endmodule. " INIT_PICTURE_CONTROL OUTPUT
&----
*& Form init_picture_control
&----
form init_picture_control.
data: query_table like w3query occurs 1 with header line,
html_table like w3html occurs 1,
return_code like w3param-ret_code,
content_type like w3param-cont_type,
content_length like w3param-cont_len,
pic_data like w3mime occurs 0,
pic_size type i.
if url is initial.
if logo_container is initial.
create object logo_container
exporting container_name = 'LOGO_CONTAINER'
exceptions others = 1.
if sy-subrc ne 0.
exit.
endif.
endif.
if logo is initial.
create object logo
exporting parent = logo_container
exceptions others = 1.
if sy-subrc ne 0.
exit.
endif.
endif.
refresh query_table.
query_table-name = '_OBJECT_ID'.
query_table-value = 'SAPSMARTFORMS'. u201Cput your Logo name
append query_table.
call function 'WWW_GET_MIME_OBJECT'
tables
query_string = query_table
html = html_table
mime = pic_data
changing
return_code = return_code
content_type = content_type
content_length = content_length
exceptions
object_not_found = 1
parameter_not_found = 2
others = 3.
if sy-subrc = 0.
pic_size = content_length.
endif.
call function 'DP_CREATE_URL'
exporting
type = 'image'
subtype = cndp_sap_tab_unknown
size = pic_size
lifetime = cndp_lifetime_transaction
tables
data = pic_data
changing
url = url
exceptions
others = 1.
call method logo->load_picture_from_url
exporting url = url
exceptions others = 1.
endif.
endform. " init_picture_control
thanks®ards,
meeravali shaik.
‎2008 Aug 04 9:59 AM
Hi Shaik Meera,
My requirement is to display image from a Server. I know the path, I know the server path where the image is stored. From this path i need to load. Can you help on this as your sol gets data from images stored in se78 or something. I need it to load it from a path in server.
I have this path stored in the database.
Actually iam maintaining a material catalogue where i store the path of the images for every material in a database table. Based on the material i need to fetch the picture and display it.
Kindly help.
Thanks and Regards
Naveen