Skip to Content
0

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

Apr 11, 2017 at 02:40 PM

41

avatar image
Former Member

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

avatar image
Former Member Apr 11, 2017 at 03:27 PM
-1

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 11, 2017 at 03:27 PM
-1

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 11, 2017 at 03:27 PM
-1

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Apr 12, 2017 at 08:05 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded