Hi Jennifer,
Check this code.
DATA : Qty type RDR1-Quantity.
SELECT SUM( T1~Quantity ) INTO Qty FROM ORDR AS T0 INNER JOIN RDR1 AS T1 ON T0~DocEntry = T1~DocEntry WHERE T0~U_Process = 'PEACHING' and T0~DocDate = Date HAVING SUM( T1~Quantity ) < 555000.
IF SY-SUBRC <> 0.
MESSAGE 'ERROR' TYPE 'E'.
ELSE.
" PROCEED FURTHER.
ENDIF.