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

functionmodule-exception

Former Member
0 Likes
512

hi guru

in creation of functionmodule we will write soursecode by usinf if and ifelse, so then what is neccessity to write exceptions?

what is use of exception , why r u giving exceptions?

3 REPLIES 3
Read only

Former Member
0 Likes
486

Raising an exception in a function module allows it to set a return code in the calling program, so that it can code a response to the error that has occured.

Read only

varma_narayana
Active Contributor
0 Likes
486

Hi Srinivas.

Exceptions are used in FM to handle Error situations.

So that the calling program will know for which reason the FM is not successfully executed.

That means if No exception is RAISED Then the FM is successfully executed.

<b>reward if Helpful.</b>

Read only

Former Member
0 Likes
486

Hi,

Best way is create ur own FM. What i did was i created an fm: with 2 import parameters of type integer and export as result.

In this fm wht i first did was divide the first import param with the second.

Called this fm in another fm and passed the values frm there like this val1 = 9..val2 = 0. So this resulted in a runtime error. So next time i defined an exception cannot be divide by zero...and raised in it in the called fm wen the 2nd value is 0....u can c tht noe error wont occur.

U can try more on these using tables..eception classes etc..

Regards,

Simy.