Hi Saurabh,
The first one should be possible. Generally you can catch the exception in Try......Enddtry block and call the get_text() method to display the error text. This will prevent the program from dumping.
Sample snippet - >
Assuming TSV_TNEW_PAGE_ALLOC_FAILED is exception class's name
data :
lv_ref TYPE REF TO TSV_TNEW_PAGE_ALLOC_FAILED,
lv_err_txt TYPE string.
TRY.
*-- Your code which can cause exception
CATCH TSV_TNEW_PAGE_ALLOC_FAILED INTO lv_ref.
lv_err_txt = lv_ref->get_text( ).
ENDTRY.
IF lv_err_txt IS NOT INITIAL.
MESSAGE lv_err_txt TYPE 'E'.
ENDIF.
Revert if i didn't understand you correctly.
BR.