04-11-2017 3:40 PM
Hi at all,
iám trying to work with TRY-CATCH-ENDTRY and don´t use in my Methods the Returning/ Exporting- Parameter =>"Bapireturn-Table"!
---------------------------------------------------------------------------------------------------------------------
I have a Report "REP_EXCEPTION" and a Method "START_PROCESS".
In my Method "START_PROCESS" iam calling 4 other Methods. When 2 of this Methods have a RaiseException-Error, is it possible to log this two message and can resume the other Method calls???
And the End i want give all collected Messages back to the Report "REP_EXCEPTION"!
--------------------------------------REP_EXCEPTION-----------------------------------------------------
TRY.
CALL METHOD zcl_class-start_process( ).
CATCH zcx_exception INTO DATA(lr_oref).
LOOP AT lr_oref->previous INTO <fs>.
*& Write to ApplicationLog (SLG1)
ENDLOOP.
ENDTRY.
-------------------------------------START_PROCESS----------------------------------------------------
TRY.
TRY.
CALL METHOD method_1( ). "RAISE EXCEPTION TYPE cx_exception_methods.
CATCH cx_exception_methods.
ENDTRY.
TRY.
CALL METHOD method_2( ). "RAISE EXCEPTION TYPE cx_exception_methods.
CATCH cx_exception_methods.
ENDTRY.
TRY.
CALL METHOD method_3( ). "RAISE EXCEPTION TYPE cx_exception_methods.
CATCH cx_exception_methods.
ENDTRY.
TRY.
CALL METHOD method_4( ). "RAISE EXCEPTION TYPE cx_exception_methods.
CATCH cx_exception_methods.
ENDTRY.
CATCH cx_exception INTO DATA(lr_oref).
RAISE EXCEPTION TYPE cx_exception
EXPORTING previous = lr_oref.
ENDTRY.
-------------------------------------------------------------------------------------------------------------------
How can i solve this?
Kind Regards
ETN
04-11-2017 4:27 PM
Create a Z function module and call start_process( ) method in it. Make sure that all the exceptions are added to the function module.
04-11-2017 4:27 PM
Create a Z function module and call start_process( ) method in it. Make sure that all the exceptions are added to the function module.
04-11-2017 4:27 PM
Create a Z function module and call start_process( ) method in it. Make sure that all the exceptions are added to the function module.
04-12-2017 9:05 AM
Hi Tejas,
iám looking for a Exception-Model, where i can handle Errors and collect.
Finaly iam trying to give the collected Errors via RAISE EXCEPTION to the caller Report/ FM/ Method whatever.
Thanks for your help, but this is not what iam searching.
Kind Regards
ETN