Keep it working when the function module gets an error

Hi, if any function gets red error when you call the module, it will kick it from the program, as follows:

To prevent this, in the exception section of the function module

Add ERROR_MESSAGE = 999,

When it gets an error, the value you gave subrc will return, the program will continue to run.

You can also read the error message from variables starting with sy-msg,

      MESSAGE ID symsgid TYPE symsgty NUMBER symsgno

         WITH symsgv1 symsgv2 symsgv3 symsgv4 INTO lv_error.

 

Leave a Reply

Your email address will not be published. Required fields are marked *