1. 在屏幕中畫一個容器
2. 定義:<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
data:my_container
type ref to cl_gui_custom_container.
data l_url type cndp_url.
data:my_picture type ref to cl_gui_picture。
3. 取得圖片的URL
CALL FUNCTION 'DP_PUBLISH_WWW_URL'
EXPORTING
objid = '/ISDFPS/SAP_LOGO'
lifetime = 'T'
IMPORTING
url = l_url.
IF my_container IS INITIAL.
CREATE OBJECT my_container
EXPORTING
container_name = 'CONTROL_AREA1'
EXCEPTIONS
OTHERS = 1.
4. 創建容器
CREATE OBJECT my_picture
EXPORTING
parent = my_container
EXCEPTIONS
OTHERS = 1.
如果從網絡上取得圖片,則URL=網絡地址
l_url = 'http://www.qkhot.com/tp/news/20080114024427818.jpg'.
*******獲取圖片
CALL METHOD my_picture->load_picture_from_url
EXPORTING
url = l_url
EXCEPTIONS
OTHERS = 1.