‎2005 Dec 13 9:13 AM
Hi frnds,
im creating a function module. in this FM im using another FM. How do i catch the exceptions in the FM im creating, when the called FM returns an exception.
points assured to all replies..
madan.
‎2005 Dec 13 9:28 AM
hi madan,
check out this link.
<a href="/people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-i:///people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-i
regs,
jaga
‎2005 Dec 13 9:27 AM
Hi,
Check the return code after you have called the inner FM and react accordingly.
REgards,
Abdul
‎2005 Dec 13 9:28 AM
hi madan,
check out this link.
<a href="/people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-i:///people/durairaj.athavanraja/blog/2005/04/03/execute-bw-query-using-abap-part-i
regs,
jaga
‎2005 Dec 13 9:32 AM
When the inner function module returns an exception, it is possible to catch that exception there itself, provided u shud have defined exceptions for that inner func. module. There are lotz of func. modules like that.. for example check out HR_READ_INFOTYPE
Regards,
Rajeev
‎2005 Dec 13 9:32 AM
Hi Madan,
It is as same as you handle exception in Report.
CALL FUNCTION 'ZTEST'
EXPORTING
NAME = 'TEST'
IMPORTING
NAME1 = V_NAME
EXCEPTIONS
NO_DATA_FOUND = 1
UNDEFINED = 2.
Regards,
Sudhakar.
‎2005 Dec 13 9:33 AM
Hi
check this link
<a href="http://help.sap.com/saphelp_erp2005/helpdata/en/9e/d58167116711d5b2f40050dadfb92b/frameset.htm">Exceptions in Function Modules and Methods</a>
hope it solves your problem
Regards
Amit
‎2005 Dec 13 9:39 AM
CALL FUNCTION 'TEST'
* ...
EXCEPTIONS
NOT_FOUND = 7.
if sy-subrc = 1.
raise exception1.
else.
raise exception2.
endif.
‎2005 Dec 13 10:52 AM
Hi,
You have to check the sy-subrc value after the FM is called.
Then based on sy-subrc value it return,you can design your code.