catch cx_sy_arithmetic_error into MYREF. ERR_TEXT = MYREF->GET_TEXT( ). endtry. Handling exceptions as catchable runtime errors (向后兼容6.10) 此异常处理sap建议使用try...endtry代替(错误和异常类对应关系参见第5部分)。 data RESULT
DATA: result TYPE i, number TYPE i. CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 4 OTHERS = 8. ... result = 1 / number. ... ENDCATCH. IF sy-subrc <> 0. ... ENDIF.
CATCH SYSTEM-EXCEPTIONS[exc1 = n1 exc2 = n2 ...] [OTHERS = n_others]. [statement_block] ENDCATCH. OTHERS接收所有前面异常列表 n1 n2 …未捕获到的异常。 DATA: result TYPE i. CATCH SYSTEM-EXCEPTIONS arithmetic_errors = 5. result = 1 / 0. ENDCATCH. IF sy-subrc = 5. WRITE / 'Divi...
catch cx_sy_arithmetic_error into MYREF. ERR_TEXT = MYREF->GET_TEXT( ). endtry. Handling exceptions as catchable runtime errors (向后兼容6.10) 此异常处理sap建议使用try...endtry代替(错误和异常类对应关系参见第5部分)。 data RESULT type I. catch system-exceptions ARITHMETIC_ERRORS = 4. RES...
catch cx_sy_arithmetic_error into MYREF. ERR_TEXT = MYREF->GET_TEXT( ). endtry. Handling exceptions as catchable runtime errors (向后兼容6.10) 此异常处理sap建议使用try…endtry代替(错误和异常类对应关系参见第5部分)。 data RESULT type I. catch system-exceptions ARITHMETIC_ERRORS = 4. ...
endtry.Handling exceptions as catchable runtime errors (向后兼容6.10) 此异常处理sap建议使用try...endtry代替(错误和异常类对应关系参见第5部分)。 data RESULT type I. catch system-exceptions ARITHMETIC_ERRORS = 4. RESULT = 1 / 0. endcatch. if SY-SUBRC = 4. ... endif. 4、代码样例 a)...
endtry.Handling exceptions as catchable runtime errors ( 向后兼容 6.10)此异常处理sap建议使用try.endtry代替(错误和 7、异常类对应关系参见第5部分)。data RESULT type I.catch system-exceptions ARITHMETIC_ERRORS = 4.RESULT = 1 / 0.endcatch.if SY-SUBRC = 4.endif.4、代码样例a)RAISING cx1 . ...
catch cx_sy_arithmetic_error into MYREF.ERR_TEXT = MYREF->GET_TEXT( ).endtry.Handling exceptions as catchable runtime errors (向后兼容6.10)此异常处理sap建议使用try...endtry代替(错误和异常类对应关系参见第5部分)。data RESULT type I.catch system-exceptions ARITHMETIC_ERRORS = 4....
CATCH SYSTEM-EXCEPTIONS exc1 = rc1 ... excn = rcn. ... ENDCATCH. 其中exci表示一个单一可捕捉错误或者一个ERROR类,rci则代表一个数字.如果其中错误之一在CATCH和ENDCATCH语句之间出现,程序就不会中止,而是直接跳至ENDCATCH后,把系统指定的错误代码rci赋给字段SY-SUBRC.此语句可嵌套.例如: DATA:result1 ...
· CATCH SYSTEM-EXCEPTIONS sets SY-SUBRC if there are runtime errors after the ENDCATCH statement. The value is specified in the program.· COMMIT WORK sets SY-SUBRC to 0.· COMMIT WORK AND WAIT sets SY-SUBRC to 0 if update was successful, otherwise <>0....