Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

different result page when I use the catch exception

Former Member
0 Kudos

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.

3 REPLIES 3

Former Member
0 Kudos

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

0 Kudos

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?

0 Kudos

o,it's my mistake. the message statment lead to the blank page.I have deleted it.