*&---------------------------------------------------------------------*
*& Report Z_TEST_COL_TO_ROW_02
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_TEST_COL_TO_ROW_02.
TABLES: VTTP,LIPS,LIKP,KNA1 ,VTTK.
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 .
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,"一个交货单的总重量
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-BRGEW,"单项目毛重
GEWEI LIKE LIPS-GEWEI,"重量单位
LFIMG LIKE LIPS-LFIMG,"单项目数量
VRKME LIKE LIPS-VRKME ,"单位
LGORT LIKE LIPS-LGORT,"库存地点
BEIZHU(30) TYPE