Skip to Content
Apr 03, 2013 at 08:34 AM

BRF+ and exception handling in procedure call expressions


Hi BRF+ experts,

We are trying to implement a clean exception handling in the following set-up:

From a function module we call a BRF+ function:





CATCH cx_fdt into lr_cx_fdt.



The BRF+ function in turn executes a "procedure call" expression, invoking a static method m, which may raise an exception of type CX_E.

If the method m raises an exception of type CX_E, the system calls the catch block "CATCH cx_fdt into lr_cx_fdt", which is fine. Investigating the exception instance lr_cx_fdt in the debugger, we noticed that

  • lr_cx_fdt is of the class type CX_FDT_PROCESSING
  • lr_cx_fdt->previous is not initial, and is an instance of CX_FDT_PROCESSING
  • lr_cx_fdt->previous->mt_messages contains three error messages. One of them says (something like) "Failed to execute procedure call...".

All of the above mentioned points are fine from our point of view.

However, we would like to get hold of the original exception instance (of type CX_E, raised in method m), in order to extract more specific error messages from the exception (e.g. via lr_cx_fdt->previous->previous).

Can this be done, and if "yes", how?

We are using a SAP_BASIS component version 740, level 000.

Thanks in advance, and kind regards,

Valentin Huber