11-10-2015 3:19 PM
Hello together,
Is it possible to log an exception with context Information.
The Standard function module BAL_LOG_MSG_ADD has a Parameter i_s_msg-context where you can save additional Information to a message.
There is also a function module BAL_LOG_EXCEPTION_ADD but it has no pararameter for context.
I tried different round trips (for exampel: BAL_LOG_MSG_CHANGE) but I found no way to set context.
Does anybody has an idea?
Best regards
Uwe
11-10-2015 4:21 PM
Hello Uwe,
I hate to be the bearer of bad news but unfortunately context information is not supported for exceptions. As per the FM documentation -
Context information for exceptions and cumulated addition of exceptions are not supported.
What you can try on the other hand is generate the message from the exception object and then call BAL_LOG_MSG_ADD to add the message along with the context.
Note:
BR,
Suhas
PS - If you are super motivated, then enhance the structure BAL_S_EXC & the FM BAL_LOG_EXCEPTION_ADD to support context info
Message was edited by: Suhas Saha
11-10-2015 4:21 PM
Hello Uwe,
I hate to be the bearer of bad news but unfortunately context information is not supported for exceptions. As per the FM documentation -
Context information for exceptions and cumulated addition of exceptions are not supported.
What you can try on the other hand is generate the message from the exception object and then call BAL_LOG_MSG_ADD to add the message along with the context.
Note:
BR,
Suhas
PS - If you are super motivated, then enhance the structure BAL_S_EXC & the FM BAL_LOG_EXCEPTION_ADD to support context info
Message was edited by: Suhas Saha
11-11-2015 9:02 AM
Hello Suhas,
Thank you for your response.
But I found an other way.
First call: BAL_LOG_EXCEPTION ADD
Then: BAL_LOG_MSG_READ
!!! FM throws an incorrect exception msg_not_found
Then: Set the context and call.
BAL_LOG_MSG_CHANGE
Best Regards
Uwe