10-31-2007 1:33 AM
Hi all,
I write a programe like this:
-
report zXXXX.
....
PERFORM insert_to_table.
FORM insert_to_table .
TRY.
INSERT z01peopday FROM TABLE it_peopday.
CATCH CX_SY_OPEN_SQL_DB into xref.
message_txt = xref->GET_TEXT( ).
message message_txt type 'E'.
CATCH CX_SY_SQL_ERROR INTO xref.
message_txt = xref->GET_TEXT( ).
message message_txt type 'E'.
ENDTRY.
ENDFORM.
-
the catch block will catch the exception when there is a exception occured at inserting.but the page will de stopped at the blank page with some infomation on the status bar. but it will not go back to the original page.I mean,the page will go to the original page if there is no exception occured. I have catch the exception,but why the result is defferent? and how to let the page go to the original page?
thanks.
10-31-2007 2:00 AM
Hi,
Can you please elaborate on what's the message on the status bar?
Also you can use TRY ..CATCH....CLEANUP .
Regards
Nishant
Message was edited by:
Nishant Rustagi
10-31-2007 2:12 AM
the "message on the status bar" just is the error message get by the code "xref->GET_TEXT( ).".
For example,duplicate records,diry data or something else.I think this not the important.
I mean the original page has a text box,if no expection occured,the page will return to the page has the text box after inserting.but if the exception occured,the page will stop the blank page without the text box . why?
10-31-2007 8:14 AM
o,it's my mistake. the message statment lead to the blank page.I have deleted it.