健康一贴灵,专注医药行业管理信息化

SAP 可用库存统计及MM自定义分类

减去已下订单未发货的数量 

CLEAR zomeng.
SELECT SUM( omeng ) INTO zomeng FROM vbbe
  WHERE matnr = mchb-matnr
  AND werks = mchb-werks
  AND lgort = mchb-lgort
  AND charg = mchb-charg.
zkykc = mchb-clabs - zomeng.

 

CLEAR:ZHXPC,ZATINN.
SELECT SINGLE ATINN INTO ZATINN FROM CABN
  WHERE ATNAM = 'ZHXPC'.
SELECT SINGLE ATWRT INTO ZHXPC FROM AUSP
  WHERE OBJEK = MCHA-CUOBJ_BM
  AND KLART = '022'
  AND ATINN = ZATINN.

**SAP定义的物料字典类,保存在CABN中,关联AUSP表,取出定义的批次属性;
CLEAR:ZLI_CHARG,ZATINN.
SELECT SINGLE ATINN INTO ZATINN FROM CABN
  WHERE ATNAM = 'ZLI_CHARG'.
SELECT SINGLE ATWRT INTO ZLI_CHARG FROM AUSP
  WHERE OBJEK = MCHA-CUOBJ_BM
  AND KLART = '022'
  AND ATINN = ZATINN.

**供应商批号
CLEAR:ZLINAME,ZATINN..
SELECT SINGLE ATINN INTO ZATINN FROM CABN
  WHERE ATNAM = 'ZLINAME'.
SELECT SINGLE ATWRT INTO ZLINAME FROM AUSP
  WHERE OBJEK = MCHA-CUOBJ_BM
  AND KLART = '022'
  AND ATINN = ZATINN.

**供应商名称

 

 

 

 

 

posted @ 2021-11-04 09:52  一贴灵  阅读(308)  评论(0编辑  收藏  举报
学以致用,效率第一