您有一个输出参数,但过程执行返回。这就是你没有看到任何错误的原因。您的过程需要如下:(示例有Customer表,并且没有足够的错误处理)
DEF INPUT PARAM i_cCustNum LIKE Customer.Cust-Num NO-UNDO.
DEFINE OUTPUT PARAMETER o_cErrorMsg AS CHARACTER NO-UNDO.
DEF BUFFER carBuffer_B1 FOR Customer.
FIND FIRST carBuffer_B1 WHERE carBuffer_B1.Cust-Num = i_cCarID EXCLUSIVE-LOCK NO-ERROR.
IF AVAIL(carBuffer_B1) THEN
DO:
DELETE carBuffer_B1 NO-ERROR.
o_cErrorMsg = "Delete Succeeded for id " + string(i_cCarID).
END.
ELSE
DO:
o_cErrorMsg = "No record found with id " + string(i_cCarID).
END.