‎2007 Dec 26 2:28 PM
Hi,
whats the use of raise exception in fm.
lets say,
select * from tnamme .....
if sy-subrc <> 0.
raise abcd.
endif.
whats the use if raise abcd.
Thanks in advance
‎2007 Dec 26 2:32 PM
Hi,
For example, if you try to divide any numer with Zero it will raise an exception, and it will go for ABAP dump. Instead of going to dump. In raise event u can give your own description of the error and avoid the program for dump.
Thanks,
Sriram POnna.
‎2007 Dec 26 2:32 PM
Hi,
For example, if you try to divide any numer with Zero it will raise an exception, and it will go for ABAP dump. Instead of going to dump. In raise event u can give your own description of the error and avoid the program for dump.
Thanks,
Sriram POnna.
‎2007 Dec 26 2:50 PM
Hi,
one can define their own error message or exception.
And hence if at all error occurs it will be easy for us to identify.
Generally, it is used for trapping the error before it goes to dump.
hope this helps.
‎2007 Dec 26 9:40 PM
Hi Rahul,
RAISE statement is used to raise an exception from within the FM.
As you might know, a FM is always called from somewhere (a calling program) and cannot execute on its own. So, when the FM comes across a situation where it wants to raise an exception it raises it using RAISE statement and this is passed on to the calling program by a non-zero SY-SUBRC value. This exception must be defined in the EXCEPTIONS tab of the FM.
The FM, optionally, can handle the situation but if it wants the calling program to handle the situation, RAISE statement does the job.
Hope this helps.
Thanks
Sanjeev