Exception Handling in Function Module


 Step1. Let’s have a FM with the below importing parameters.

Step2. Export parameters.

Step3. Here define the exceptions to be raised in the FM source code under the Exceptions tab.

Step4. raise those defined exceptions in the source code depending on some checks. 

Step5. Here we have the program that calls the FM with specific set of parameters. When you call this FM automatically the system assigns a integer value to each of the exception. When in the FM source code a particular exception is raised then the sy-subrc value is the value assigned to the exception.

Step6. Here exception MISSING_PARAMETER raised and observe the value of  sy-subrc.

Step7. So here we have the O/P.

Step8. Again change some value of the FM exporting parameter so that it would generate a different exception. Execute the program.

Step9. Observe the sy-subrc value.

Step10. So here we have the O/P.


 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s