‎2008 Aug 08 6:48 AM
Can anybody tell me how to insert an image in custon containe header?
‎2008 Aug 08 7:00 AM
try these demo programs
SAP_PICTURE_DEMO
RSDEMO_PICTURE_CONTROL
‎2008 Aug 08 6:52 AM
Hello
Try this
data: pic_container TYPE REF TO cl_gui_custom_container.
DATA: query_table LIKE w3query OCCURS 1 WITH HEADER LINE, " Query string for WWW server
html_table LIKE w3html OCCURS 1, " Contains HTML for WWW client
return_code LIKE w3param-ret_code, " Parameter definitions for various function modules
content_type LIKE w3param-cont_type, " Content type
content_length LIKE w3param-cont_len, " Content length
pic_data LIKE w3mime OCCURS 0, " Contains MIME data for WWW client
pic_size TYPE i. " Picture size
REFRESH query_table.
query_table-name = '_OBJECT_ID'.
query_table-value = 'MAC_PICTURE'.
APPEND query_table.
*Create container for picture
CREATE OBJECT picture
EXPORTING
parent = pic_container
EXCEPTIONS
error = 1
OTHERS = 2 .
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
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
TABLES
data = pic_data
CHANGING
url = url
EXCEPTIONS
dp_invalid_parameter = 1
dp_error_put_table = 2
dp_error_general = 3
OTHERS = 4.
CALL METHOD picture->load_picture_from_url
EXPORTING
url = url
EXCEPTIONS
error = 1
OTHERS = 2.
*Display mode of picture
CALL METHOD picture->set_display_mode
EXPORTING
display_mode = cl_gui_picture=>display_mode_stretch
EXCEPTIONS
error = 1
OTHERS = 2.
hope this will help you
Thanks
Anirudh Saini
‎2008 Aug 08 7:00 AM
try these demo programs
SAP_PICTURE_DEMO
RSDEMO_PICTURE_CONTROL
‎2008 Aug 13 7:20 AM
I am not able to inser my own images from TCODe OAER. Please help me how to proceed with that?
‎2008 Aug 13 7:42 AM
Hi,
Go to tcode OAER .
Class name 'PICTURES' .
Give obj key: xxx
Class type OT
In Create tab-> Screen right click to Import
Your picture is stored in the document server.
Hope this will help you.
Regards
Guruprasad