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: 

EXCEPTION: Possible to log in a Process all Error´s in "CATCH-Block" and write finaly in AppLOG?

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

Create a Z function module and call start_process( ) method in it. Make sure that all the exceptions are added to the function module.

Former Member
0 Kudos

Create a Z function module and call start_process( ) method in it. Make sure that all the exceptions are added to the function module.

Former Member
0 Kudos

Create a Z function module and call start_process( ) method in it. Make sure that all the exceptions are added to the function module.

Former Member
0 Kudos

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