ERROR_MESSAGE: Predefined exception for function modules and methods

No matter how many times mentioned before (thanks to Rahul GopinathAmit BeheraSrinivas Dummu and Mike), I still see sy-subrc check after a function module call without exceptions.

This is so wrong. According to ABAP keyword documentation:

If no exception is raised, a call sets sy-subrc to 0.

So in the above example, sy-subrc will always be equal to zero and condition will never be satisfied. This applies to method calls, too. Let’s experiment to make sure. Continue reading “ERROR_MESSAGE: Predefined exception for function modules and methods”