COMPUTE_INT_PLUS_OVERFLOW CX_SY_ARITHMETIC_OVERFLOW COMPUTE_INT_TIMES_OVERFLOW CX_SY_ARITHMETIC_OVERFLOW COMPUTE_LOG10_ERROR CX_SY_ARITHMETIC_OVERFLOW, CX_SY_ARG_OUT_OF_DOMAIN COMPUTE_LOG_ERROR CX_SY_ARITHMETIC_
data MYREF type ref to CX_SY_ARITHMETIC_ERROR. data ERR_TEXT type STRING. data RESULT type I. try. RESULT = 1 / 0. catch cx_sy_arithmetic_error into MYREF. ERR_TEXT = MYREF->GET_TEXT( ). endtry. Handling exceptions as catchable runtime errors (向后兼容6.10) 此异常处理sap建议使...
CX_ROOT | |--CX_STATIC_CHECK | |--CX_DYNAMIC_CHECK | | | |--CX_SY_ARITHMETIC_ERROR | | | | | |--CX_SY_ZERODIVIDE | | | | | |--CX_SY_ARITHMETIC_OVERFLOW | | | | | |--CX_SY_ARG_OUT_OF_DOMAIN | | | | | |--CX_SY_PRECISION_LOSS | | | |--CX_SY_ASSIGN_ERROR...
data MYREF type ref to CX_SY_ARITHMETIC_ERROR. data ERR_TEXT type STRING. data RESULT type I. try. RESULT = 1 / 0. catch cx_sy_arithmetic_error into MYREF. ERR_TEXT = MYREF->GET_TEXT( ). endtry. Handling exceptions as catchable runtime errors (向后兼容6.10) 此异常处理sap建议使...
data MYREF type ref to CX_SY_ARITHMETIC_ERROR. data ERR_TEXT type STRING. data RESULT type I. 1. 2. 3. 带入语法 try. RESULT = 1 / 0. catch cx_sy_arithmetic_error into MYREF. ERR_TEXT = MYREF->GET_TEXT( ). sy-subrc = 4. "改变系统变量 ...
ENDTRY. CATCH CX_SY_ARITHMETIC_ERROR INTO orf_1. txt_1 = orf_1→GET_TEXT( ). CATCH CX_ROOT INTO orf_1. txt_1 = orf_1→GET_TEXT( ). ENDTRY. IF NOT txt_1 IS INITIAL. Write / txt_1. ENDIF. Write: / 'Final Result is:', res_1. 复制 在此示例中,如果数字大于 150,则会引...
CX_ROOT | |--CX_STATIC_CHECK | |--CX_DYNAMIC_CHECK | | | |--CX_SY_ARITHMETIC_ERROR //运算 '&OPERATION&' 时发⽣算术错误 | | | | | |--CX_SY_ZERODIVIDE //除数为零 | | | | | |--CX_SY_ARITHMETIC_OVERFLOW //操作 &OPERATION& 中溢出 | |...
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. ...
WHEN TYPE cx_sy_arithmetic_error. out->display('Arithmetic error'). WHEN TYPE cx_sy_conversion_error. out->display('Conversion error'). WHEN OTHERS. out->display('Other error'). ENDCASE. ENDTRY. ”抓异常,分异常类型报错 Switch:
In the class math, any exceptions represented by the class CX_SY_ARITHMETIC_ERROR and its subclasses are propagated from within the method divide_1_by. If, for example, the input parameter operand is filled by the call with the value 0, the exception CX_SY_ZERODIVIDE is raised, propagated...