1. 在屏幕中画一个容器
2. 定义:
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.