‎2007 Mar 12 1:34 PM
Hi all,
what is the difference between <b>raise</b> and <b>raising</b> statements in the function module while calling exceptions.
‎2007 Mar 12 1:37 PM
Hello,
Have a look at this document:
http://help.sap.com/saphelp_nw04/helpdata/en/83/636d2012fc11d5991e00508b5d5211/frameset.htm
Rgds,
Vasanth
‎2007 Mar 12 1:40 PM
Hi Swetha,
Raise statement can be used in method(subroutines etc)
But the Raising can be used in MESSAGE statement only.
Regard,
Balakrishna.N
‎2007 Mar 12 1:42 PM
There are two ABAP statements for raising exceptions. They can only be used in function modules:
RAISE exc.
MESSAGE.....RAISING exc.
The effect of these statements depends on whether the calling program handles the 'exc' exception or not. The calling program handles an exception If the name of the 'exc' exception or OTHERS is specified after the EXCEPTION option of the CALL FUNCTION statement.
If the calling program does not handle the exception
The RAISEstatement terminates the program and switches to debugging mode.
The MESSAGE..... RAISING statement displays the specified message. Processing is continued in relation to the message type.
If the calling program handles the exception, both statements return control to the program. No values are transferred. The MESSAGE..... RAISING statement does not display a message. Instead, it fills the system fields sy-msgid, sy-msgty, sy-msgno , and SY-MSGV1 to SY-MSGV4
hope this helps u a bit,
all the best,
regards,
sampath
mark helpful answers
‎2007 Mar 12 1:44 PM
RAISE except.
Effect
This statement is only effective in function modules and methods.
It triggers the exception except.
If the exception is to be handled by the caller of the function module or method ( CALL FUNCTION or CALL METHOD ), the system passes control straight back to the caller. EXPORT parameters of a function module or method are not filled. The EXPORTING, CHANGING, and RETURNING parameters of a function module or method are only filled with the current values if they were defined to be passed by reference. reference).If they are defined to be passed by value, they are not filled.
If the exception is not handled by the caller, the program terminates with an appropriate error message.
... RAISING exception
Effect
Only within a function module or method ( FUNCTION, METHOD):
Triggers the exception exception.
If the caller of the function module or method handles the exception itself, control returns directly to the caller (see CALL FUNCTION and CALL METHOD). The EXPORTING, CHANGING, (and RETURNING) parameters of the function module or method only contain the current value from the procedure if they are defined to be passed by reference. They are not filled if they are passed by value.
The caller can, however, use the values from the system fields that are filled when the message is sent (see above).
If the caller does not handle the exception itself, the message is displayed (see RAISE).
You cannot use this addition in conjunction with the ... INTO cf addition.
Note
If, during a Remote Function Call, an error occurs in the target system, details of the error message are passed bac to the calling system in the following system fields: SY-MSGNO, SY-MSGID, SY-MSGTY, SY-MSGV1, SY-MSGV2, SY-MSGV3, and SY-MSGV4. These fields are initialized before every RFC. If a short dump or a type X message occurs, the short text of the dump is transferred to the caller, and the contents of SY-MSGID, SY-MSGTY, SY-MSGNO, and SY-MSGV1 assigned by the system.
In RFC-enabled function modules, no ABAP statements are allowed that would end the RFC connection (for example, LEAVE, SUBMIT or the AND RETURN addition).
Regards,
Balakrishna.N