DATA OK_CODE TYPE SY-ucomm.
START-OF-SELECTION.
CALL SCREEN 1000.
MODULE init_pic OUTPUT.
DATA: gr_picture TYPE REF TO cl_gui_picture,
gr_pic_container TYPE REF TO cl_gui_custom_container,
go_txt_container TYPE REF TO cl_gui_custom_container,
go_txt TYPE REF TO cl_gui_textedit,
gv_txt_type_sel TYPE ztsd018-txt_type,
gv_txt_type_sel_descr TYPE ztsd018-text,
gv_sel TYPE char1.
DATA lv_zzdata TYPE ztpictrue-zzdata.
DATA: BEGIN OF graphic_table OCCURS 0,
line(255) TYPE x,
END OF graphic_table,
url(255) TYPE c.
SELECT SINGLE zzdata
INTO lv_zzdata
FROM ztpictrue
WHERE zzkeyword = '204536-456'.
*lv_zzdata ='FFD8FFE000104A46494600010101006000600000FFDB0043000402030303020403030304040404050906050505050B080806090D0B0D0D0D0B0C0C0E1014110E11'.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY' 十六进制转二进制
EXPORTING
buffer = lv_zzdata
TABLES
binary_tab = graphic_table[].
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
type = 'IMAGE'
subtype = 'jpg'
TABLES
data = graphic_table[]
CHANGING
url = url.
IF gr_pic_container IS INITIAL.
创建图片容器 图片最后展示在1000 屏幕的 CON_PIC 容器上
CREATE OBJECT gr_pic_container
EXPORTING
container_name = 'CON_PIC'.
创建图片实例
CREATE OBJECT gr_picture
EXPORTING
parent = gr_pic_container.
IF url IS NOT INITIAL.
CALL METHOD gr_picture->load_picture_from_url_async
EXPORTING
url = url.
* call METHOD gr_picture->load_picture_from_sap_icons.
* CALL_METHOD gr_picture->
ENDIF.
ENDIF.
ENDMODULE.
*&---------------------------------------------------------------------*
*& Module USER_COMMAND_1000 INPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE user_command_1000 INPUT.
IF OK_CODE = 'BACK'.
LEAVE PROGRAM.
ENDIF.
ENDMODULE.
文件配置表