ABAP log

July 23, 2007

Displaying SAP error messages in a nice way.

Filed under: ABAP, SAP — abaplog @ 8:09 pm

One day I wanted to have my error messages displayed in a nice popup window (users just wanted it to be “RED” and shouting), but not with using the MESSAGE statement that either stops the processing or is shown just as “information” (type “I”). I tried this and that, and almost gave up to using a simple “information” message as I discovered that my colleague had a similar task. He had a luck to find the function module I needed: C14ALD_BAPIRET2_SHOW. His problem was that it takes a table of BAPIRET2 as an argument (with message class and number) but his messages were coming from an external system. This way, the message class did not exis, which SAP didn’t like, showing some strange output. However, he had a complete error message (in BAPIRET2-MESSAGE). We decided to split the message into four (or up to four) parts and pretend that we have actually the message 001 from the message class 00 (whose template looks like &1&2&3&4 and exists on all SAP systems). This way a user could see the complete message, not being screwed up by SAP like it does if it sees some unknown message class. And my task was even much simpler because everything was happening in one system (no problems with wrong message classes).


Blog at WordPress.com.