*&---------------------------------------------------------------------*
*& Report ZALVTEST01
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT zalvtest01.
TABLES:ekko,
ekpo,
makt.
TYPE-POOLS: slis.
TYPES: BEGIN OF lt_ekko,
ekorg LIKE ekko-ekorg, "采购组织
ebeln LIKE ekko-ebeln, "采购订单号
lifnr LIKE ekko-lifnr, "供应商
aedat LIKE ekko-aedat, "采购订单创建日
END OF lt_ekko.
TYPES: BEGIN OF lt_ekpo,
ebeln LIKE ekpo-ebeln, "采购订单号
waers LIKE ekko-waers, "货币码
werks LIKE ekpo-werks, "工厂
ebelp LIKE ekpo-ebelp, "采购订单行项目
matnr LIKE ekpo-matnr, "物料号
maktx LIKE makt-maktx, "物料描述
ktmng LIKE ekpo-ktmng, "数量
meins LIKE ekpo-meins, "单位
peinh LIKE ekpo-peinh, "价格
END OF lt_ekpo.
DATA: t_ekko TYPE TABLE OF lt_ekko,
w_ekko type lt_ekko,
t_ekpo TYPE TABLE OF lt_ekpo.
DATA: i_fieldcat_alv TYPE slis_t_fieldcat_alv, "定义列标题(属性信息)
i_fieldcat TYPE slis_fieldcat_alv, "定义对象
i_layout TYPE slis_layout_alv,
i_events TYPE slis_t_event, "alv事件
w_events LIKE LINE OF i_events,
i_list_comments TYPE slis_t_listheader, "alv表单标题区域设置
w_list_comments LIKE LINE OF i_list_comments,
w_repid LIKE sy-repid VALUE sy-repid. "当前程序
*选择屏幕
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE t1.
SELECT-OPTIONS: s_bsart FOR ekko-bsart, "凭证类型
s_bedat FOR ekko-bedat, "凭证日期
s_ebeln FOR ekko-ebeln, "采购订单号
s_ekorg FOR ekko-ekorg, "采购组织
s_ekgrp FOR ekko-ekgrp, "采购组
s_llief FOR ekko-llief. "供应商
SELECTION-SCREEN END OF BLOCK b1.
INITIALIZATION.
t1 = '采购查询'.
START-OF-SELECTION.
PERFORM getdata.
PERFORM events_build.
PERFORM layout_build.
PERFORM fieldcat_build.
PERFORM alv_display_data.
*&---------------------------------------------------------------------*
*& Form getdata
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
FORM getdata.
SELECT ekorg
ebeln
lifnr
aedat
INTO TABLE t_ekko
FROM ekko
WHERE bsart IN s_bsart
AND bedat IN s_bedat
AND ebeln IN s_ebeln
AND ekorg IN s_ekorg
AND ekgrp IN s_ekgrp
AND llief IN s_llief.
ENDFORM. "getdata
*&----------------------------