04-14-2010 9:21 AM
Hello experst,
i have to call a report from one of my programs. In this report it can happen that an error occors. So there i call
RAISE EXCEPTION TYPE zcx_exceptionmng
EXPORTING t100_msgid = 'QY'
t100_msgno = '051'.
The code of the calling program looks like this:
try.
submit z_test and return
with p_backgr = 'X'
with p_lot = '12312'
catch zcx_exceptionmng into oref.
endtry.
I wonder because the catch doens´t work. I get a system dump UNCAUGHT_EXCEPTION.
What´s my mistake?
04-14-2010 9:51 AM
Try something this way
RAISE EXCEPTION TYPE zcx_exceptionmng
EXPORTING t100_msgid = 'QY'
t100_msgno = '051'.
if SY-SUBRC = 4.
Exce = 4.
export exce to memory id 'ZEX'.
endif.
then
submit z_test and return
with p_backgr = 'X'
with p_lot = '12312'
import exce from memory id 'ZEX'.
if exce is not initial.
" Do your error handling
a®
04-14-2010 10:11 AM
Hello,
i know this possibility with sap memory, but is there no way to catch an exception by submitting a report?
04-14-2010 10:10 AM
Since you are using AND RETURN addition the SUBMITted report is called in a new internal session with a separate LUW.
Because of which you are not able to handle the EXCEPTION raised in the called program in the calling program.
You can use aRs' solution as a workaround.
BR,
Suhas
10-09-2010 10:05 AM