注意 1。在将图片导入的时候内表名字和取出时必须一样.
2。在把数据Import到程序中之后,要检查内表是不是为空再进行下一步操作
TYPE-POOLS cndp.
DATA: BEGIN OF pic_tab OCCURS 0,
data(500) TYPE x,
END OF pic_tab.
DATA: wa_indx LIKE indx,
url(256).
DATA: container TYPE REF TO cl_gui_custom_container,
pic TYPE REF TO cl_gui_picture.
START-OF-SELECTION.
IMPORT pic_tab FROM DATABASE indx(zz) ID 'PIC2' TO wa_indx.
IF pic_tab[] IS INITIAL.
MESSAGE i000(o0) WITH 'The Region or ID is not correct'.
ELSE.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'IMAGE'
subtype = cndp_sap_tab_unknown
TABLES
data = pic_tab[]
CHANGING
url = url.
CREATE OBJECT container
EXPORTING
container_name = 'ZCONTAINER'
.
CREATE OBJECT pic
EXPORTING
parent = container .
CALL METHOD pic->load_picture_from_url
EXPORTING
url = url.
CALL SCREEN 9000.
ENDIF.
阅读(1302) | 评论(0) | 转发(0) |