SORT GT_MCHB BY MATNR WERKS ERSDA CHARG.
LOOP AT GT_OUTPUT INTO GS_OUTPUT WHERE SEL = 'X' AND ZSPLIT = ''.
CLEAR LV_FLAG2.
R_QTY = GS_OUTPUT-ZQTY.
LOOP AT GT_MCHB INTO GS_MCHB WHERE MATNR = GS_OUTPUT-MATNR AND WERKS = GS_OUTPUT-WERKS AND LGORT = GS_OUTPUT-LGORT AND CLABS <> 0.
GS_OUTPUTX = GS_OUTPUT.
GS_OUTPUTX-LGORT = GS_MCHB-LGORT.
GS_OUTPUTX-LGOBE = GS_MCHB-LGOBE."库存地点描述
GS_OUTPUTX-CHARG = GS_MCHB-CHARG.
GS_OUTPUTX-CLABS = GS_MCHB-CLABS.
GS_OUTPUTX-ERSDA = GS_MCHB-ERSDA.
GS_OUTPUTX-ZCHARG_MB = GS_OUTPUTX-CHARG.
IF GS_OUTPUTX-ZDOCTYP <> '25'AND GS_OUTPUTX-ZDOCTYP <> '45'.
GS_OUTPUTX-ZWERKS_MB = GS_OUTPUTX-WERKS.
ENDIF.
IF R_QTY > 0 .
IF GS_MCHB-CLABS >= R_QTY .
GS_OUTPUTX-ZQTY_P_2 = R_QTY .
R_QTY = 0 .
ELSE.
GS_OUTPUTX-ZQTY_P_2 = GS_MCHB-CLABS .
R_QTY = R_QTY - GS_MCHB-CLABS .
ENDIF.
ENDIF.
GS_MCHB-CLABS = R_QTY .
MODIFY GT_MCHB FROM GS_MCHB TRANSPORTING CLABS.
GS_OUTPUTX-ZSPLIT = 'X'.
GS_OUTPUTX-XCHAR = 'X'.
APPEND GS_OUTPUTX TO GT_OUTPUTX.
CLEAR GS_MCHB.
CLEAR GS_OUTPUTX.
LV_FLAG2 = 'X'.
IF R_QTY = 0 .
EXIT .
ENDIF.
ENDLOOP.
批次拆分
最新推荐文章于 2024-06-20 14:07:12 发布