************************************************************************
*程式代號:ZMMR058
*程式名稱:庫存異動明細查詢(不包含品檢中庫存)
* -------- -----------------------------------------------------
* 20161130 程式建立 By Qi
************************************************************************
REPORT zmmr058.
TABLES: marc,mara,mard,mseg,mkpf,mchb,mbew,mardh,t001w .
TYPE-POOLS: slis.
DEFINE fieldcat.
clear w_fieldcat.
w_fieldcat-col_pos = &1.
w_fieldcat-fieldname = &2.
w_fieldcat-seltext_l = &3.
w_fieldcat-no_convext = &4.
w_fieldcat-key = &5.
append w_fieldcat to g_fieldcat.
END-OF-DEFINITION.
DATA: BEGIN OF itabs,
shkzg LIKE mseg-shkzg,
bldat LIKE mkpf-bldat,
cputm LIKE mkpf-cputm,
budat LIKE mkpf-budat,
bwart LIKE mseg-bwart,
ebeln LIKE mseg-ebeln,
kdauf LIKE mseg-kdauf,
aufnr LIKE mseg-aufnr,
kunnr LIKE mseg-kunnr,
smbln LIKE mseg-smbln,
kostl LIKE mseg-kostl,
mblnr LIKE mkpf-mblnr,
zeile LIKE mseg-zeile,
matnr LIKE mseg-matnr,
lifnr LIKE mseg-lifnr,
lgort LIKE mseg-lgort,
charg LIKE mseg-charg,
menge LIKE mseg-menge,
meins LIKE mseg-meins,
sgtxt LIKE mseg-sgtxt,
END OF itabs.
DATA: itab LIKE itabs OCCURS 0 WITH HEADER LINE,
ritab LIKE itabs OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF stabs,
shkzg LIKE mseg-shkzg,
bldat LIKE mkpf-bldat,
cputm LIKE mkpf-cputm,
budat LIKE mkpf-budat,
bwart LIKE mseg-bwart,
ebeln LIKE mseg-ebeln,
kdauf LIKE mseg-kdauf,
aufnr LIKE mseg-aufnr,
kunnr LIKE mseg-kunnr,
smbln LIKE mseg-smbln,
kostl LIKE mseg-kostl,
mblnr LIKE mkpf-mblnr,
zeile LIKE mseg-zeile,
matnr LIKE mseg-matnr,
lifnr LIKE mseg-lifnr,
lgort LIKE mseg-lgort,
charg LIKE mseg-charg,
menge LIKE mseg-menge,
meins LIKE mseg-meins,
sgtxt LIKE mseg-sgtxt,
tqty3 LIKE mseg-menge,
END OF stabs.
DATA sitabs LIKE stabs OCCURS 0 WITH HEADER LINE .
DATA: BEGIN OF riitabs,
matnr LIKE mchbh-matnr,
werks LIKE mchbh-werks,
lfgja LIKE mchbh-lfgja,
lfmon LIKE mchbh-lfmon,
lgort LIKE mchbh-lgort,
charg LIKE mchbh-charg,
clabs LIKE mchbh-clabs,
END OF riitabs.
DATA riitab LIKE riitabs OCCURS 0 WITH HEADER LINE .