当用户要求SAP导出为,XLSX格式,此时我们就不能采用传统的函数“GUI_DOWNLOAD”:
DATA:lv_num TYPE i.
DATA:lv_sum TYPE i.
DATA:
lv_filename TYPE string,
lv_path TYPE string,
lv_fullpath TYPE string,
lv_destination LIKE rlgrap-filename,
ls_objdata LIKE wwwdatatab,
lv_objid TYPE wwwdatatab-objid,
lv_rc TYPE sy-subrc,
lv_tabix TYPE i.
DATA: BEGIN OF gt_hd OCCURS 0 ,
field TYPE char100,
END OF gt_hd.
"数据赋值到EXCEL导入中去
REFRESH:gt_item.
SELECT * INTO TABLE @DATA(gt_qamv) FROM qamv WHERE prueflos = @p_prue.
APPEND VALUE #( prueflos = '检验批次号' verwmerkm = '检验特性编码' kurztext = '检验特性描述' zxh = '检验结果序号' zjyjg = '检验结果'
zsfhg = '是否合格(1:合格 0:不合格)') TO gt_item.
LOOP AT gt_qamv INTO DATA(gs_qamv).
CLEAR:lv_sum,lv_num.
IF gs_qamv-verwmerkm+0(1) =