04-30-2008 12:10 PM
I have created a function module....where i want to raise some error message when some wrong data will be inputed
what is the syntax ? Please tell me the syntax .
04-30-2008 12:16 PM
hi you can do like this:
in exception tab of FM write exceptions you want to raise.
e.g. incorrect_input.
now in code write
if input not correct (write your validation condition here)
raise incorrect_input.
endif.
reward if useful.
04-30-2008 12:13 PM
04-30-2008 12:14 PM
You define your exceptions in one of the tabs in SE37.
Say you create one
BAD_DATA
when you want to return this error
RAISE BAD_DATA.
Function exits with sy-subrc = to whatever was assigned during the definition.
04-30-2008 12:14 PM
Hi,
1. Declare the exceptions in the exception tab.
2. Check the necessary condition in the code. If not satisfied,
RAISE <exception> ---> This should be declared in the Exception tab of the FM.
Thanks and Regards,
Lakshmi.
04-30-2008 12:16 PM
hi you can do like this:
in exception tab of FM write exceptions you want to raise.
e.g. incorrect_input.
now in code write
if input not correct (write your validation condition here)
raise incorrect_input.
endif.
reward if useful.
08-21-2015 7:10 AM
Not a bad solution, but it will lead to dump.
If you want to regain control returning to the code part calling your FM, then you should use
MESSAGE '' TYPE 'I' RAISING error_type.