|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
*SAP物料价值是基于公司的,对于单个库存地的收发存报表取数有问题,因此要将当个库存地的库存数据取出来写进自荐表
*&---------------------------------------------------------------------*
*& Report ZMM_FBSFCHZ
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZMM_ZMBEW.
tables:mbew,mard,zmbew.
data:it_zmbew LIKE zmbew OCCURS 0 WITH HEADER LINE.
data:begin of it_mbew occurs 0 ,
matnr like mbew-matnr,
VPRSV like mbew-VPRSV,
VERPR like mbew-VERPR,
STPRS like mbew-STPRS,
PEINH like mbew-PEINH,
end of it_mbew.
select * from zmbew where cpudt = sy-DATUM.
if sy-subrc eq 0.
*message '今天库存数据已更新,程序将终止!' type 'I'.
return.
endif.
endselect.
select * from mbew into corresponding fields of table it_mbew where LBKUM ne 0 and matnr < '80000000'.
select * from mard into corresponding fields of table it_zmbew where LABST ne 0 and matnr < '80000000' and lgort = '3010'.
loop at it_zmbew.
loop at it_mbew.
if it_mbew-matnr eq it_zmbew-matnr.
it_zmbew-cpudt = sy-DATUM.
it_zmbew-cputm = sy-UZEIT.
it_zmbew-vprsv = it_mbew-vprsv.
it_zmbew-verpr = it_mbew-verpr.
it_zmbew-stprs = it_mbew-stprs.
it_zmbew-peinh = it_mbew-peinh.
* if it_mbew-VPRSV eq 'S' .
* it_zmbew-SALK3 = it_mbew-STPRS * it_zmbew-labst.
* else.
it_zmbew-SALK3 = it_mbew-verpr * it_zmbew-labst / it_mbew-PEINH.
* endif.
it_zmbew-vprsv = it_mbew-vprsv.
it_zmbew-verpr = it_mbew-verpr.
it_zmbew-stprs = it_mbew-stprs.
it_zmbew-peinh = it_mbew-peinh.
modify it_zmbew.
continue.
endif.
endloop.
endloop.
modify zmbew from table it_zmbew.
*message '库存数据更新完成!' type 'I'.
|
|