Skip to Content
Former Member
Jan 25, 2007 at 08:49 PM

Custom error message in SAP application log


Is there a way to add a custom error message to the SAP application log without passing the message variables MSGV1, MSGV2, MSGV3, MSGV4 and the Message class and number.

We want to pass a custom message from the BAPIRET2-MESSAGE without giving it a Message class and number. The reason for this is that we are using class based exceptions instead of the traditional message class with errors. When we catch the class based exception, we take the error text of the exception and put in in the BAPIRET2-message and set the BAPIRET2-TYPE as 'E'. Now we want to add this to the SAP application log.

The call to 'BAL_LOG_MSG_ADD' takes a structure BAL_S_MSG which is just like BAPIRET2. However this function builds the entry to the application log use the message variables MSGV1, MSGV2, MSGV3, MSGV4. There is no provision to pass in the BAPIRET2 message.

  • Add message to application log



i_log_handle = app_log_handle

i_s_msg = log_message