‎2007 Jun 06 11:14 AM
How to pass the exception of a function module so that it can be raised in a different program?
‎2007 Jun 06 11:33 AM
Hi,
The exception of the FM is returned to the calling program via the SY-SUBRC field
You can evaluate the sme to know which exception has been triggered.
the value of sy-subrc is set to the exception number
if the first excpetion defined in the Excep tab is raised the subrc value will be 1
if the 2nd excpetion defined in the Excep tab is raised the subrc value will be 2
so you can come to know which exception was raised inside the FM
regards,
gaurav
‎2007 Jun 06 11:24 AM
Hi
Define different exceptions based on the value of SY-SUBRC field in the fun module
and when that fun module is used in the program based on the value of the Sy-SUBRC you just raise the exception.
Case Sy-subrc.
when 1.
raise FILE_NOT_FOUND.
when 2.
Raise UNABLE_TO_OPEN_FILE.
endcase.
Reward points for useful Answers
Regards
Anji
‎2007 Jun 06 1:29 PM
The actual scenario is, I am calling perform statement in the include of a function module.The form is written in a different program(subroutine pool).I have to raise the exeption of the function module inside this program.How to do that?
‎2007 Jun 06 11:33 AM
Hi,
The exception of the FM is returned to the calling program via the SY-SUBRC field
You can evaluate the sme to know which exception has been triggered.
the value of sy-subrc is set to the exception number
if the first excpetion defined in the Excep tab is raised the subrc value will be 1
if the 2nd excpetion defined in the Excep tab is raised the subrc value will be 2
so you can come to know which exception was raised inside the FM
regards,
gaurav