来自
https://www.cnblogs.com/sapSB/p/5482736.html
ENHANCEMENT 1 ZMIR7_01. "active version
DATA:LS_YDRSEG LIKE LINE OF YDRSEG.
DATA:L_T_QTY LIKE EKBE-MENGE.
CHECK RM08M-VORGANG = '1'.
LOOP AT YDRSEG INTO LS_YDRSEG.
L_T_QTY = 0.
SELECT SUM( CASE SHKZG WHEN 'S' THEN MENGE ELSE -1 * MENGE END )
INTO @L_T_QTY
FROM EKBE
WHERE EBELN = @LS_YDRSEG-EBELN
AND EBELP = @LS_YDRSEG-EBELP
AND BEWTP IN ('T','Q')
AND LFGJA = @LS_YDRSEG-LFGJA
AND LFBNR = @LS_YDRSEG-LFBNR
AND LFPOS = @LS_YDRSEG-LFPOS.
LS_YDRSEG-MENGE = LS_YDRSEG-WEMNG - L_T_QTY.
LS_YDRSEG-BPMNG = LS_YDRSEG-MENGE.
IF LS_YDRSEG-MENGE <= 0.
DELETE YDRSEG.
CONTINUE.
ELSE.
MODIFY YDRSEG FROM LS_YDRSEG.
ENDIF.
ENDLOOP.
ENDENHANCEMENT.
阅读(1876) | 评论(0) | 转发(0) |