*&---------------------------------------------------------------------*
*& Report ZMMR008
*&
*&---------------------------------------------------------------------*
*&程序名称:仓库理货单导出
*&事物代码:ZMM030
*&导入模板:理货单模板.xls(上传对象名为:ZMM_XLS_001)
*&作者:董冬
*&时间:2016/2/29
*&更新时间:2016/3/2
*&----------------------------------
REPORT zmmr008.
TABLES: vttp,lips,likp,kna1 ,vttk, ztmm001.
INCLUDE ole2incl.
DATA: gs_fcat TYPE lvc_s_fcat,
gt_fcat TYPE lvc_t_fcat,
gs_layo TYPE lvc_s_layo,
gs_grid TYPE lvc_s_glay.
DATA: gt_event TYPE slis_t_event WITH HEADER LINE,
gt_event_exit TYPE slis_t_event_exit WITH HEADER LINE.
DATA: ref_grid TYPE REF TO cl_gui_alv_grid .
DATA: excel TYPE ole2_object,
workbook TYPE ole2_object,
sheet TYPE ole2_object,
cell TYPE ole2_object,
row TYPE ole2_object.
TYPES: BEGIN OF ty_all,
tknum LIKE vttk-tknum, "运单号
vbeln LIKE lips-vbeln, "交货单号
posnr LIKE lips-posnr, "行项目
tplst LIKE vttk-tplst , "装运点
tprfo LIKE vttp-tprfo, "理货顺序
name1 LIKE kna1-name1 , "客户
erdat LIKE vttk-erdat , "创建日期
tdlnr LIKE vttk-tdlnr , "物流公司
route LIKE vttk-route , "线路
distz LIKE vttk-distz , "里程
add01 LIKE vttk-add01 , "车主
exti1 LIKE vttk-exti1 , "卸货点
add02 LIKE vttk-add02 , "司机
bfart LIKE vttk-bfart , "车厢类型
matnr LIKE lips-matnr, "物料编码
arktx LIKE lips-arktx, "物料描述
lgpla_c LIKE ztmm001-lgpla_c, "仓位
brgew LIKE lips-brgew, "货物单项目毛重
lfimg LIKE lips-lfimg, "单项目数量
vrkme LIKE lips-vrkme , "单位
gewei LIKE lips-gewei, "重量单位
lgort LIKE lips-lgort, "库存地点
beizhu(30) TYPE c, "备注
END OF ty_all.
TYPES:BEGIN OF ty_header,
tknum LIKE vttk-tknum, "运单号
vbeln LIKE lips-vbeln, "交货单号
name1 LIKE kna1-name1 , "客户
tprfo LIKE vttp-tprfo, "理货顺序
tplst LIKE vttk-tplst , "装运点
erdat LIKE vttk-erdat , "装运日期
tdlnr LIKE vttk-tdlnr , "物流公司
route LIKE vttk-route , "线路
distz LIKE vttk-distz , "里程
add01 LIKE vttk-add01 , "车主
exti1 LIKE vttk-exti1 , "卸货点
add02 LIKE vttk-add02 , "司机
bfart LIKE vttk-bfart , "车厢类型
total_brgew LIKE lips-brgew, "一个交货单的总重量
lgort LIKE lips-lgort, "库存地点
END OF ty_header.
*单据抬头结束
*单据明细开始
TYPES:BEGIN OF ty_items,
tknum LIKE vttk-tknum, "运单号
vbeln LIKE lips