***********************************************************************
* Title : ZSDF002 *
* Application : SD *
* Subject : 发货通知单 *
* Ref no: : 021862 *
* Author : 董冬 *
* Req Date : 20160222 *
***********************************************************************
* 设计主要逻辑与原理说明 *
***********************************************************************
*SD模块发货通知单
*****************************************************************************
REPORT zsdf003.
TABLES: vttp,lips,likp,kna1 ,vttk.
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,"交货单号
tplst LIKE vttk-tplst ,"装运点
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,"物料描述
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 ,"客户
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-vbeln,"交货单号
name1 LIKE kna1-name1 ,"客户
matnr LIKE lips-matnr,"物料编码
arktx LIKE lips-arktx,"物料描述
brgew LIKE lips