‎2007 Apr 27 7:41 AM
hi,
1) when control come to RAISE NOT_FOUND where NOT_FOUND in the exceptions tab in function module, what does the system do? show short text in exceptions tab as message? what does the RAISE keyword do here?
FUNCTION-POOL CSTR.
FUNCTION STRING_SPLIT.
...
IF STRING NA DELIMITER.
RAISE NOT_FOUND.
ENDIF.
...
ENDFUNCTION.
2) in the caller program, if assign 7 to NOT_FOUND under exception, which means sy-subrc = 7, right?
PROGRAM EXAMPLE.
...
CALL FUNCTION 'STRING_SPLIT'
...
EXCEPTIONS
NOT_FOUND = 7.
IF SY-SUBRC = 7.
WRITE / 'There is a problem.'.
ELSE.
...
ENDIF.
thanks
‎2007 Apr 27 7:43 AM
hi,
chk out the <b>Exceptions</b> tab in the function module , To the Left of <b>source Code</b> tab,
What ever you write there for that Exception , it will display that error
‎2007 Apr 27 7:43 AM
hi,
chk out the <b>Exceptions</b> tab in the function module , To the Left of <b>source Code</b> tab,
What ever you write there for that Exception , it will display that error
‎2007 Apr 27 7:43 AM
Yep, you're right.
In the function module, after a RAISE-EXCEPTION the function will be left with SY-SUBRC = 7 (in your case). This sy-subrc can be used by the calling program.
regards,
Hans
Please reward all helpful answers !!!!!
‎2007 Apr 27 7:43 AM
Hi,
1. In the FM, when its RAISE NOT_FOUND...NOT_FOUND would be assinged some number say 7. So the program which has called this FM, will receive a sy-subrc as 7 when the exception NOT_FOUND is raised.
2. Yes you are correct.
Best regards,
Prashant
‎2007 Apr 27 7:49 AM
not_found is ur user defined exception inorder to trigger that exception u user the raise key word in func module..
when a no is assigned to it we can call it by that no and specify the message u need to print..
ur code works
regards..