Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to read exception text of a FM

I have a custom Function Module which has 3 different exceptions in it's exceptions section. I need to get the text for the raised exception in the caller program, how to do that ?

here is a sample call to the FM:

call function 'ZGET_YEAR'

exporting

pernr = l_pernr

importing

year = l_year

exceptions

emp_not_valid = 1

year_not_found = 2

others = 3.

Now, if the emp_not_valid is raised by the FM then I need to get the text stored in that exception.

Appreciate any inputs on it. Thank you.

Tags:
replied

At first point of time, I thought you are accustomed with the Exception Handling and you want to read the text of the Exception to avoid givig the speicifc message. So, I have suggested the Function Module Tables which stores the information.

Anyways, I have created a Small Tutorial on : [Function Module Exception Handling|http://help-abap.blogspot.com/2008/10/function-module-exception-handling.html] on my professional blog.

Regards,

Naimesh Patel

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question