2、数据库表更新用TRY.的时候,语法如下
DATA: lcx_error TYPE REF TO cx_root.
DATA: err_text type c length 1000.
try.
xxxxxxxxxxxxxxxxx "更新数据库语句
CATCH cx_sy_open_sql_db INTO lcx_error.
err_text = lcx_error->get_text( ).
endtry.
if err_text is initial.
commit work.
else.
rollback work.
endif.
err_text就是try失败的原因描述
DATA: lcx_error TYPE REF TO cx_root.
DATA: err_text type c length 1000.
try.
xxxxxxxxxxxxxxxxx "更新数据库语句
CATCH cx_sy_open_sql_db INTO lcx_error.
err_text = lcx_error->get_text( ).
endtry.
if err_text is initial.
commit work.
else.
rollback work.
endif.
err_text就是try失败的原因描述