Application Development and Automation 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: 
Read only

Exception Handling for a function module

Former Member
0 Likes
541

There is a function module the program in which exceptions are handled. When the program is ran as a background job and when there is a exception arises does the background job fails or the exception gets handled ??? Pls help me out.....

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
501

If the exception is being handled by the caller, meaning that the exception is listed in the EXCEPTIONS section of the funciton call, then the program will handle it gracefully and continue processing, if it is not in this section of the funciton call, and it is raised inside the funciton module, it will issue an ABAP dump and end. This is true for foreground processing as well as background processing.

Regards,

Rich Heilman

3 REPLIES 3
Read only

FredericGirod
Active Contributor
0 Likes
501

if you have specify :

EXCEPTIONS

OTHERS = ..

you program will not stop.

Fred

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
502

If the exception is being handled by the caller, meaning that the exception is listed in the EXCEPTIONS section of the funciton call, then the program will handle it gracefully and continue processing, if it is not in this section of the funciton call, and it is raised inside the funciton module, it will issue an ABAP dump and end. This is true for foreground processing as well as background processing.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
501

it raises an exception you can catch it.

cx_root is the root class for exceptions.

DATA: ex TYPE REF TO CX_ROOT.

TRY.

call fm.

...

CATCH cx_root INTO ex.

ENDTRY.

message = cx_root->get_text( ).

this way your program will not stop..

regards,

Aparna