MMBE 查询物料的当前库存,有一列是收货冻结库存(GR Blocked Stock),但是没有明细。
通过函数 MB_SELECT_GR_BLOCKED_STOCK 可以查询物料收货冻结库存的明细。
DATA: BEGIN OF xtab2 OCCURS 0, werks LIKE ekpo-werks, matnr LIKE ekpo-matnr, ebeln LIKE ekpo-ebeln, ebelp LIKE ekpo-ebelp, wesbs LIKE ekbe-wesbs, wesb2 LIKE ekbe-wesbs, meinh LIKE ekpo-meins, END OF xtab2. RANGES xwerks FOR marc-werks.
CALL FUNCTION 'MB_SELECT_GR_BLOCKED_STOCK' EXPORTING x_matnr = gt_data-matnr x_meins = gt_data-meins TABLES xtab2 = xtab2 xwerks = xwerks.
查询结果,可以知道对应采购订单或者计划协议收货冻结数: