2013 Sep 25 10:52 AM
Hi,
I want to know METHOD not FUNCTION MODULES for generating URL for Web Repository. A picture is stored in Web Repository (SMW0). The URL is used in CL_GUI_PICTURE=>LOAD_PICTURE_FROM_URL. I've tried LOAD_PICTURE_FROM_URL, but no valid URL generated.
Regards,
ts
2013 Sep 25 11:41 AM
Hi,
The Function Module WWW_GET_MIME_OBJECT is used to get the MIME object for the Picture
and DP_CREATE_URL is used to create an URL.
Check the below code...it may helps you....
Data: g_picture type ref to cl_gui_picture,
g_custom_container2 type ref to cl_gui_custom_container,
*-- URL
data: v_url(255) type c. " URL-field
data: pic_data like w3mime occurs 0.
data: pic_size type i.
call method cl_gui_datamanager=>on_input.
create object g_custom_container2 exporting container_name = 'LOGO'. create object g_picture exporting parent = g_custom_container2.
perform load_pic_from_db
tables pic_data
using 'Z_LOGO'
changing pic_size.
call function 'DP_CREATE_URL'
exporting
type = 'image'
subtype = 'X-UNKNOWN'
tables
data = pic_data
changing
url = v_url.
call method g_picture->load_picture_from_url
exporting url = v_url.
&----
*& Form LOAD_PIC_FROM_DB
&----
form load_pic_from_db
tables pic_data
using pic_name
changing pic_size.
data query_table like w3query occurs 1 with header line.
data html_table like w3html occurs 1.
data return_code like w3param-ret_code.
data content_type like w3param-cont_type.
data content_length like w3param-cont_len.
clear query_table.
query_table-name = '_OBJECT_ID'.
query_table-value = pic_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
invalid_table = 1
parameter_not_found = 2
others = 3.
if sy-subrc = 0.
pic_size = content_length.
endif.
endform. " LOAD_PIC_FROM_DB
Regards,
Satish D R
2013 Sep 27 8:01 AM
Thank you for your reply. As I mentioned, I am looking for Class Method replacing those function modules; but thank you all the same.
Regards,
ts
2013 Sep 27 8:11 AM
Hi,
Why do you need methods? Instead you can use FM's itself.
Regards,
Satish D R
2013 Sep 27 8:16 AM